From 5697c944e2723ecc5cb961ebf9960dc99fcbda29 Mon Sep 17 00:00:00 2001 From: "b.debeaubien" Date: Tue, 30 Dec 2014 16:16:20 -0500 Subject: [PATCH 1/7] #73 - added matchesToken method to BaseCodingDt and doesCodingListMatch to TokenOrListParam --- .../model/base/composite/BaseCodingDt.java | 41 +++++++++++ .../uhn/fhir/rest/param/TokenOrListParam.java | 11 +++ .../base/composite/BaseCodingDtTest.java | 71 +++++++++++++++++++ .../fhir/rest/param/TokenOrListParamTest.java | 37 ++++++++++ 4 files changed, 160 insertions(+) create mode 100644 hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java create mode 100644 hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java index ae028096768..aefeb55e392 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java @@ -91,6 +91,46 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC return getCodeElement().equals(theCoding.getCodeElement()) && getSystemElement().equals(theCoding.getSystemElement()); } + /** + * returns true if this Coding matches a search for the coding specified by theSearchParam, according + * to the following: + * + * @param theSearchParam - coding to test this against + * @return true if the coding matches, false otherwise + */ + public boolean matchesToken(BaseCodingDt theSearchParam) { + if (theSearchParam.isSystemPresent()) { + if (theSearchParam.isSystemBlank()) { + // [parameter]=|[code] matches a code/value that has no system namespace + if (isSystemPresent() && !isSystemBlank()) + return false; + } else { + // [parameter]=[namespace]|[code] matches a code/value in the given system namespace + if (!isSystemPresent()) + return false; + if (!getSystemElement().equals(theSearchParam.getSystemElement())) + return false; + } + } else { + // [parameter]=[code] matches a code/value irrespective of it's system namespace + // (nothing to do for system for this case) + } + + return getCodeElement().equals(theSearchParam.getCodeElement()); + } + + private boolean isSystemPresent() { + return !getSystemElement().isEmpty(); + } + + private boolean isSystemBlank() { + return isSystemPresent() && getSystemElement().getValueAsString().equals(""); + } + /** * Sets the value for code (Symbol in syntax defined by the system) * @@ -109,4 +149,5 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC */ public abstract BaseCodingDt setSystem(String theUri); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java index ad733aee9ce..aeb7bdb093b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java @@ -94,4 +94,15 @@ public class TokenOrListParam extends BaseOrListParam { return new TokenParam(); } + public boolean doesCodingListMatch(List theCodings) { + List paramCodings = getListAsCodings(); + for (BaseCodingDt coding : theCodings) { + for (BaseCodingDt paramCoding : paramCodings) { + if (coding.matchesToken(paramCoding)) { + return true; + } + } + } + return false; + } } diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java new file mode 100644 index 00000000000..3de4d73e83b --- /dev/null +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java @@ -0,0 +1,71 @@ +package ca.uhn.fhir.model.base.composite; + +import static org.junit.Assert.*; + +import ca.uhn.fhir.model.dstu.composite.CodingDt; +import org.junit.Test; + +/** + * Created by Bill de Beaubien on 12/30/2014. + */ +public class BaseCodingDtTest { + private final CodingDt myTokenWithSystem = new CodingDt("http://foo.org", "53"); + private final CodingDt myTokenWithEmptySystem = new CodingDt("", "53"); + private final CodingDt myTokenWithoutSystem = new CodingDt(null, "53"); + + // [parameter]=[namespace]|[code] matches a code/value in the given system namespace + @Test + public void whenTokenIncludesSystem_CodingWithSameSystemAndCode_shouldMatch() { + assertTrue(new CodingDt("http://foo.org", "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithDifferentSystem_shouldNotMatch() { + assertFalse(new CodingDt("http://bar.org", "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithBlankSystem_shouldNotMatch() { + assertFalse(new CodingDt("", "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithNoSystem_shouldNotMatch() { + assertFalse(new CodingDt(null, "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithSameSystemAndDifferentCode_shouldNotMatch() { + assertFalse(new CodingDt("http://foo.org", "11").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithSameSystemAndNoCode_shouldNotMatch() { + assertFalse(new CodingDt("http://foo.org", null).matchesToken(myTokenWithSystem)); + } + + // [parameter]=[code] matches a code/value irrespective of it's system namespace + @Test + public void whenTokenIncludesNoSystem_CodingWithAnySystemAndCode_shouldMatch() { + assertTrue(new CodingDt("http://foo.org", "53").matchesToken(myTokenWithoutSystem)); + assertTrue(new CodingDt("http://bar.org", "53").matchesToken(myTokenWithoutSystem)); + assertTrue(new CodingDt("", "53").matchesToken(myTokenWithoutSystem)); + assertTrue(new CodingDt(null, "53").matchesToken(myTokenWithoutSystem)); + } + + // [parameter]=|[code] matches a code/value that has no system namespace + @Test + public void whenTokenIncludesEmptySystem_CodeWithNoSystem_shouldMatch() { + assertTrue(new CodingDt(null, "53").matchesToken(myTokenWithEmptySystem)); + } + + @Test + public void whenTokenIncludesEmptySystem_CodeWithBlankSystem_shouldMatch() { + assertTrue(new CodingDt("", "53").matchesToken(myTokenWithEmptySystem)); + } + + @Test + public void whenTokenIncludesEmptySystem_CodeWithSystem_shouldNotMatch() { + assertFalse(new CodingDt("http://bar.org", "53").matchesToken(myTokenWithEmptySystem)); + } +} diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java new file mode 100644 index 00000000000..2c941236ab7 --- /dev/null +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java @@ -0,0 +1,37 @@ +package ca.uhn.fhir.rest.param; + +import static org.junit.Assert.*; + +import ca.uhn.fhir.model.dstu.composite.CodingDt; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +public class TokenOrListParamTest { + @Test + public void whenParamListHasAnyMatchingCodingsForCodingList_doesCodingListMatch_shouldBeTrue() { + TokenOrListParam params = new TokenOrListParam(); + params.add("http://foo.org", "53"); + params.add("http://bar.org", "52"); + + List codings = new ArrayList(); + codings.add(new CodingDt("http://baz.org", "53")); + codings.add(new CodingDt("http://bar.org", "52")); + + assertTrue(params.doesCodingListMatch(codings)); + } + + @Test + public void whenParamListHasNoMatchingCodingsForCodingList_doesCodingListMatch_shouldBeFalse() { + TokenOrListParam params = new TokenOrListParam(); + params.add("http://foo.org", "53"); + params.add("http://bar.org", "52"); + + List codings = new ArrayList(); + codings.add(new CodingDt("http://baz.org", "53")); + codings.add(new CodingDt("http://bar.org", "11")); + + assertFalse(params.doesCodingListMatch(codings)); + } +} From 261ed51c7f8a32429d24eaf8ffe7e22e986c2c92 Mon Sep 17 00:00:00 2001 From: Alexander Henket Date: Wed, 7 Jan 2015 13:24:28 +0100 Subject: [PATCH 2/7] Update RestfulServer.java I believe that in line 538 you are falsely assuming that multiple _* parts in the path could not happen. As of DSTU2 there's _meta/_delete. Unfortunately the DSTU for Comment erroneously lists _meta-delete. --- .../src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 67126542d2a..94f82ed243e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -535,6 +535,7 @@ public class RestfulServer extends HttpServlet { operation = Constants.PARAM_HISTORY; } } else if (nextString.startsWith("_")) { + //FIXME: this would be untrue for _meta/_delete if (operation != null) { throw new InvalidRequestException("URL Path contains two operations (part beginning with _): " + requestPath); } From f7209b45efaeca0397652833c86582cf3f4f10e0 Mon Sep 17 00:00:00 2001 From: "b.debeaubien" Date: Tue, 30 Dec 2014 16:16:20 -0500 Subject: [PATCH 3/7] #73 - added matchesToken method to BaseCodingDt and doesCodingListMatch to TokenOrListParam --- .../model/base/composite/BaseCodingDt.java | 41 +++++++++++ .../uhn/fhir/rest/param/TokenOrListParam.java | 11 +++ .../base/composite/BaseCodingDtTest.java | 71 +++++++++++++++++++ .../fhir/rest/param/TokenOrListParamTest.java | 37 ++++++++++ 4 files changed, 160 insertions(+) create mode 100644 hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java create mode 100644 hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java index 192d4ad8e60..c21fb57ba9a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java @@ -91,6 +91,46 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC return getCodeElement().equals(theCoding.getCodeElement()) && getSystemElement().equals(theCoding.getSystemElement()); } + /** + * returns true if this Coding matches a search for the coding specified by theSearchParam, according + * to the following: + *
    + *
  • [parameter]=[namespace]|[code] matches a code/value in the given system namespace
  • + *
  • [parameter]=[code] matches a code/value irrespective of it's system namespace
  • + *
  • [parameter]=|[code] matches a code/value that has no system namespace
  • + *
+ * @param theSearchParam - coding to test this against + * @return true if the coding matches, false otherwise + */ + public boolean matchesToken(BaseCodingDt theSearchParam) { + if (theSearchParam.isSystemPresent()) { + if (theSearchParam.isSystemBlank()) { + // [parameter]=|[code] matches a code/value that has no system namespace + if (isSystemPresent() && !isSystemBlank()) + return false; + } else { + // [parameter]=[namespace]|[code] matches a code/value in the given system namespace + if (!isSystemPresent()) + return false; + if (!getSystemElement().equals(theSearchParam.getSystemElement())) + return false; + } + } else { + // [parameter]=[code] matches a code/value irrespective of it's system namespace + // (nothing to do for system for this case) + } + + return getCodeElement().equals(theSearchParam.getCodeElement()); + } + + private boolean isSystemPresent() { + return !getSystemElement().isEmpty(); + } + + private boolean isSystemBlank() { + return isSystemPresent() && getSystemElement().getValueAsString().equals(""); + } + /** * Sets the value for code (Symbol in syntax defined by the system) * @@ -109,4 +149,5 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC */ public abstract BaseCodingDt setSystem(String theUri); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java index 25ab29316e9..167e9d12ecc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenOrListParam.java @@ -94,4 +94,15 @@ public class TokenOrListParam extends BaseOrListParam { return new TokenParam(); } + public boolean doesCodingListMatch(List theCodings) { + List paramCodings = getListAsCodings(); + for (BaseCodingDt coding : theCodings) { + for (BaseCodingDt paramCoding : paramCodings) { + if (coding.matchesToken(paramCoding)) { + return true; + } + } + } + return false; + } } diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java new file mode 100644 index 00000000000..3de4d73e83b --- /dev/null +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/model/base/composite/BaseCodingDtTest.java @@ -0,0 +1,71 @@ +package ca.uhn.fhir.model.base.composite; + +import static org.junit.Assert.*; + +import ca.uhn.fhir.model.dstu.composite.CodingDt; +import org.junit.Test; + +/** + * Created by Bill de Beaubien on 12/30/2014. + */ +public class BaseCodingDtTest { + private final CodingDt myTokenWithSystem = new CodingDt("http://foo.org", "53"); + private final CodingDt myTokenWithEmptySystem = new CodingDt("", "53"); + private final CodingDt myTokenWithoutSystem = new CodingDt(null, "53"); + + // [parameter]=[namespace]|[code] matches a code/value in the given system namespace + @Test + public void whenTokenIncludesSystem_CodingWithSameSystemAndCode_shouldMatch() { + assertTrue(new CodingDt("http://foo.org", "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithDifferentSystem_shouldNotMatch() { + assertFalse(new CodingDt("http://bar.org", "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithBlankSystem_shouldNotMatch() { + assertFalse(new CodingDt("", "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithNoSystem_shouldNotMatch() { + assertFalse(new CodingDt(null, "53").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithSameSystemAndDifferentCode_shouldNotMatch() { + assertFalse(new CodingDt("http://foo.org", "11").matchesToken(myTokenWithSystem)); + } + + @Test + public void whenTokenIncludesSystem_CodingWithSameSystemAndNoCode_shouldNotMatch() { + assertFalse(new CodingDt("http://foo.org", null).matchesToken(myTokenWithSystem)); + } + + // [parameter]=[code] matches a code/value irrespective of it's system namespace + @Test + public void whenTokenIncludesNoSystem_CodingWithAnySystemAndCode_shouldMatch() { + assertTrue(new CodingDt("http://foo.org", "53").matchesToken(myTokenWithoutSystem)); + assertTrue(new CodingDt("http://bar.org", "53").matchesToken(myTokenWithoutSystem)); + assertTrue(new CodingDt("", "53").matchesToken(myTokenWithoutSystem)); + assertTrue(new CodingDt(null, "53").matchesToken(myTokenWithoutSystem)); + } + + // [parameter]=|[code] matches a code/value that has no system namespace + @Test + public void whenTokenIncludesEmptySystem_CodeWithNoSystem_shouldMatch() { + assertTrue(new CodingDt(null, "53").matchesToken(myTokenWithEmptySystem)); + } + + @Test + public void whenTokenIncludesEmptySystem_CodeWithBlankSystem_shouldMatch() { + assertTrue(new CodingDt("", "53").matchesToken(myTokenWithEmptySystem)); + } + + @Test + public void whenTokenIncludesEmptySystem_CodeWithSystem_shouldNotMatch() { + assertFalse(new CodingDt("http://bar.org", "53").matchesToken(myTokenWithEmptySystem)); + } +} diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java new file mode 100644 index 00000000000..2c941236ab7 --- /dev/null +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/param/TokenOrListParamTest.java @@ -0,0 +1,37 @@ +package ca.uhn.fhir.rest.param; + +import static org.junit.Assert.*; + +import ca.uhn.fhir.model.dstu.composite.CodingDt; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +public class TokenOrListParamTest { + @Test + public void whenParamListHasAnyMatchingCodingsForCodingList_doesCodingListMatch_shouldBeTrue() { + TokenOrListParam params = new TokenOrListParam(); + params.add("http://foo.org", "53"); + params.add("http://bar.org", "52"); + + List codings = new ArrayList(); + codings.add(new CodingDt("http://baz.org", "53")); + codings.add(new CodingDt("http://bar.org", "52")); + + assertTrue(params.doesCodingListMatch(codings)); + } + + @Test + public void whenParamListHasNoMatchingCodingsForCodingList_doesCodingListMatch_shouldBeFalse() { + TokenOrListParam params = new TokenOrListParam(); + params.add("http://foo.org", "53"); + params.add("http://bar.org", "52"); + + List codings = new ArrayList(); + codings.add(new CodingDt("http://baz.org", "53")); + codings.add(new CodingDt("http://bar.org", "11")); + + assertFalse(params.doesCodingListMatch(codings)); + } +} From 4c998d2f1b2c39a6f44ce97a2cd7298113d66468 Mon Sep 17 00:00:00 2001 From: harsha89 Date: Thu, 15 Jan 2015 14:38:33 +0530 Subject: [PATCH 4/7] extracting request path generating code to protected method in order to users to have their own mapping to FHIR HAPI rest server #85 --- .../ca/uhn/fhir/rest/server/RestfulServer.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 450aed7af83..bb44d6ac459 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -166,7 +166,7 @@ public class RestfulServer extends HttpServlet { /** * Count length of URL string, but treating unescaped sequences (e.g. ' ') as their unescaped equivalent (%20) */ - private int escapedLength(String theServletPath) { + protected int escapedLength(String theServletPath) { int delta = 0; for (int i = 0; i < theServletPath.length(); i++) { char next = theServletPath.charAt(i); @@ -480,13 +480,11 @@ public class RestfulServer extends HttpServlet { String operation = null; String compartment = null; - String requestPath = requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath)); + String requestPath = getRequestPath(requestFullPath, servletContextPath, servletPath); if (requestPath.length() > 0 && requestPath.charAt(0) == '/') { requestPath = requestPath.substring(1); } - fhirServerBase = getServerBaseForRequest(theRequest); - String completeUrl = StringUtils.isNotBlank(theRequest.getQueryString()) ? requestUrl + "?" + theRequest.getQueryString() : requestUrl.toString(); Map params = new HashMap(theRequest.getParameterMap()); @@ -1493,4 +1491,16 @@ public class RestfulServer extends HttpServlet { } } + /** + * Allows users of RestfulServer to override the getRequestPath method to let them build their custom request path + * implementation + * + * @param requestFullPath the full request path + * @param servletContextPath the servelet context path + * @param servletPath the servelet path + * @return created resource path + */ + protected String getRequestPath(String requestFullPath, String servletContextPath, String servletPath) { + return requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath)); + } } From 1348b9f1b46e85f72c9f47cba4747c26e50e6ddc Mon Sep 17 00:00:00 2001 From: James Agnew Date: Tue, 27 Jan 2015 11:14:30 -0500 Subject: [PATCH 5/7] Add HTTPS support to public server --- .../ca/uhn/fhirtest/TestRestfulServer.java | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java index f065f414650..3b4aa36ed8c 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java @@ -2,7 +2,9 @@ package ca.uhn.fhirtest; import java.util.List; +import javax.servlet.ServletContext; import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.context.ApplicationContext; @@ -136,7 +138,7 @@ public class TestRestfulServer extends RestfulServer { throw new ServletException("Missing system property: " + baseUrlProperty); } } - setServerAddressStrategy(new HardcodedServerAddressStrategy(baseUrl)); + setServerAddressStrategy(new MyHardcodedServerAddressStrategy(baseUrl)); /* * This is a simple paging strategy that keeps the last 10 @@ -155,4 +157,32 @@ public class TestRestfulServer extends RestfulServer { } + /** + * The public server is deployed to http://fhirtest.uhn.ca and the JEE webserver + * where this FHIR server is deployed is actually fronted by an Apache HTTPd instance, + * so we use an address strategy to let the server know how it should address itself. + */ + private static class MyHardcodedServerAddressStrategy extends HardcodedServerAddressStrategy { + + public MyHardcodedServerAddressStrategy(String theBaseUrl) { + super(theBaseUrl); + } + + @Override + public String determineServerBase(ServletContext theServletContext, HttpServletRequest theRequest) { + /* + * This is a bit of a hack, but we want to support both HTTP and HTTPS seamlessly + * so we have the outer httpd proxy relay requests to the Java container on + * port 28080 for http and 28081 for https. + */ + String retVal = super.determineServerBase(theServletContext, theRequest); + if (theRequest.getRequestURL().indexOf("28081") != -1) { + retVal = retVal.replace("http://", "https://"); + } + return retVal; + } + + } + + } From d3d242bc7e4c7dda2f4a5e6da59357b18ee58c79 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Tue, 27 Jan 2015 14:59:10 -0500 Subject: [PATCH 6/7] Documentation updates --- .../server/IServerConformanceProvider.java | 2 +- .../instance/formats/FormatUtilities.java | 174 +- .../org/hl7/fhir/instance/model/Address.java | 1252 +- .../java/org/hl7/fhir/instance/model/Age.java | 130 +- .../org/hl7/fhir/instance/model/Alert.java | 952 +- .../instance/model/AllergyIntolerance.java | 3512 +++--- .../hl7/fhir/instance/model/Appointment.java | 2690 ++-- .../instance/model/AppointmentResponse.java | 1532 +-- .../hl7/fhir/instance/model/Attachment.java | 958 +- .../hl7/fhir/instance/model/Availability.java | 760 +- .../fhir/instance/model/BackboneElement.java | 214 +- .../org/hl7/fhir/instance/model/Base.java | 166 +- .../fhir/instance/model/Base64BinaryType.java | 148 +- .../org/hl7/fhir/instance/model/Basic.java | 664 +- .../org/hl7/fhir/instance/model/Binary.java | 390 +- .../hl7/fhir/instance/model/BooleanType.java | 180 +- .../org/hl7/fhir/instance/model/Bundle.java | 2726 ++-- .../hl7/fhir/instance/model/CareActivity.java | 2642 ++-- .../org/hl7/fhir/instance/model/CarePlan.java | 4676 +++---- .../hl7/fhir/instance/model/CarePlan2.java | 1710 +-- .../fhir/instance/model/ClaimResponse.java | 6834 +++++----- .../instance/model/ClinicalAssessment.java | 2798 ++--- .../org/hl7/fhir/instance/model/CodeType.java | 158 +- .../fhir/instance/model/CodeableConcept.java | 346 +- .../org/hl7/fhir/instance/model/Coding.java | 842 +- .../fhir/instance/model/Communication.java | 1832 +-- .../instance/model/CommunicationRequest.java | 2426 ++-- .../hl7/fhir/instance/model/Comparison.java | 214 +- .../hl7/fhir/instance/model/Composition.java | 3140 ++--- .../hl7/fhir/instance/model/ConceptMap.java | 3594 +++--- .../hl7/fhir/instance/model/Condition.java | 3236 ++--- .../fhir/instance/model/Configuration.java | 210 +- .../hl7/fhir/instance/model/Conformance.java | 10480 ++++++++-------- .../hl7/fhir/instance/model/Constants.java | 78 +- .../hl7/fhir/instance/model/ContactPoint.java | 1002 +- .../org/hl7/fhir/instance/model/Contract.java | 4414 +++---- .../fhir/instance/model/Contraindication.java | 1560 +-- .../org/hl7/fhir/instance/model/Count.java | 130 +- .../org/hl7/fhir/instance/model/Coverage.java | 1430 +-- .../hl7/fhir/instance/model/DataElement.java | 3728 +++--- .../hl7/fhir/instance/model/DateAndTime.java | 1178 +- .../hl7/fhir/instance/model/DateTimeType.java | 382 +- .../org/hl7/fhir/instance/model/DateType.java | 244 +- .../hl7/fhir/instance/model/DecimalType.java | 312 +- .../org/hl7/fhir/instance/model/Device.java | 1606 +-- .../fhir/instance/model/DeviceComponent.java | 1786 +-- .../hl7/fhir/instance/model/DeviceMetric.java | 2338 ++-- .../fhir/instance/model/DeviceUseRequest.java | 2438 ++-- .../instance/model/DeviceUseStatement.java | 1098 +- .../fhir/instance/model/DiagnosticOrder.java | 2978 ++--- .../fhir/instance/model/DiagnosticReport.java | 2500 ++-- .../org/hl7/fhir/instance/model/Distance.java | 130 +- .../fhir/instance/model/DocumentManifest.java | 1718 +-- .../instance/model/DocumentReference.java | 4206 +++---- .../fhir/instance/model/DomainResource.java | 442 +- .../org/hl7/fhir/instance/model/Duration.java | 130 +- .../org/hl7/fhir/instance/model/Element.java | 332 +- .../instance/model/ElementDefinition.java | 6060 ++++----- .../instance/model/EligibilityRequest.java | 846 +- .../instance/model/EligibilityResponse.java | 1352 +- .../hl7/fhir/instance/model/Encounter.java | 4052 +++--- .../instance/model/EnrollmentRequest.java | 1168 +- .../instance/model/EnrollmentResponse.java | 1352 +- .../hl7/fhir/instance/model/EnumFactory.java | 106 +- .../hl7/fhir/instance/model/Enumeration.java | 206 +- .../instance/model/ExplanationOfBenefit.java | 1352 +- .../hl7/fhir/instance/model/Extension.java | 318 +- .../instance/model/ExtensionDefinition.java | 2816 ++--- .../fhir/instance/model/ExtensionHelper.java | 290 +- .../fhir/instance/model/FamilyHistory.java | 1928 +-- .../org/hl7/fhir/instance/model/FhirEnum.java | 88 +- .../org/hl7/fhir/instance/model/Goal.java | 1062 +- .../hl7/fhir/instance/model/GoalRequest.java | 1360 +- .../org/hl7/fhir/instance/model/Group.java | 1620 +-- .../instance/model/HealthcareService.java | 3662 +++--- .../hl7/fhir/instance/model/HumanName.java | 1272 +- .../org/hl7/fhir/instance/model/IdType.java | 136 +- .../hl7/fhir/instance/model/Identifier.java | 1000 +- .../model/ImagingObjectSelection.java | 2402 ++-- .../hl7/fhir/instance/model/ImagingStudy.java | 6942 +++++----- .../hl7/fhir/instance/model/Immunization.java | 3436 ++--- .../model/ImmunizationRecommendation.java | 2076 +-- .../hl7/fhir/instance/model/InstantType.java | 432 +- .../instance/model/InstitutionalClaim.java | 7570 +++++------ .../hl7/fhir/instance/model/IntegerType.java | 208 +- .../org/hl7/fhir/instance/model/List_.java | 1720 +-- .../org/hl7/fhir/instance/model/Location.java | 2062 +-- .../org/hl7/fhir/instance/model/Media.java | 1700 +-- .../hl7/fhir/instance/model/Medication.java | 1882 +-- .../model/MedicationAdministration.java | 2382 ++-- .../instance/model/MedicationDispense.java | 3250 ++--- .../model/MedicationPrescription.java | 3054 ++--- .../instance/model/MedicationStatement.java | 1598 +-- .../fhir/instance/model/MessageHeader.java | 2906 ++--- .../org/hl7/fhir/instance/model/Money.java | 130 +- .../hl7/fhir/instance/model/NamingSystem.java | 2530 ++-- .../hl7/fhir/instance/model/Narrative.java | 538 +- .../fhir/instance/model/NutritionOrder.java | 4104 +++--- .../hl7/fhir/instance/model/Observation.java | 3986 +++--- .../org/hl7/fhir/instance/model/OidType.java | 136 +- .../instance/model/OperationDefinition.java | 4364 +++---- .../fhir/instance/model/OperationOutcome.java | 934 +- .../fhir/instance/model/OralHealthClaim.java | 9114 +++++++------- .../org/hl7/fhir/instance/model/Order.java | 1296 +- .../fhir/instance/model/OrderResponse.java | 1400 +-- .../hl7/fhir/instance/model/Organization.java | 1742 +-- .../org/hl7/fhir/instance/model/Other.java | 664 +- .../hl7/fhir/instance/model/Parameters.java | 834 +- .../org/hl7/fhir/instance/model/Patient.java | 3402 ++--- .../fhir/instance/model/PaymentNotice.java | 1136 +- .../instance/model/PaymentReconciliation.java | 2808 ++--- .../fhir/instance/model/PendedRequest.java | 1290 +- .../org/hl7/fhir/instance/model/Period.java | 374 +- .../org/hl7/fhir/instance/model/Person.java | 1852 +-- .../fhir/instance/model/PharmacyClaim.java | 7804 ++++++------ .../hl7/fhir/instance/model/Practitioner.java | 2114 ++-- .../fhir/instance/model/PrimitiveType.java | 228 +- .../hl7/fhir/instance/model/Procedure.java | 2212 ++-- .../fhir/instance/model/ProcedureRequest.java | 2490 ++-- .../instance/model/ProfessionalClaim.java | 7570 +++++------ .../org/hl7/fhir/instance/model/Profile.java | 2896 ++--- .../org/hl7/fhir/instance/model/Property.java | 252 +- .../hl7/fhir/instance/model/Provenance.java | 2250 ++-- .../org/hl7/fhir/instance/model/Quantity.java | 936 +- .../fhir/instance/model/Questionnaire.java | 3290 ++--- .../instance/model/QuestionnaireAnswers.java | 2732 ++-- .../org/hl7/fhir/instance/model/Range.java | 274 +- .../org/hl7/fhir/instance/model/Ratio.java | 274 +- .../hl7/fhir/instance/model/Readjudicate.java | 1430 +-- .../hl7/fhir/instance/model/Reference.java | 396 +- .../fhir/instance/model/ReferralRequest.java | 1874 +-- .../fhir/instance/model/RelatedPerson.java | 1096 +- .../org/hl7/fhir/instance/model/Resource.java | 1144 +- .../instance/model/ResourceEnumerations.java | 30 +- .../hl7/fhir/instance/model/ResourceType.java | 626 +- .../org/hl7/fhir/instance/model/Reversal.java | 2362 ++-- .../fhir/instance/model/RiskAssessment.java | 1648 +-- .../hl7/fhir/instance/model/SampledData.java | 902 +- .../fhir/instance/model/SearchParameter.java | 1604 +-- .../fhir/instance/model/SecurityEvent.java | 6230 ++++----- .../org/hl7/fhir/instance/model/SidType.java | 130 +- .../org/hl7/fhir/instance/model/Slot.java | 1344 +- .../org/hl7/fhir/instance/model/Specimen.java | 2910 ++--- .../fhir/instance/model/StatusRequest.java | 1058 +- .../fhir/instance/model/StatusResponse.java | 1622 +-- .../hl7/fhir/instance/model/StringType.java | 196 +- .../hl7/fhir/instance/model/Subscription.java | 2348 ++-- .../hl7/fhir/instance/model/Substance.java | 1064 +- .../org/hl7/fhir/instance/model/Supply.java | 2138 ++-- .../model/SupportingDocumentation.java | 1758 +-- .../org/hl7/fhir/instance/model/TimeType.java | 136 +- .../org/hl7/fhir/instance/model/Timing.java | 1708 +-- .../org/hl7/fhir/instance/model/Type.java | 84 +- .../org/hl7/fhir/instance/model/UriType.java | 310 +- .../org/hl7/fhir/instance/model/UuidType.java | 130 +- .../org/hl7/fhir/instance/model/ValueSet.java | 6584 +++++----- .../hl7/fhir/instance/model/VisionClaim.java | 7570 +++++------ .../java/org/hl7/fhir/utilities/CSFile.java | 140 +- .../org/hl7/fhir/utilities/FileNotifier.java | 12 +- .../org/hl7/fhir/utilities/Inflector.java | 1236 +- .../org/hl7/fhir/utilities/MyURIResolver.java | 140 +- .../org/hl7/fhir/utilities/Utilities.java | 1294 +- .../hl7/fhir/utilities/ZipURIResolver.java | 122 +- .../hl7/fhir/utilities/xhtml/NodeType.java | 60 +- .../hl7/fhir/utilities/xhtml/XhtmlNode.java | 490 +- src/changes/changes.xml | 4 + 166 files changed, 152652 insertions(+), 152648 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IServerConformanceProvider.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IServerConformanceProvider.java index e7e1fad3af5..4f49c5ccf33 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IServerConformanceProvider.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IServerConformanceProvider.java @@ -33,4 +33,4 @@ public interface IServerConformanceProvider { */ public abstract T getServerConformance(HttpServletRequest theRequest); -} \ No newline at end of file +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/formats/FormatUtilities.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/formats/FormatUtilities.java index 984f7346bf1..b93b5c7a6c3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/formats/FormatUtilities.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/formats/FormatUtilities.java @@ -20,90 +20,90 @@ package org.hl7.fhir.instance.formats; * #L% */ - -/* -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. - -*/ - -import java.math.BigDecimal; -import java.net.URI; - -import org.apache.commons.codec.binary.Base64; -import org.hl7.fhir.instance.model.DateAndTime; - -public abstract class FormatUtilities { - public static final String ID_REGEX = "[A-Za-z0-9\\-\\.]{1,64}"; - protected static final String FHIR_NS = "http://hl7.org/fhir"; - protected static final String ATOM_NS = "http://www.w3.org/2005/Atom"; - protected static final String GDATA_NS = "http://schemas.google.com/g/2005"; - - protected String toString(String value) { - return value; - } - - protected String toString(int value) { - return java.lang.Integer.toString(value); - } - - protected String toString(boolean value) { - return java.lang.Boolean.toString(value); - } - - protected String toString(BigDecimal value) { - return value.toString(); - } - - protected String toString(URI value) { - return value.toString(); - } - - public static String toString(byte[] value) { - byte[] encodeBase64 = Base64.encodeBase64(value); - return new String(encodeBase64); - } - - protected String toString(DateAndTime value) { - return value.toString(); - } - - public static boolean isValidId(String tail) { - return tail.matches(ID_REGEX); - } - - public static String makeId(String candidate) { - StringBuilder b = new StringBuilder(); - for (char c : candidate.toCharArray()) - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '-') - b.append(c); - return b.toString(); - } - - - - -} + +/* +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. + +*/ + +import java.math.BigDecimal; +import java.net.URI; + +import org.apache.commons.codec.binary.Base64; +import org.hl7.fhir.instance.model.DateAndTime; + +public abstract class FormatUtilities { + public static final String ID_REGEX = "[A-Za-z0-9\\-\\.]{1,64}"; + protected static final String FHIR_NS = "http://hl7.org/fhir"; + protected static final String ATOM_NS = "http://www.w3.org/2005/Atom"; + protected static final String GDATA_NS = "http://schemas.google.com/g/2005"; + + protected String toString(String value) { + return value; + } + + protected String toString(int value) { + return java.lang.Integer.toString(value); + } + + protected String toString(boolean value) { + return java.lang.Boolean.toString(value); + } + + protected String toString(BigDecimal value) { + return value.toString(); + } + + protected String toString(URI value) { + return value.toString(); + } + + public static String toString(byte[] value) { + byte[] encodeBase64 = Base64.encodeBase64(value); + return new String(encodeBase64); + } + + protected String toString(DateAndTime value) { + return value.toString(); + } + + public static boolean isValidId(String tail) { + return tail.matches(ID_REGEX); + } + + public static String makeId(String candidate) { + StringBuilder b = new StringBuilder(); + for (char c : candidate.toCharArray()) + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '-') + b.append(c); + return b.toString(); + } + + + + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java index aa3ac1db682..f16050a1f30 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java @@ -20,634 +20,634 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. - */ -@DatatypeDef(name="Address") -public class Address extends Type implements ICompositeType{ - - public enum AddressUse implements FhirEnum { - /** - * A communication address at a home. - */ - HOME, - /** - * An office address. First choice for business related contacts during business hours. - */ - WORK, - /** - * A temporary address. The period can provide more detailed information. - */ - TEMP, - /** - * This address is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * added to help the parsers - */ - NULL; - - 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)) - return HOME; - if ("work".equals(codeString)) - return WORK; - if ("temp".equals(codeString)) - return TEMP; - if ("old".equals(codeString)) - return OLD; - throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HOME: return ""; - case WORK: return ""; - case TEMP: return ""; - case OLD: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HOME: return "A communication address at a home."; - case WORK: return "An office address. First choice for business related contacts during business hours."; - case TEMP: return "A temporary address. The period can provide more detailed information."; - case OLD: return "This address is no longer in use (or was never correct, but retained for records)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - default: return "?"; - } - } - } - - public static class AddressUseEnumFactory implements EnumFactory { - public AddressUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return AddressUse.HOME; - if ("work".equals(codeString)) - return AddressUse.WORK; - if ("temp".equals(codeString)) - return AddressUse.TEMP; - if ("old".equals(codeString)) - return AddressUse.OLD; - throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); - } - public String toCode(AddressUse code) throws IllegalArgumentException { - if (code == AddressUse.HOME) - return "home"; - if (code == AddressUse.WORK) - return "work"; - if (code == AddressUse.TEMP) - return "temp"; - if (code == AddressUse.OLD) - return "old"; - return "?"; - } - } - - /** - * The purpose of this address. - */ - @Child(name="use", type={CodeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." ) - protected Enumeration use; - - /** - * A full text representation of the address. - */ - @Child(name="text", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." ) - protected StringType text; - - /** + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. + */ +@DatatypeDef(name="Address") +public class Address extends Type implements ICompositeType{ + + public enum AddressUse implements FhirEnum { + /** + * A communication address at a home. + */ + HOME, + /** + * An office address. First choice for business related contacts during business hours. + */ + WORK, + /** + * A temporary address. The period can provide more detailed information. + */ + TEMP, + /** + * This address is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * added to help the parsers + */ + NULL; + + 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)) + return HOME; + if ("work".equals(codeString)) + return WORK; + if ("temp".equals(codeString)) + return TEMP; + if ("old".equals(codeString)) + return OLD; + throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HOME: return ""; + case WORK: return ""; + case TEMP: return ""; + case OLD: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HOME: return "A communication address at a home."; + case WORK: return "An office address. First choice for business related contacts during business hours."; + case TEMP: return "A temporary address. The period can provide more detailed information."; + case OLD: return "This address is no longer in use (or was never correct, but retained for records)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + default: return "?"; + } + } + } + + public static class AddressUseEnumFactory implements EnumFactory { + public AddressUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return AddressUse.HOME; + if ("work".equals(codeString)) + return AddressUse.WORK; + if ("temp".equals(codeString)) + return AddressUse.TEMP; + if ("old".equals(codeString)) + return AddressUse.OLD; + throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); + } + public String toCode(AddressUse code) throws IllegalArgumentException { + if (code == AddressUse.HOME) + return "home"; + if (code == AddressUse.WORK) + return "work"; + if (code == AddressUse.TEMP) + return "temp"; + if (code == AddressUse.OLD) + return "old"; + return "?"; + } + } + + /** + * The purpose of this address. + */ + @Child(name="use", type={CodeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." ) + protected Enumeration use; + + /** + * A full text representation of the address. + */ + @Child(name="text", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." ) + protected StringType text; + + /** * This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information. - */ - @Child(name="line", type={StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Street name, number, direction & P.O. Box etc", formalDefinition="This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information." ) - protected List line; - - /** - * The name of the city, town, village or other community or delivery center. - */ - @Child(name="city", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) - protected StringType city; - - /** - * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - @Child(name="state", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Sub-unit of country (abreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) - protected StringType state; - - /** - * A postal code designating a region defined by the postal service. - */ - @Child(name="postalCode", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) - protected StringType postalCode; - - /** - * Country - a nation as commonly understood or generally accepted. - */ - @Child(name="country", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) - protected StringType country; - - /** - * Time period when address was/is in use. - */ - @Child(name="period", type={Period.class}, order=6, min=0, max=1) - @Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." ) - protected Period period; - - private static final long serialVersionUID = -470351694L; - - public Address() { - super(); - } - - /** - * @return {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Address setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return The purpose of this address. - */ - public AddressUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value The purpose of this address. - */ - public Address setUse(AddressUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(AddressUse.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public Address setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A full text representation of the address. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A full text representation of the address. - */ - public Address setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** +P.O. Box number, delivery hints, and similar address information. + */ + @Child(name="line", type={StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Street name, number, direction & P.O. Box etc", formalDefinition="This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information." ) + protected List line; + + /** + * The name of the city, town, village or other community or delivery center. + */ + @Child(name="city", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) + protected StringType city; + + /** + * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + @Child(name="state", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Sub-unit of country (abreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) + protected StringType state; + + /** + * A postal code designating a region defined by the postal service. + */ + @Child(name="postalCode", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) + protected StringType postalCode; + + /** + * Country - a nation as commonly understood or generally accepted. + */ + @Child(name="country", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) + protected StringType country; + + /** + * Time period when address was/is in use. + */ + @Child(name="period", type={Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." ) + protected Period period; + + private static final long serialVersionUID = -470351694L; + + public Address() { + super(); + } + + /** + * @return {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Address setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return The purpose of this address. + */ + public AddressUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value The purpose of this address. + */ + public Address setUse(AddressUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(AddressUse.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public Address setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A full text representation of the address. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A full text representation of the address. + */ + public Address setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - public List getLine() { - if (this.line == null) - this.line = new ArrayList(); - return this.line; - } - - public boolean hasLine() { - if (this.line == null) - return false; - for (StringType item : this.line) - if (!item.isEmpty()) - return true; - return false; - } - - /** +P.O. Box number, delivery hints, and similar address information.) + */ + public List getLine() { + if (this.line == null) + this.line = new ArrayList(); + return this.line; + } + + public boolean hasLine() { + if (this.line == null) + return false; + for (StringType item : this.line) + if (!item.isEmpty()) + return true; + return false; + } + + /** * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - // syntactic sugar - public StringType addLineElement() {//2 - StringType t = new StringType(); - if (this.line == null) - this.line = new ArrayList(); - this.line.add(t); - return t; - } - - /** +P.O. Box number, delivery hints, and similar address information.) + */ + // syntactic sugar + public StringType addLineElement() {//2 + StringType t = new StringType(); + if (this.line == null) + this.line = new ArrayList(); + this.line.add(t); + return t; + } + + /** * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - public Address addLine(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.line == null) - this.line = new ArrayList(); - this.line.add(t); - return this; - } - - /** +P.O. Box number, delivery hints, and similar address information.) + */ + public Address addLine(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.line == null) + this.line = new ArrayList(); + this.line.add(t); + return this; + } + + /** * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, -P.O. Box number, delivery hints, and similar address information.) - */ - public boolean hasLine(String value) { - if (this.line == null) - return false; - for (StringType v : this.line) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value - */ - public StringType getCityElement() { - if (this.city == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.city"); - else if (Configuration.doAutoCreate()) - this.city = new StringType(); - return this.city; - } - - public boolean hasCityElement() { - return this.city != null && !this.city.isEmpty(); - } - - public boolean hasCity() { - return this.city != null && !this.city.isEmpty(); - } - - /** - * @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value - */ - public Address setCityElement(StringType value) { - this.city = value; - return this; - } - - /** - * @return The name of the city, town, village or other community or delivery center. - */ - public String getCity() { - return this.city == null ? null : this.city.getValue(); - } - - /** - * @param value The name of the city, town, village or other community or delivery center. - */ - public Address setCity(String value) { - if (Utilities.noString(value)) - this.city = null; - else { - if (this.city == null) - this.city = new StringType(); - this.city.setValue(value); - } - return this; - } - - /** - * @return {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public StringType getStateElement() { - if (this.state == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.state"); - else if (Configuration.doAutoCreate()) - this.state = new StringType(); - return this.state; - } - - public boolean hasStateElement() { - return this.state != null && !this.state.isEmpty(); - } - - public boolean hasState() { - return this.state != null && !this.state.isEmpty(); - } - - /** - * @param value {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public Address setStateElement(StringType value) { - this.state = value; - return this; - } - - /** - * @return Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - public String getState() { - return this.state == null ? null : this.state.getValue(); - } - - /** - * @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - public Address setState(String value) { - if (Utilities.noString(value)) - this.state = null; - else { - if (this.state == null) - this.state = new StringType(); - this.state.setValue(value); - } - return this; - } - - /** - * @return {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value - */ - public StringType getPostalCodeElement() { - if (this.postalCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.postalCode"); - else if (Configuration.doAutoCreate()) - this.postalCode = new StringType(); - return this.postalCode; - } - - public boolean hasPostalCodeElement() { - return this.postalCode != null && !this.postalCode.isEmpty(); - } - - public boolean hasPostalCode() { - return this.postalCode != null && !this.postalCode.isEmpty(); - } - - /** - * @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value - */ - public Address setPostalCodeElement(StringType value) { - this.postalCode = value; - return this; - } - - /** - * @return A postal code designating a region defined by the postal service. - */ - public String getPostalCode() { - return this.postalCode == null ? null : this.postalCode.getValue(); - } - - /** - * @param value A postal code designating a region defined by the postal service. - */ - public Address setPostalCode(String value) { - if (Utilities.noString(value)) - this.postalCode = null; - else { - if (this.postalCode == null) - this.postalCode = new StringType(); - this.postalCode.setValue(value); - } - return this; - } - - /** - * @return {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public StringType getCountryElement() { - if (this.country == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.country"); - else if (Configuration.doAutoCreate()) - this.country = new StringType(); - return this.country; - } - - public boolean hasCountryElement() { - return this.country != null && !this.country.isEmpty(); - } - - public boolean hasCountry() { - return this.country != null && !this.country.isEmpty(); - } - - /** - * @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public Address setCountryElement(StringType value) { - this.country = value; - return this; - } - - /** - * @return Country - a nation as commonly understood or generally accepted. - */ - public String getCountry() { - return this.country == null ? null : this.country.getValue(); - } - - /** - * @param value Country - a nation as commonly understood or generally accepted. - */ - public Address setCountry(String value) { - if (Utilities.noString(value)) - this.country = null; - else { - if (this.country == null) - this.country = new StringType(); - this.country.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period when address was/is in use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.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} (Time period when address was/is in use.) - */ - public Address setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "The purpose of this address.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("text", "string", "A full text representation of the address.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("line", "string", "This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information.", 0, java.lang.Integer.MAX_VALUE, line)); - childrenList.add(new Property("city", "string", "The name of the city, town, village or other community or delivery center.", 0, java.lang.Integer.MAX_VALUE, city)); - childrenList.add(new Property("state", "string", "Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).", 0, java.lang.Integer.MAX_VALUE, state)); - childrenList.add(new Property("postalCode", "string", "A postal code designating a region defined by the postal service.", 0, java.lang.Integer.MAX_VALUE, postalCode)); - childrenList.add(new Property("country", "string", "Country - a nation as commonly understood or generally accepted.", 0, java.lang.Integer.MAX_VALUE, country)); - childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public Address copy() { - Address dst = new Address(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.text = text == null ? null : text.copy(); - if (line != null) { - dst.line = new ArrayList(); - for (StringType i : line) - dst.line.add(i.copy()); - }; - dst.city = city == null ? null : city.copy(); - dst.state = state == null ? null : state.copy(); - dst.postalCode = postalCode == null ? null : postalCode.copy(); - dst.country = country == null ? null : country.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected Address typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) - && (line == null || line.isEmpty()) && (city == null || city.isEmpty()) && (state == null || state.isEmpty()) - && (postalCode == null || postalCode.isEmpty()) && (country == null || country.isEmpty()) - && (period == null || period.isEmpty()); - } - - -} - +P.O. Box number, delivery hints, and similar address information.) + */ + public boolean hasLine(String value) { + if (this.line == null) + return false; + for (StringType v : this.line) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value + */ + public StringType getCityElement() { + if (this.city == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.city"); + else if (Configuration.doAutoCreate()) + this.city = new StringType(); + return this.city; + } + + public boolean hasCityElement() { + return this.city != null && !this.city.isEmpty(); + } + + public boolean hasCity() { + return this.city != null && !this.city.isEmpty(); + } + + /** + * @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value + */ + public Address setCityElement(StringType value) { + this.city = value; + return this; + } + + /** + * @return The name of the city, town, village or other community or delivery center. + */ + public String getCity() { + return this.city == null ? null : this.city.getValue(); + } + + /** + * @param value The name of the city, town, village or other community or delivery center. + */ + public Address setCity(String value) { + if (Utilities.noString(value)) + this.city = null; + else { + if (this.city == null) + this.city = new StringType(); + this.city.setValue(value); + } + return this; + } + + /** + * @return {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public StringType getStateElement() { + if (this.state == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.state"); + else if (Configuration.doAutoCreate()) + this.state = new StringType(); + return this.state; + } + + public boolean hasStateElement() { + return this.state != null && !this.state.isEmpty(); + } + + public boolean hasState() { + return this.state != null && !this.state.isEmpty(); + } + + /** + * @param value {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public Address setStateElement(StringType value) { + this.state = value; + return this; + } + + /** + * @return Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + public String getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + */ + public Address setState(String value) { + if (Utilities.noString(value)) + this.state = null; + else { + if (this.state == null) + this.state = new StringType(); + this.state.setValue(value); + } + return this; + } + + /** + * @return {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value + */ + public StringType getPostalCodeElement() { + if (this.postalCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.postalCode"); + else if (Configuration.doAutoCreate()) + this.postalCode = new StringType(); + return this.postalCode; + } + + public boolean hasPostalCodeElement() { + return this.postalCode != null && !this.postalCode.isEmpty(); + } + + public boolean hasPostalCode() { + return this.postalCode != null && !this.postalCode.isEmpty(); + } + + /** + * @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value + */ + public Address setPostalCodeElement(StringType value) { + this.postalCode = value; + return this; + } + + /** + * @return A postal code designating a region defined by the postal service. + */ + public String getPostalCode() { + return this.postalCode == null ? null : this.postalCode.getValue(); + } + + /** + * @param value A postal code designating a region defined by the postal service. + */ + public Address setPostalCode(String value) { + if (Utilities.noString(value)) + this.postalCode = null; + else { + if (this.postalCode == null) + this.postalCode = new StringType(); + this.postalCode.setValue(value); + } + return this; + } + + /** + * @return {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public StringType getCountryElement() { + if (this.country == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.country"); + else if (Configuration.doAutoCreate()) + this.country = new StringType(); + return this.country; + } + + public boolean hasCountryElement() { + return this.country != null && !this.country.isEmpty(); + } + + public boolean hasCountry() { + return this.country != null && !this.country.isEmpty(); + } + + /** + * @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public Address setCountryElement(StringType value) { + this.country = value; + return this; + } + + /** + * @return Country - a nation as commonly understood or generally accepted. + */ + public String getCountry() { + return this.country == null ? null : this.country.getValue(); + } + + /** + * @param value Country - a nation as commonly understood or generally accepted. + */ + public Address setCountry(String value) { + if (Utilities.noString(value)) + this.country = null; + else { + if (this.country == null) + this.country = new StringType(); + this.country.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period when address was/is in use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Address.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} (Time period when address was/is in use.) + */ + public Address setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "The purpose of this address.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("text", "string", "A full text representation of the address.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("line", "string", "This component contains the house number, apartment number, street name, street direction, \nP.O. Box number, delivery hints, and similar address information.", 0, java.lang.Integer.MAX_VALUE, line)); + childrenList.add(new Property("city", "string", "The name of the city, town, village or other community or delivery center.", 0, java.lang.Integer.MAX_VALUE, city)); + childrenList.add(new Property("state", "string", "Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).", 0, java.lang.Integer.MAX_VALUE, state)); + childrenList.add(new Property("postalCode", "string", "A postal code designating a region defined by the postal service.", 0, java.lang.Integer.MAX_VALUE, postalCode)); + childrenList.add(new Property("country", "string", "Country - a nation as commonly understood or generally accepted.", 0, java.lang.Integer.MAX_VALUE, country)); + childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public Address copy() { + Address dst = new Address(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.text = text == null ? null : text.copy(); + if (line != null) { + dst.line = new ArrayList(); + for (StringType i : line) + dst.line.add(i.copy()); + }; + dst.city = city == null ? null : city.copy(); + dst.state = state == null ? null : state.copy(); + dst.postalCode = postalCode == null ? null : postalCode.copy(); + dst.country = country == null ? null : country.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected Address typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) + && (line == null || line.isEmpty()) && (city == null || city.isEmpty()) && (state == null || state.isEmpty()) + && (postalCode == null || postalCode.isEmpty()) && (country == null || country.isEmpty()) + && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java index 2ce4cbd2b26..54c2a8e66b6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java @@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Age") -public class Age extends Quantity { - - private static final long serialVersionUID = -483422721L; - - public Age copy() { - Age dst = new Age(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.units = units == null ? null : units.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Age typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - + +/* + 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Age") +public class Age extends Quantity { + + private static final long serialVersionUID = -483422721L; + + public Age copy() { + Age dst = new Age(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.units = units == null ? null : units.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Age typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java index 71de7a1c9b8..48eea542847 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java @@ -20,479 +20,479 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Prospective warnings of potential issues when providing care to the patient. - */ -@ResourceDef(name="Alert", profile="http://hl7.org/fhir/Profile/Alert") -public class Alert extends DomainResource { - - 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. - */ - ACTIVE, - /** - * The alert does not need to be displayed any more. - */ - INACTIVE, - /** - * The alert was added in error, and should no longer be displayed. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ACTIVE; - if ("inactive".equals(codeString)) - return INACTIVE; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return ""; - case INACTIVE: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert."; - case INACTIVE: return "The alert does not need to be displayed any more."; - case ENTEREDINERROR: return "The alert was added in error, and should no longer be displayed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - } - - public static class AlertStatusEnumFactory implements EnumFactory { - public AlertStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return AlertStatus.ACTIVE; - if ("inactive".equals(codeString)) - return AlertStatus.INACTIVE; - if ("entered in error".equals(codeString)) - return AlertStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'"); - } - public String toCode(AlertStatus code) throws IllegalArgumentException { - if (code == AlertStatus.ACTIVE) - return "active"; - if (code == AlertStatus.INACTIVE) - return "inactive"; - if (code == AlertStatus.ENTEREDINERROR) - return "entered in error"; - return "?"; - } - } - - /** - * Identifier assigned to the alert for external use (outside the FHIR environment). - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the alert for external use (outside the FHIR environment)." ) - protected List identifier; - - /** - * Allows an alert to be divided into different categories like clinical, administrative etc. - */ - @Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an alert to be divided into different categories like clinical, administrative etc." ) - protected CodeableConcept category; - - /** - * Supports basic workflow. - */ - @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="active | inactive | entered in error", formalDefinition="Supports basic workflow." ) - protected Enumeration status; - - /** - * The person who this alert concerns. - */ - @Child(name="subject", type={Patient.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who is alert about?", formalDefinition="The person who this alert concerns." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The person who this alert concerns.) - */ - protected Patient subjectTarget; - - /** - * The person or device that created the alert. - */ - @Child(name="author", type={Practitioner.class, Patient.class, Device.class}, order=3, min=0, max=1) - @Description(shortDefinition="Alert creator", formalDefinition="The person or device that created the alert." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (The person or device that created the alert.) - */ - protected Resource authorTarget; - - /** - * The textual component of the alert to display to the user. - */ - @Child(name="note", type={StringType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Text of alert", formalDefinition="The textual component of the alert to display to the user." ) - protected StringType note; - - private static final long serialVersionUID = -655685828L; - - public Alert() { - super(); - } - - public Alert(Enumeration status, Reference subject, StringType note) { - super(); - this.status = status; - this.subject = subject; - this.note = note; - } - - /** - * @return {@link #identifier} (Identifier assigned to the alert for external use (outside the FHIR environment).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier assigned to the alert for external use (outside the FHIR environment).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #category} (Allows an alert to be divided into different categories like clinical, administrative etc.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Alert.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} (Allows an alert to be divided into different categories like clinical, administrative etc.) - */ - public Alert setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Alert.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Alert setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Supports basic workflow. - */ - public AlertStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Supports basic workflow. - */ - public Alert setStatus(AlertStatus value) { - if (this.status == null) - this.status = new Enumeration(AlertStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #subject} (The person who this alert concerns.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Alert.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 person who this alert concerns.) - */ - public Alert 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 person who this alert concerns.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Alert.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 person who this alert concerns.) - */ - public Alert setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (The person or device that created the alert.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Alert.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The person or device that created the alert.) - */ - public Alert setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that created the alert.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that created the alert.) - */ - public Alert setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public StringType getNoteElement() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Alert.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); - return this.note; - } - - public boolean hasNoteElement() { - return this.note != null && !this.note.isEmpty(); - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public Alert setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return The textual component of the alert to display to the user. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value The textual component of the alert to display to the user. - */ - public Alert setNote(String value) { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the alert for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "Allows an alert to be divided into different categories like clinical, administrative etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("subject", "Reference(Patient)", "The person who this alert concerns.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the alert.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("note", "string", "The textual component of the alert to display to the user.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public Alert copy() { - Alert dst = new Alert(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.status = status == null ? null : status.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.author = author == null ? null : author.copy(); - dst.note = note == null ? null : note.copy(); - return dst; - } - - protected Alert typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) - && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Alert; - } - - @SearchParamDefinition(name="patient", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - -} - + +/* + 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; +/** + * Prospective warnings of potential issues when providing care to the patient. + */ +@ResourceDef(name="Alert", profile="http://hl7.org/fhir/Profile/Alert") +public class Alert extends DomainResource { + + 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. + */ + ACTIVE, + /** + * The alert does not need to be displayed any more. + */ + INACTIVE, + /** + * The alert was added in error, and should no longer be displayed. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return ""; + case INACTIVE: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert."; + case INACTIVE: return "The alert does not need to be displayed any more."; + case ENTEREDINERROR: return "The alert was added in error, and should no longer be displayed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + } + + public static class AlertStatusEnumFactory implements EnumFactory { + public AlertStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return AlertStatus.ACTIVE; + if ("inactive".equals(codeString)) + return AlertStatus.INACTIVE; + if ("entered in error".equals(codeString)) + return AlertStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'"); + } + public String toCode(AlertStatus code) throws IllegalArgumentException { + if (code == AlertStatus.ACTIVE) + return "active"; + if (code == AlertStatus.INACTIVE) + return "inactive"; + if (code == AlertStatus.ENTEREDINERROR) + return "entered in error"; + return "?"; + } + } + + /** + * Identifier assigned to the alert for external use (outside the FHIR environment). + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the alert for external use (outside the FHIR environment)." ) + protected List identifier; + + /** + * Allows an alert to be divided into different categories like clinical, administrative etc. + */ + @Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an alert to be divided into different categories like clinical, administrative etc." ) + protected CodeableConcept category; + + /** + * Supports basic workflow. + */ + @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="active | inactive | entered in error", formalDefinition="Supports basic workflow." ) + protected Enumeration status; + + /** + * The person who this alert concerns. + */ + @Child(name="subject", type={Patient.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who is alert about?", formalDefinition="The person who this alert concerns." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The person who this alert concerns.) + */ + protected Patient subjectTarget; + + /** + * The person or device that created the alert. + */ + @Child(name="author", type={Practitioner.class, Patient.class, Device.class}, order=3, min=0, max=1) + @Description(shortDefinition="Alert creator", formalDefinition="The person or device that created the alert." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (The person or device that created the alert.) + */ + protected Resource authorTarget; + + /** + * The textual component of the alert to display to the user. + */ + @Child(name="note", type={StringType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Text of alert", formalDefinition="The textual component of the alert to display to the user." ) + protected StringType note; + + private static final long serialVersionUID = -655685828L; + + public Alert() { + super(); + } + + public Alert(Enumeration status, Reference subject, StringType note) { + super(); + this.status = status; + this.subject = subject; + this.note = note; + } + + /** + * @return {@link #identifier} (Identifier assigned to the alert for external use (outside the FHIR environment).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier assigned to the alert for external use (outside the FHIR environment).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #category} (Allows an alert to be divided into different categories like clinical, administrative etc.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Alert.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} (Allows an alert to be divided into different categories like clinical, administrative etc.) + */ + public Alert setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Alert.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Alert setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Supports basic workflow. + */ + public AlertStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Supports basic workflow. + */ + public Alert setStatus(AlertStatus value) { + if (this.status == null) + this.status = new Enumeration(AlertStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #subject} (The person who this alert concerns.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Alert.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 person who this alert concerns.) + */ + public Alert 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 person who this alert concerns.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Alert.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 person who this alert concerns.) + */ + public Alert setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (The person or device that created the alert.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Alert.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The person or device that created the alert.) + */ + public Alert setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that created the alert.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that created the alert.) + */ + public Alert setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public StringType getNoteElement() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Alert.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); + return this.note; + } + + public boolean hasNoteElement() { + return this.note != null && !this.note.isEmpty(); + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (The textual component of the alert to display to the user.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public Alert setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return The textual component of the alert to display to the user. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value The textual component of the alert to display to the user. + */ + public Alert setNote(String value) { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the alert for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "Allows an alert to be divided into different categories like clinical, administrative etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("subject", "Reference(Patient)", "The person who this alert concerns.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Patient|Device)", "The person or device that created the alert.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("note", "string", "The textual component of the alert to display to the user.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public Alert copy() { + Alert dst = new Alert(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.category = category == null ? null : category.copy(); + dst.status = status == null ? null : status.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.author = author == null ? null : author.copy(); + dst.note = note == null ? null : note.copy(); + return dst; + } + + protected Alert typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) + && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Alert; + } + + @SearchParamDefinition(name="patient", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java index f4db3b5adde..310984eda45 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java @@ -20,1759 +20,1759 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. - */ -@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") -public class AllergyIntolerance extends DomainResource { - - public enum AllergyIntoleranceStatus implements FhirEnum { - /** - * A low level of certainty about the propensity for a reaction to the identified Substance. - */ - UNCONFIRMED, - /** - * A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. - */ - CONFIRMED, - /** - * A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. - */ - RESOLVED, - /** - * A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. - */ - REFUTED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return UNCONFIRMED; - if ("confirmed".equals(codeString)) - return CONFIRMED; - if ("resolved".equals(codeString)) - return RESOLVED; - if ("refuted".equals(codeString)) - return REFUTED; - throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case UNCONFIRMED: return "unconfirmed"; - case CONFIRMED: return "confirmed"; - case RESOLVED: return "resolved"; - case REFUTED: return "refuted"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNCONFIRMED: return ""; - case CONFIRMED: return ""; - case RESOLVED: return ""; - case REFUTED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified Substance."; - case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge."; - case RESOLVED: return "A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved."; - case REFUTED: return "A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNCONFIRMED: return "Unconfirmed"; - case CONFIRMED: return "Confirmed"; - case RESOLVED: return "Resolved"; - case REFUTED: return "Refuted"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { - public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unconfirmed".equals(codeString)) - return AllergyIntoleranceStatus.UNCONFIRMED; - if ("confirmed".equals(codeString)) - return AllergyIntoleranceStatus.CONFIRMED; - if ("resolved".equals(codeString)) - return AllergyIntoleranceStatus.RESOLVED; - if ("refuted".equals(codeString)) - return AllergyIntoleranceStatus.REFUTED; - throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceStatus code) throws IllegalArgumentException { - if (code == AllergyIntoleranceStatus.UNCONFIRMED) - return "unconfirmed"; - if (code == AllergyIntoleranceStatus.CONFIRMED) - return "confirmed"; - if (code == AllergyIntoleranceStatus.RESOLVED) - return "resolved"; - if (code == AllergyIntoleranceStatus.REFUTED) - return "refuted"; - return "?"; - } - } - - public enum AllergyIntoleranceCriticality implements FhirEnum { - /** - * 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: 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 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; - 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 "?"; - } - } - public String getSystem() { - 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: 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 "?"; - } - } - public String getDisplay() { - 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 AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return AllergyIntoleranceCriticality.LOW; - if ("high".equals(codeString)) - return AllergyIntoleranceCriticality.HIGH; - if ("unassessible".equals(codeString)) - return AllergyIntoleranceCriticality.UNASSESSIBLE; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); - } - 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 implements FhirEnum { - /** - * Immune mediated reaction, including allergic reactions and hypersensitivities. - */ - IMMUNE, - /** - * A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions. - */ - NONIMMUNE, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case IMMUNE: return "immune"; - case NONIMMUNE: return "non-immune"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case IMMUNE: return ""; - case NONIMMUNE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case IMMUNE: return "Immune mediated reaction, including allergic reactions and hypersensitivities."; - case NONIMMUNE: return "A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case IMMUNE: return "Immune Mediated"; - case NONIMMUNE: return "Non-immune mediated"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { - public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("immune".equals(codeString)) - return AllergyIntoleranceType.IMMUNE; - if ("non-immune".equals(codeString)) - return AllergyIntoleranceType.NONIMMUNE; - throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceType code) throws IllegalArgumentException { - if (code == AllergyIntoleranceType.IMMUNE) - return "immune"; - if (code == AllergyIntoleranceType.NONIMMUNE) - return "non-immune"; - return "?"; - } - } - - public enum AllergyIntoleranceCategory implements FhirEnum { - /** - * Any substance consumed to provide nutritional support for the body. - */ - FOOD, - /** - * Substances administered to achieve a physiological effect. - */ - MEDICATION, - /** - * Substances that are encountered in the environment. - */ - ENVIRONMENT, - /** - * added to help the parsers - */ - NULL; - - 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)) - return FOOD; - if ("medication".equals(codeString)) - return MEDICATION; - if ("environment".equals(codeString)) - return ENVIRONMENT; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case FOOD: return "food"; - case MEDICATION: return "medication"; - case ENVIRONMENT: return "environment"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FOOD: return ""; - case MEDICATION: return ""; - case ENVIRONMENT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FOOD: return "Any substance consumed to provide nutritional support for the body."; - case MEDICATION: return "Substances administered to achieve a physiological effect."; - case ENVIRONMENT: return "Substances that are encountered in the environment."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FOOD: return "Food"; - case MEDICATION: return "Medication"; - case ENVIRONMENT: return "Environment"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { - public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("food".equals(codeString)) - return AllergyIntoleranceCategory.FOOD; - if ("medication".equals(codeString)) - return AllergyIntoleranceCategory.MEDICATION; - if ("environment".equals(codeString)) - return AllergyIntoleranceCategory.ENVIRONMENT; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceCategory code) throws IllegalArgumentException { - if (code == AllergyIntoleranceCategory.FOOD) - return "food"; - if (code == AllergyIntoleranceCategory.MEDICATION) - return "medication"; - if (code == AllergyIntoleranceCategory.ENVIRONMENT) - return "environment"; - return "?"; - } - } - - public enum ReactionEventCertainty implements FhirEnum { - /** - * There is a low level of clinical certainty that the reaction was caused by the identified Substance. - */ - UNLIKELY, - /** - * There is a high level of clinical certainty that the reaction was caused by the identified Substance. - */ - LIKELY, - /** - * There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. - */ - CONFIRMED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return UNLIKELY; - if ("likely".equals(codeString)) - return LIKELY; - if ("confirmed".equals(codeString)) - return CONFIRMED; - throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case UNLIKELY: return "unlikely"; - case LIKELY: return "likely"; - case CONFIRMED: return "confirmed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNLIKELY: return ""; - case LIKELY: return ""; - case CONFIRMED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNLIKELY: return "There is a low level of clinical certainty that the reaction was caused by the identified Substance."; - case LIKELY: return "There is a high level of clinical certainty that the reaction was caused by the identified Substance."; - case CONFIRMED: return "There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNLIKELY: return "Unlikely"; - case LIKELY: return "Likely"; - case CONFIRMED: return "Confirmed"; - default: return "?"; - } - } - } - - public static class ReactionEventCertaintyEnumFactory implements EnumFactory { - public ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unlikely".equals(codeString)) - return ReactionEventCertainty.UNLIKELY; - if ("likely".equals(codeString)) - return ReactionEventCertainty.LIKELY; - if ("confirmed".equals(codeString)) - return ReactionEventCertainty.CONFIRMED; - throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); - } - public String toCode(ReactionEventCertainty code) throws IllegalArgumentException { - if (code == ReactionEventCertainty.UNLIKELY) - return "unlikely"; - if (code == ReactionEventCertainty.LIKELY) - return "likely"; - if (code == ReactionEventCertainty.CONFIRMED) - return "confirmed"; - return "?"; - } - } - - public enum ReactionEventSeverity implements FhirEnum { - /** - * Causes mild physiological effects. - */ - MILD, - /** - * Causes moderate physiological effects. - */ - MODERATE, - /** - * Causes severe physiological effects. - */ - SEVERE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return MILD; - if ("moderate".equals(codeString)) - return MODERATE; - if ("severe".equals(codeString)) - return SEVERE; - throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MILD: return "mild"; - case MODERATE: return "moderate"; - case SEVERE: return "severe"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MILD: return ""; - case MODERATE: return ""; - case SEVERE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MILD: return "Causes mild physiological effects."; - case MODERATE: return "Causes moderate physiological effects."; - case SEVERE: return "Causes severe physiological effects."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MILD: return "Mild"; - case MODERATE: return "Moderate"; - case SEVERE: return "Severe"; - default: return "?"; - } - } - } - - public static class ReactionEventSeverityEnumFactory implements EnumFactory { - public ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("mild".equals(codeString)) - return ReactionEventSeverity.MILD; - if ("moderate".equals(codeString)) - return ReactionEventSeverity.MODERATE; - if ("severe".equals(codeString)) - return ReactionEventSeverity.SEVERE; - throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); - } - public String toCode(ReactionEventSeverity code) throws IllegalArgumentException { - if (code == ReactionEventSeverity.MILD) - return "mild"; - if (code == ReactionEventSeverity.MODERATE) - return "moderate"; - if (code == ReactionEventSeverity.SEVERE) - return "severe"; - return "?"; - } - } - - @Block() - public static class AllergyIntoleranceEventComponent extends BackboneElement { - /** - * Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. - */ - @Child(name="substance", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Specific substance considered to be responsible for event", formalDefinition="Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance." ) - protected CodeableConcept substance; - - /** - * Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. - */ - @Child(name="certainty", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="unlikely | likely | confirmed - clinical certainty about the specific substance", formalDefinition="Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event." ) - protected Enumeration certainty; - - /** - * Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event. - */ - @Child(name="manifestation", type={CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event." ) - protected List manifestation; - - /** - * Text description about the Reaction as a whole, including details of the manifestation if required. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the Reaction as a whole, including details of the manifestation if required." ) - protected StringType description; - - /** - * Record of the date and/or time of the onset of the Reaction. - */ - @Child(name="onset", type={DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." ) - protected DateTimeType onset; - - /** - * The amount of time that the Adverse Reaction persisted. - */ - @Child(name="duration", type={Duration.class}, order=6, min=0, max=1) - @Description(shortDefinition="How long Manifestations persisted", formalDefinition="The amount of time that the Adverse Reaction persisted." ) - protected Duration duration; - - /** - * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - @Child(name="severity", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." ) - protected Enumeration severity; - - /** - * Identification of the route by which the subject was exposed to the substance. - */ - @Child(name="exposureRoute", type={CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." ) - protected CodeableConcept exposureRoute; - - /** - * Additional text about the Adverse Reaction event not captured in other fields. - */ - @Child(name="comment", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the Adverse Reaction event not captured in other fields." ) - protected StringType comment; - - private static final long serialVersionUID = -1773271720L; - - public AllergyIntoleranceEventComponent() { - super(); - } - - /** - * @return {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) - */ - public CodeableConcept getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new CodeableConcept(); - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) - */ - public AllergyIntoleranceEventComponent setSubstance(CodeableConcept value) { - this.substance = value; - return this; - } - - /** - * @return {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value - */ - public Enumeration getCertaintyElement() { - if (this.certainty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.certainty"); - else if (Configuration.doAutoCreate()) - this.certainty = new Enumeration(); - return this.certainty; - } - - public boolean hasCertaintyElement() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - public boolean hasCertainty() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - /** - * @param value {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setCertaintyElement(Enumeration value) { - this.certainty = value; - return this; - } - - /** - * @return Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. - */ - public ReactionEventCertainty getCertainty() { - return this.certainty == null ? null : this.certainty.getValue(); - } - - /** - * @param value Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. - */ - public AllergyIntoleranceEventComponent setCertainty(ReactionEventCertainty value) { - if (value == null) - this.certainty = null; - else { - if (this.certainty == null) - this.certainty = new Enumeration(ReactionEventCertainty.ENUM_FACTORY); - this.certainty.setValue(value); - } - return this; - } - - /** - * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) - */ - public List getManifestation() { - if (this.manifestation == null) - this.manifestation = new ArrayList(); - return this.manifestation; - } - - public boolean hasManifestation() { - if (this.manifestation == null) - return false; - for (CodeableConcept item : this.manifestation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) - */ - // syntactic sugar - public CodeableConcept addManifestation() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.manifestation == null) - this.manifestation = new ArrayList(); - this.manifestation.add(t); - return t; - } - - /** - * @return {@link #description} (Text description about the Reaction as a whole, including details of the manifestation if required.). 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 AllergyIntoleranceEventComponent.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} (Text description about the Reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description about the Reaction as a whole, including details of the manifestation if required. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description about the Reaction as a whole, including details of the manifestation if required. - */ - public AllergyIntoleranceEventComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public DateTimeType getOnsetElement() { - if (this.onset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.onset"); - else if (Configuration.doAutoCreate()) - this.onset = new DateTimeType(); - return this.onset; - } - - public boolean hasOnsetElement() { - return this.onset != null && !this.onset.isEmpty(); - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setOnsetElement(DateTimeType value) { - this.onset = value; - return this; - } - - /** - * @return Record of the date and/or time of the onset of the Reaction. - */ - 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(Date value) { - if (value == null) - this.onset = null; - else { - if (this.onset == null) - this.onset = new DateTimeType(); - this.onset.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (The amount of time that the Adverse Reaction persisted.) - */ - public Duration getDuration() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new Duration(); - return this.duration; - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The amount of time that the Adverse Reaction persisted.) - */ - public AllergyIntoleranceEventComponent setDuration(Duration value) { - this.duration = value; - return this; - } - - /** - * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(); - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - public ReactionEventSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - public AllergyIntoleranceEventComponent setSeverity(ReactionEventSeverity value) { - if (value == null) - this.severity = null; - else { - if (this.severity == null) - this.severity = new Enumeration(ReactionEventSeverity.ENUM_FACTORY); - this.severity.setValue(value); - } - return this; - } - - /** - * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) - */ - public CodeableConcept getExposureRoute() { - if (this.exposureRoute == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.exposureRoute"); - else if (Configuration.doAutoCreate()) - this.exposureRoute = new CodeableConcept(); - return this.exposureRoute; - } - - public boolean hasExposureRoute() { - return this.exposureRoute != null && !this.exposureRoute.isEmpty(); - } - - /** - * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) - */ - public AllergyIntoleranceEventComponent setExposureRoute(CodeableConcept value) { - this.exposureRoute = value; - return this; - } - - /** - * @return {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AllergyIntoleranceEventComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional text about the Adverse Reaction event not captured in other fields. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional text about the Adverse Reaction event not captured in other fields. - */ - public AllergyIntoleranceEventComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("substance", "CodeableConcept", "Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.", 0, java.lang.Integer.MAX_VALUE, substance)); - childrenList.add(new Property("certainty", "code", "Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.", 0, java.lang.Integer.MAX_VALUE, certainty)); - childrenList.add(new Property("manifestation", "CodeableConcept", "Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.", 0, java.lang.Integer.MAX_VALUE, manifestation)); - childrenList.add(new Property("description", "string", "Text description about the Reaction as a whole, including details of the manifestation if required.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("duration", "Duration", "The amount of time that the Adverse Reaction persisted.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, java.lang.Integer.MAX_VALUE, exposureRoute)); - childrenList.add(new Property("comment", "string", "Additional text about the Adverse Reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - public AllergyIntoleranceEventComponent copy() { - AllergyIntoleranceEventComponent dst = new AllergyIntoleranceEventComponent(); - copyValues(dst); - dst.substance = substance == null ? null : substance.copy(); - dst.certainty = certainty == null ? null : certainty.copy(); - if (manifestation != null) { - dst.manifestation = new ArrayList(); - for (CodeableConcept i : manifestation) - dst.manifestation.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (substance == null || substance.isEmpty()) && (certainty == null || certainty.isEmpty()) - && (manifestation == null || manifestation.isEmpty()) && (description == null || description.isEmpty()) - && (onset == null || onset.isEmpty()) && (duration == null || duration.isEmpty()) && (severity == null || severity.isEmpty()) - && (exposureRoute == null || exposureRoute.isEmpty()) && (comment == null || comment.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this allergy/intolerance concern 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 item", formalDefinition="This records identifiers associated with this allergy/intolerance concern 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; - - /** - * Date when the sensitivity was recorded. - */ - @Child(name="recordedDate", type={DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="When recorded", formalDefinition="Date when the sensitivity was recorded." ) - protected DateTimeType recordedDate; - - /** - * Indicates who has responsibility for the record. - */ - @Child(name="recorder", type={Practitioner.class, Patient.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Indicates who has responsibility for the record." ) - protected Reference recorder; - - /** - * The actual object that is the target of the reference (Indicates who has responsibility for the record.) - */ - protected Resource recorderTarget; - - /** - * The patient who has the allergy or intolerance. - */ - @Child(name="subject", type={Patient.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who has the allergy or intolerance.) - */ - protected Patient subjectTarget; - - /** - * Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk. - */ - @Child(name="substance", type={CodeableConcept.class}, order=3, min=1, max=1) - @Description(shortDefinition="Substance, (or class) considered to be responsible for risk", formalDefinition="Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk." ) - protected CodeableConcept substance; - - /** - * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - @Child(name="status", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="unconfirmed | confirmed | resolved | refuted", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ) - protected Enumeration status; - - /** - * 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 | unassessible - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) - protected Enumeration criticality; - - /** - * Identification of the underlying physiological mechanism for the Reaction Risk. - */ - @Child(name="type", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="immune | non-immune - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the Reaction Risk." ) - protected Enumeration type; - - /** - * Category of the identified Substance. - */ - @Child(name="category", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="food | medication | environment - Category of Substance", formalDefinition="Category of the identified Substance." ) - protected Enumeration category; - - /** - * Represents the date and/or time of the last known occurence of a reaction event. - */ - @Child(name="lastOccurence", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Date(/time) of last known occurence of a reaction", formalDefinition="Represents the date and/or time of the last known occurence of a reaction event." ) - protected DateTimeType lastOccurence; - - /** - * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - @Child(name="comment", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) - protected StringType comment; - - /** - * Details about each Adverse Reaction Event linked to exposure to the identified Substance. - */ - @Child(name="event", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each Adverse Reaction Event linked to exposure to the identified Substance." ) - protected List event; - - private static final long serialVersionUID = -571844748L; - - public AllergyIntolerance() { - super(); - } - - public AllergyIntolerance(Reference subject, CodeableConcept substance) { - super(); - this.subject = subject; - this.substance = substance; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 allergy/intolerance concern 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value - */ - public DateTimeType getRecordedDateElement() { - if (this.recordedDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate"); - else if (Configuration.doAutoCreate()) - this.recordedDate = new DateTimeType(); - return this.recordedDate; - } - - public boolean hasRecordedDateElement() { - return this.recordedDate != null && !this.recordedDate.isEmpty(); - } - - public boolean hasRecordedDate() { - return this.recordedDate != null && !this.recordedDate.isEmpty(); - } - - /** - * @param value {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value - */ - public AllergyIntolerance setRecordedDateElement(DateTimeType value) { - this.recordedDate = value; - return this; - } - - /** - * @return Date when the sensitivity was recorded. - */ - public Date getRecordedDate() { - return this.recordedDate == null ? null : this.recordedDate.getValue(); - } - - /** - * @param value Date when the sensitivity was recorded. - */ - public AllergyIntolerance setRecordedDate(Date value) { - if (value == null) - this.recordedDate = null; - else { - if (this.recordedDate == null) - this.recordedDate = new DateTimeType(); - this.recordedDate.setValue(value); - } - return this; - } - - /** - * @return {@link #recorder} (Indicates who has responsibility for the record.) - */ - public Reference getRecorder() { - if (this.recorder == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.recorder"); - else if (Configuration.doAutoCreate()) - this.recorder = new Reference(); - return this.recorder; - } - - public boolean hasRecorder() { - return this.recorder != null && !this.recorder.isEmpty(); - } - - /** - * @param value {@link #recorder} (Indicates who has responsibility for the record.) - */ - public AllergyIntolerance setRecorder(Reference value) { - this.recorder = value; - return this; - } - - /** - * @return {@link #recorder} 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. (Indicates who has responsibility for the record.) - */ - public Resource getRecorderTarget() { - return this.recorderTarget; - } - - /** - * @param value {@link #recorder} 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. (Indicates who has responsibility for the record.) - */ - public AllergyIntolerance setRecorderTarget(Resource value) { - this.recorderTarget = value; - return this; - } - - /** - * @return {@link #subject} (The patient who has the allergy or intolerance.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.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 has the allergy or intolerance.) - */ - public AllergyIntolerance 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 has the allergy or intolerance.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.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 has the allergy or intolerance.) - */ - public AllergyIntolerance setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) - */ - public CodeableConcept getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new CodeableConcept(); - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) - */ - public AllergyIntolerance setSubstance(CodeableConcept value) { - this.substance = value; - return this; - } - - /** - * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public AllergyIntolerance setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - public AllergyIntoleranceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(AllergyIntoleranceStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value - */ - public Enumeration getCriticalityElement() { - if (this.criticality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.criticality"); - else if (Configuration.doAutoCreate()) - this.criticality = new Enumeration(); - return this.criticality; - } - - public boolean hasCriticalityElement() { - return this.criticality != null && !this.criticality.isEmpty(); - } - - public boolean hasCriticality() { - return this.criticality != null && !this.criticality.isEmpty(); - } - - /** - * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value - */ - public AllergyIntolerance setCriticalityElement(Enumeration value) { - this.criticality = value; - return this; - } - - /** - * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - public AllergyIntoleranceCriticality getCriticality() { - return this.criticality == null ? null : this.criticality.getValue(); - } - - /** - * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { - if (value == null) - this.criticality = null; - else { - if (this.criticality == null) - this.criticality = new Enumeration(AllergyIntoleranceCriticality.ENUM_FACTORY); - this.criticality.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AllergyIntolerance setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identification of the underlying physiological mechanism for the Reaction Risk. - */ - public AllergyIntoleranceType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identification of the underlying physiological mechanism for the Reaction Risk. - */ - public AllergyIntolerance setType(AllergyIntoleranceType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(AllergyIntoleranceType.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(); - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public AllergyIntolerance setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Category of the identified Substance. - */ - public AllergyIntoleranceCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Category of the identified Substance. - */ - public AllergyIntolerance setCategory(AllergyIntoleranceCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(AllergyIntoleranceCategory.ENUM_FACTORY); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value - */ - public DateTimeType getLastOccurenceElement() { - if (this.lastOccurence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurence"); - else if (Configuration.doAutoCreate()) - this.lastOccurence = new DateTimeType(); - return this.lastOccurence; - } - - public boolean hasLastOccurenceElement() { - return this.lastOccurence != null && !this.lastOccurence.isEmpty(); - } - - public boolean hasLastOccurence() { - return this.lastOccurence != null && !this.lastOccurence.isEmpty(); - } - - /** - * @param value {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value - */ - public AllergyIntolerance setLastOccurenceElement(DateTimeType value) { - this.lastOccurence = value; - return this; - } - - /** - * @return Represents the date and/or time of the last known occurence of a reaction event. - */ - 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(Date value) { - if (value == null) - this.lastOccurence = null; - else { - if (this.lastOccurence == null) - this.lastOccurence = new DateTimeType(); - this.lastOccurence.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AllergyIntolerance setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - public AllergyIntolerance setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (AllergyIntoleranceEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) - */ - // syntactic sugar - public AllergyIntoleranceEventComponent addEvent() { //3 - AllergyIntoleranceEventComponent t = new AllergyIntoleranceEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern 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("recordedDate", "dateTime", "Date when the sensitivity was recorded.", 0, java.lang.Integer.MAX_VALUE, recordedDate)); - childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Indicates who has responsibility for the record.", 0, java.lang.Integer.MAX_VALUE, recorder)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("substance", "CodeableConcept", "Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.", 0, java.lang.Integer.MAX_VALUE, substance)); - childrenList.add(new Property("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); - childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the Reaction Risk.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("category", "code", "Category of the identified Substance.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("lastOccurence", "dateTime", "Represents the date and/or time of the last known occurence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurence)); - childrenList.add(new Property("comment", "string", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("event", "", "Details about each Adverse Reaction Event linked to exposure to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - public AllergyIntolerance copy() { - AllergyIntolerance dst = new AllergyIntolerance(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.recordedDate = recordedDate == null ? null : recordedDate.copy(); - dst.recorder = recorder == null ? null : recorder.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.substance = substance == null ? null : substance.copy(); - dst.status = status == null ? null : status.copy(); - dst.criticality = criticality == null ? null : criticality.copy(); - dst.type = type == null ? null : type.copy(); - dst.category = category == null ? null : category.copy(); - dst.lastOccurence = lastOccurence == null ? null : lastOccurence.copy(); - dst.comment = comment == null ? null : comment.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (AllergyIntoleranceEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - protected AllergyIntolerance typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (recordedDate == null || recordedDate.isEmpty()) - && (recorder == null || recorder.isEmpty()) && (subject == null || subject.isEmpty()) && (substance == null || substance.isEmpty()) - && (status == null || status.isEmpty()) && (criticality == null || criticality.isEmpty()) - && (type == null || type.isEmpty()) && (category == null || category.isEmpty()) && (lastOccurence == null || lastOccurence.isEmpty()) - && (comment == null || comment.isEmpty()) && (event == null || event.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AllergyIntolerance; - } - - @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="unconfirmed | confirmed | resolved | refuted", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="AllergyIntolerance.subject", description="Who the sensitivity is for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="onset", path="AllergyIntolerance.event.onset", description="Date(/time) when manifestations showed", type="date" ) - public static final String SP_ONSET = "onset"; - @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurence", description="Date(/time) of last known occurence of a reaction", type="date" ) - 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="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 | 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"; - @SearchParamDefinition(name="duration", path="AllergyIntolerance.event.duration", description="How long Manifestations persisted", type="quantity" ) - public static final String SP_DURATION = "duration"; - @SearchParamDefinition(name="patient", path="AllergyIntolerance.subject", description="Who the sensitivity is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="recorder", path="AllergyIntolerance.recorder", description="Who recorded the sensitivity", type="reference" ) - public static final String SP_RECORDER = "recorder"; - @SearchParamDefinition(name="route", path="AllergyIntolerance.event.exposureRoute", description="How the subject was exposed to the substance", type="token" ) - public static final String SP_ROUTE = "route"; - @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier", description="External Ids for this item", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="manifestation", path="AllergyIntolerance.event.manifestation", description="Clinical symptoms/signs associated with the Event", type="token" ) - public static final String SP_MANIFESTATION = "manifestation"; - -} - + +/* + 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; +/** + * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + */ +@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") +public class AllergyIntolerance extends DomainResource { + + public enum AllergyIntoleranceStatus implements FhirEnum { + /** + * A low level of certainty about the propensity for a reaction to the identified Substance. + */ + UNCONFIRMED, + /** + * A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. + */ + RESOLVED, + /** + * A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. + */ + REFUTED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return UNCONFIRMED; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("resolved".equals(codeString)) + return RESOLVED; + if ("refuted".equals(codeString)) + return REFUTED; + throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case UNCONFIRMED: return "unconfirmed"; + case CONFIRMED: return "confirmed"; + case RESOLVED: return "resolved"; + case REFUTED: return "refuted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNCONFIRMED: return ""; + case CONFIRMED: return ""; + case RESOLVED: return ""; + case REFUTED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified Substance."; + case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge."; + case RESOLVED: return "A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved."; + case REFUTED: return "A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNCONFIRMED: return "Unconfirmed"; + case CONFIRMED: return "Confirmed"; + case RESOLVED: return "Resolved"; + case REFUTED: return "Refuted"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { + public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unconfirmed".equals(codeString)) + return AllergyIntoleranceStatus.UNCONFIRMED; + if ("confirmed".equals(codeString)) + return AllergyIntoleranceStatus.CONFIRMED; + if ("resolved".equals(codeString)) + return AllergyIntoleranceStatus.RESOLVED; + if ("refuted".equals(codeString)) + return AllergyIntoleranceStatus.REFUTED; + throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceStatus code) throws IllegalArgumentException { + if (code == AllergyIntoleranceStatus.UNCONFIRMED) + return "unconfirmed"; + if (code == AllergyIntoleranceStatus.CONFIRMED) + return "confirmed"; + if (code == AllergyIntoleranceStatus.RESOLVED) + return "resolved"; + if (code == AllergyIntoleranceStatus.REFUTED) + return "refuted"; + return "?"; + } + } + + public enum AllergyIntoleranceCriticality implements FhirEnum { + /** + * 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: 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 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; + 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 "?"; + } + } + public String getSystem() { + 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: 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 "?"; + } + } + public String getDisplay() { + 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 AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("low".equals(codeString)) + return AllergyIntoleranceCriticality.LOW; + if ("high".equals(codeString)) + return AllergyIntoleranceCriticality.HIGH; + if ("unassessible".equals(codeString)) + return AllergyIntoleranceCriticality.UNASSESSIBLE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + } + 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 implements FhirEnum { + /** + * Immune mediated reaction, including allergic reactions and hypersensitivities. + */ + IMMUNE, + /** + * A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions. + */ + NONIMMUNE, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case IMMUNE: return "immune"; + case NONIMMUNE: return "non-immune"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case IMMUNE: return ""; + case NONIMMUNE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case IMMUNE: return "Immune mediated reaction, including allergic reactions and hypersensitivities."; + case NONIMMUNE: return "A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case IMMUNE: return "Immune Mediated"; + case NONIMMUNE: return "Non-immune mediated"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { + public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("immune".equals(codeString)) + return AllergyIntoleranceType.IMMUNE; + if ("non-immune".equals(codeString)) + return AllergyIntoleranceType.NONIMMUNE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceType code) throws IllegalArgumentException { + if (code == AllergyIntoleranceType.IMMUNE) + return "immune"; + if (code == AllergyIntoleranceType.NONIMMUNE) + return "non-immune"; + return "?"; + } + } + + public enum AllergyIntoleranceCategory implements FhirEnum { + /** + * Any substance consumed to provide nutritional support for the body. + */ + FOOD, + /** + * Substances administered to achieve a physiological effect. + */ + MEDICATION, + /** + * Substances that are encountered in the environment. + */ + ENVIRONMENT, + /** + * added to help the parsers + */ + NULL; + + 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)) + return FOOD; + if ("medication".equals(codeString)) + return MEDICATION; + if ("environment".equals(codeString)) + return ENVIRONMENT; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case FOOD: return "food"; + case MEDICATION: return "medication"; + case ENVIRONMENT: return "environment"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FOOD: return ""; + case MEDICATION: return ""; + case ENVIRONMENT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FOOD: return "Any substance consumed to provide nutritional support for the body."; + case MEDICATION: return "Substances administered to achieve a physiological effect."; + case ENVIRONMENT: return "Substances that are encountered in the environment."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FOOD: return "Food"; + case MEDICATION: return "Medication"; + case ENVIRONMENT: return "Environment"; + default: return "?"; + } + } + } + + public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { + public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("food".equals(codeString)) + return AllergyIntoleranceCategory.FOOD; + if ("medication".equals(codeString)) + return AllergyIntoleranceCategory.MEDICATION; + if ("environment".equals(codeString)) + return AllergyIntoleranceCategory.ENVIRONMENT; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + } + public String toCode(AllergyIntoleranceCategory code) throws IllegalArgumentException { + if (code == AllergyIntoleranceCategory.FOOD) + return "food"; + if (code == AllergyIntoleranceCategory.MEDICATION) + return "medication"; + if (code == AllergyIntoleranceCategory.ENVIRONMENT) + return "environment"; + return "?"; + } + } + + public enum ReactionEventCertainty implements FhirEnum { + /** + * There is a low level of clinical certainty that the reaction was caused by the identified Substance. + */ + UNLIKELY, + /** + * There is a high level of clinical certainty that the reaction was caused by the identified Substance. + */ + LIKELY, + /** + * There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. + */ + CONFIRMED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return UNLIKELY; + if ("likely".equals(codeString)) + return LIKELY; + if ("confirmed".equals(codeString)) + return CONFIRMED; + throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case UNLIKELY: return "unlikely"; + case LIKELY: return "likely"; + case CONFIRMED: return "confirmed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNLIKELY: return ""; + case LIKELY: return ""; + case CONFIRMED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNLIKELY: return "There is a low level of clinical certainty that the reaction was caused by the identified Substance."; + case LIKELY: return "There is a high level of clinical certainty that the reaction was caused by the identified Substance."; + case CONFIRMED: return "There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNLIKELY: return "Unlikely"; + case LIKELY: return "Likely"; + case CONFIRMED: return "Confirmed"; + default: return "?"; + } + } + } + + public static class ReactionEventCertaintyEnumFactory implements EnumFactory { + public ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unlikely".equals(codeString)) + return ReactionEventCertainty.UNLIKELY; + if ("likely".equals(codeString)) + return ReactionEventCertainty.LIKELY; + if ("confirmed".equals(codeString)) + return ReactionEventCertainty.CONFIRMED; + throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); + } + public String toCode(ReactionEventCertainty code) throws IllegalArgumentException { + if (code == ReactionEventCertainty.UNLIKELY) + return "unlikely"; + if (code == ReactionEventCertainty.LIKELY) + return "likely"; + if (code == ReactionEventCertainty.CONFIRMED) + return "confirmed"; + return "?"; + } + } + + public enum ReactionEventSeverity implements FhirEnum { + /** + * Causes mild physiological effects. + */ + MILD, + /** + * Causes moderate physiological effects. + */ + MODERATE, + /** + * Causes severe physiological effects. + */ + SEVERE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return MILD; + if ("moderate".equals(codeString)) + return MODERATE; + if ("severe".equals(codeString)) + return SEVERE; + throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MILD: return "mild"; + case MODERATE: return "moderate"; + case SEVERE: return "severe"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MILD: return ""; + case MODERATE: return ""; + case SEVERE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MILD: return "Causes mild physiological effects."; + case MODERATE: return "Causes moderate physiological effects."; + case SEVERE: return "Causes severe physiological effects."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MILD: return "Mild"; + case MODERATE: return "Moderate"; + case SEVERE: return "Severe"; + default: return "?"; + } + } + } + + public static class ReactionEventSeverityEnumFactory implements EnumFactory { + public ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("mild".equals(codeString)) + return ReactionEventSeverity.MILD; + if ("moderate".equals(codeString)) + return ReactionEventSeverity.MODERATE; + if ("severe".equals(codeString)) + return ReactionEventSeverity.SEVERE; + throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); + } + public String toCode(ReactionEventSeverity code) throws IllegalArgumentException { + if (code == ReactionEventSeverity.MILD) + return "mild"; + if (code == ReactionEventSeverity.MODERATE) + return "moderate"; + if (code == ReactionEventSeverity.SEVERE) + return "severe"; + return "?"; + } + } + + @Block() + public static class AllergyIntoleranceEventComponent extends BackboneElement { + /** + * Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. + */ + @Child(name="substance", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Specific substance considered to be responsible for event", formalDefinition="Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance." ) + protected CodeableConcept substance; + + /** + * Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + */ + @Child(name="certainty", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="unlikely | likely | confirmed - clinical certainty about the specific substance", formalDefinition="Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event." ) + protected Enumeration certainty; + + /** + * Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event. + */ + @Child(name="manifestation", type={CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event." ) + protected List manifestation; + + /** + * Text description about the Reaction as a whole, including details of the manifestation if required. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the Reaction as a whole, including details of the manifestation if required." ) + protected StringType description; + + /** + * Record of the date and/or time of the onset of the Reaction. + */ + @Child(name="onset", type={DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." ) + protected DateTimeType onset; + + /** + * The amount of time that the Adverse Reaction persisted. + */ + @Child(name="duration", type={Duration.class}, order=6, min=0, max=1) + @Description(shortDefinition="How long Manifestations persisted", formalDefinition="The amount of time that the Adverse Reaction persisted." ) + protected Duration duration; + + /** + * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + @Child(name="severity", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." ) + protected Enumeration severity; + + /** + * Identification of the route by which the subject was exposed to the substance. + */ + @Child(name="exposureRoute", type={CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." ) + protected CodeableConcept exposureRoute; + + /** + * Additional text about the Adverse Reaction event not captured in other fields. + */ + @Child(name="comment", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the Adverse Reaction event not captured in other fields." ) + protected StringType comment; + + private static final long serialVersionUID = -1773271720L; + + public AllergyIntoleranceEventComponent() { + super(); + } + + /** + * @return {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) + */ + public CodeableConcept getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new CodeableConcept(); + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) + */ + public AllergyIntoleranceEventComponent setSubstance(CodeableConcept value) { + this.substance = value; + return this; + } + + /** + * @return {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value + */ + public Enumeration getCertaintyElement() { + if (this.certainty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.certainty"); + else if (Configuration.doAutoCreate()) + this.certainty = new Enumeration(); + return this.certainty; + } + + public boolean hasCertaintyElement() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + public boolean hasCertainty() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + /** + * @param value {@link #certainty} (Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setCertaintyElement(Enumeration value) { + this.certainty = value; + return this; + } + + /** + * @return Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + */ + public ReactionEventCertainty getCertainty() { + return this.certainty == null ? null : this.certainty.getValue(); + } + + /** + * @param value Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + */ + public AllergyIntoleranceEventComponent setCertainty(ReactionEventCertainty value) { + if (value == null) + this.certainty = null; + else { + if (this.certainty == null) + this.certainty = new Enumeration(ReactionEventCertainty.ENUM_FACTORY); + this.certainty.setValue(value); + } + return this; + } + + /** + * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) + */ + public List getManifestation() { + if (this.manifestation == null) + this.manifestation = new ArrayList(); + return this.manifestation; + } + + public boolean hasManifestation() { + if (this.manifestation == null) + return false; + for (CodeableConcept item : this.manifestation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.) + */ + // syntactic sugar + public CodeableConcept addManifestation() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.manifestation == null) + this.manifestation = new ArrayList(); + this.manifestation.add(t); + return t; + } + + /** + * @return {@link #description} (Text description about the Reaction as a whole, including details of the manifestation if required.). 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 AllergyIntoleranceEventComponent.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} (Text description about the Reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description about the Reaction as a whole, including details of the manifestation if required. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description about the Reaction as a whole, including details of the manifestation if required. + */ + public AllergyIntoleranceEventComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public DateTimeType getOnsetElement() { + if (this.onset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.onset"); + else if (Configuration.doAutoCreate()) + this.onset = new DateTimeType(); + return this.onset; + } + + public boolean hasOnsetElement() { + return this.onset != null && !this.onset.isEmpty(); + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setOnsetElement(DateTimeType value) { + this.onset = value; + return this; + } + + /** + * @return Record of the date and/or time of the onset of the Reaction. + */ + 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(Date value) { + if (value == null) + this.onset = null; + else { + if (this.onset == null) + this.onset = new DateTimeType(); + this.onset.setValue(value); + } + return this; + } + + /** + * @return {@link #duration} (The amount of time that the Adverse Reaction persisted.) + */ + public Duration getDuration() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new Duration(); + return this.duration; + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The amount of time that the Adverse Reaction persisted.) + */ + public AllergyIntoleranceEventComponent setDuration(Duration value) { + this.duration = value; + return this; + } + + /** + * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(); + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + public ReactionEventSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + */ + public AllergyIntoleranceEventComponent setSeverity(ReactionEventSeverity value) { + if (value == null) + this.severity = null; + else { + if (this.severity == null) + this.severity = new Enumeration(ReactionEventSeverity.ENUM_FACTORY); + this.severity.setValue(value); + } + return this; + } + + /** + * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) + */ + public CodeableConcept getExposureRoute() { + if (this.exposureRoute == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.exposureRoute"); + else if (Configuration.doAutoCreate()) + this.exposureRoute = new CodeableConcept(); + return this.exposureRoute; + } + + public boolean hasExposureRoute() { + return this.exposureRoute != null && !this.exposureRoute.isEmpty(); + } + + /** + * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) + */ + public AllergyIntoleranceEventComponent setExposureRoute(CodeableConcept value) { + this.exposureRoute = value; + return this; + } + + /** + * @return {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntoleranceEventComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional text about the Adverse Reaction event not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AllergyIntoleranceEventComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional text about the Adverse Reaction event not captured in other fields. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional text about the Adverse Reaction event not captured in other fields. + */ + public AllergyIntoleranceEventComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("substance", "CodeableConcept", "Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.", 0, java.lang.Integer.MAX_VALUE, substance)); + childrenList.add(new Property("certainty", "code", "Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event.", 0, java.lang.Integer.MAX_VALUE, certainty)); + childrenList.add(new Property("manifestation", "CodeableConcept", "Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event.", 0, java.lang.Integer.MAX_VALUE, manifestation)); + childrenList.add(new Property("description", "string", "Text description about the Reaction as a whole, including details of the manifestation if required.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("duration", "Duration", "The amount of time that the Adverse Reaction persisted.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, java.lang.Integer.MAX_VALUE, exposureRoute)); + childrenList.add(new Property("comment", "string", "Additional text about the Adverse Reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); + } + + public AllergyIntoleranceEventComponent copy() { + AllergyIntoleranceEventComponent dst = new AllergyIntoleranceEventComponent(); + copyValues(dst); + dst.substance = substance == null ? null : substance.copy(); + dst.certainty = certainty == null ? null : certainty.copy(); + if (manifestation != null) { + dst.manifestation = new ArrayList(); + for (CodeableConcept i : manifestation) + dst.manifestation.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy(); + dst.comment = comment == null ? null : comment.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (substance == null || substance.isEmpty()) && (certainty == null || certainty.isEmpty()) + && (manifestation == null || manifestation.isEmpty()) && (description == null || description.isEmpty()) + && (onset == null || onset.isEmpty()) && (duration == null || duration.isEmpty()) && (severity == null || severity.isEmpty()) + && (exposureRoute == null || exposureRoute.isEmpty()) && (comment == null || comment.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this allergy/intolerance concern 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 item", formalDefinition="This records identifiers associated with this allergy/intolerance concern 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; + + /** + * Date when the sensitivity was recorded. + */ + @Child(name="recordedDate", type={DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="When recorded", formalDefinition="Date when the sensitivity was recorded." ) + protected DateTimeType recordedDate; + + /** + * Indicates who has responsibility for the record. + */ + @Child(name="recorder", type={Practitioner.class, Patient.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Indicates who has responsibility for the record." ) + protected Reference recorder; + + /** + * The actual object that is the target of the reference (Indicates who has responsibility for the record.) + */ + protected Resource recorderTarget; + + /** + * The patient who has the allergy or intolerance. + */ + @Child(name="subject", type={Patient.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who has the allergy or intolerance.) + */ + protected Patient subjectTarget; + + /** + * Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk. + */ + @Child(name="substance", type={CodeableConcept.class}, order=3, min=1, max=1) + @Description(shortDefinition="Substance, (or class) considered to be responsible for risk", formalDefinition="Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk." ) + protected CodeableConcept substance; + + /** + * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + @Child(name="status", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="unconfirmed | confirmed | resolved | refuted", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ) + protected Enumeration status; + + /** + * 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 | unassessible - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) + protected Enumeration criticality; + + /** + * Identification of the underlying physiological mechanism for the Reaction Risk. + */ + @Child(name="type", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="immune | non-immune - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the Reaction Risk." ) + protected Enumeration type; + + /** + * Category of the identified Substance. + */ + @Child(name="category", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="food | medication | environment - Category of Substance", formalDefinition="Category of the identified Substance." ) + protected Enumeration category; + + /** + * Represents the date and/or time of the last known occurence of a reaction event. + */ + @Child(name="lastOccurence", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Date(/time) of last known occurence of a reaction", formalDefinition="Represents the date and/or time of the last known occurence of a reaction event." ) + protected DateTimeType lastOccurence; + + /** + * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + @Child(name="comment", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) + protected StringType comment; + + /** + * Details about each Adverse Reaction Event linked to exposure to the identified Substance. + */ + @Child(name="event", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each Adverse Reaction Event linked to exposure to the identified Substance." ) + protected List event; + + private static final long serialVersionUID = -571844748L; + + public AllergyIntolerance() { + super(); + } + + public AllergyIntolerance(Reference subject, CodeableConcept substance) { + super(); + this.subject = subject; + this.substance = substance; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 allergy/intolerance concern 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value + */ + public DateTimeType getRecordedDateElement() { + if (this.recordedDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate"); + else if (Configuration.doAutoCreate()) + this.recordedDate = new DateTimeType(); + return this.recordedDate; + } + + public boolean hasRecordedDateElement() { + return this.recordedDate != null && !this.recordedDate.isEmpty(); + } + + public boolean hasRecordedDate() { + return this.recordedDate != null && !this.recordedDate.isEmpty(); + } + + /** + * @param value {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value + */ + public AllergyIntolerance setRecordedDateElement(DateTimeType value) { + this.recordedDate = value; + return this; + } + + /** + * @return Date when the sensitivity was recorded. + */ + public Date getRecordedDate() { + return this.recordedDate == null ? null : this.recordedDate.getValue(); + } + + /** + * @param value Date when the sensitivity was recorded. + */ + public AllergyIntolerance setRecordedDate(Date value) { + if (value == null) + this.recordedDate = null; + else { + if (this.recordedDate == null) + this.recordedDate = new DateTimeType(); + this.recordedDate.setValue(value); + } + return this; + } + + /** + * @return {@link #recorder} (Indicates who has responsibility for the record.) + */ + public Reference getRecorder() { + if (this.recorder == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.recorder"); + else if (Configuration.doAutoCreate()) + this.recorder = new Reference(); + return this.recorder; + } + + public boolean hasRecorder() { + return this.recorder != null && !this.recorder.isEmpty(); + } + + /** + * @param value {@link #recorder} (Indicates who has responsibility for the record.) + */ + public AllergyIntolerance setRecorder(Reference value) { + this.recorder = value; + return this; + } + + /** + * @return {@link #recorder} 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. (Indicates who has responsibility for the record.) + */ + public Resource getRecorderTarget() { + return this.recorderTarget; + } + + /** + * @param value {@link #recorder} 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. (Indicates who has responsibility for the record.) + */ + public AllergyIntolerance setRecorderTarget(Resource value) { + this.recorderTarget = value; + return this; + } + + /** + * @return {@link #subject} (The patient who has the allergy or intolerance.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.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 has the allergy or intolerance.) + */ + public AllergyIntolerance 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 has the allergy or intolerance.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.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 has the allergy or intolerance.) + */ + public AllergyIntolerance setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) + */ + public CodeableConcept getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new CodeableConcept(); + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.) + */ + public AllergyIntolerance setSubstance(CodeableConcept value) { + this.substance = value; + return this; + } + + /** + * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public AllergyIntolerance setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + public AllergyIntoleranceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + */ + public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(AllergyIntoleranceStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value + */ + public Enumeration getCriticalityElement() { + if (this.criticality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.criticality"); + else if (Configuration.doAutoCreate()) + this.criticality = new Enumeration(); + return this.criticality; + } + + public boolean hasCriticalityElement() { + return this.criticality != null && !this.criticality.isEmpty(); + } + + public boolean hasCriticality() { + return this.criticality != null && !this.criticality.isEmpty(); + } + + /** + * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value + */ + public AllergyIntolerance setCriticalityElement(Enumeration value) { + this.criticality = value; + return this; + } + + /** + * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + public AllergyIntoleranceCriticality getCriticality() { + return this.criticality == null ? null : this.criticality.getValue(); + } + + /** + * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + */ + public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { + if (value == null) + this.criticality = null; + else { + if (this.criticality == null) + this.criticality = new Enumeration(AllergyIntoleranceCriticality.ENUM_FACTORY); + this.criticality.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Identification of the underlying physiological mechanism for the Reaction Risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public AllergyIntolerance setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identification of the underlying physiological mechanism for the Reaction Risk. + */ + public AllergyIntoleranceType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identification of the underlying physiological mechanism for the Reaction Risk. + */ + public AllergyIntolerance setType(AllergyIntoleranceType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(AllergyIntoleranceType.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public AllergyIntolerance setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Category of the identified Substance. + */ + public AllergyIntoleranceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Category of the identified Substance. + */ + public AllergyIntolerance setCategory(AllergyIntoleranceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(AllergyIntoleranceCategory.ENUM_FACTORY); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value + */ + public DateTimeType getLastOccurenceElement() { + if (this.lastOccurence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurence"); + else if (Configuration.doAutoCreate()) + this.lastOccurence = new DateTimeType(); + return this.lastOccurence; + } + + public boolean hasLastOccurenceElement() { + return this.lastOccurence != null && !this.lastOccurence.isEmpty(); + } + + public boolean hasLastOccurence() { + return this.lastOccurence != null && !this.lastOccurence.isEmpty(); + } + + /** + * @param value {@link #lastOccurence} (Represents the date and/or time of the last known occurence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value + */ + public AllergyIntolerance setLastOccurenceElement(DateTimeType value) { + this.lastOccurence = value; + return this; + } + + /** + * @return Represents the date and/or time of the last known occurence of a reaction event. + */ + 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(Date value) { + if (value == null) + this.lastOccurence = null; + else { + if (this.lastOccurence == null) + this.lastOccurence = new DateTimeType(); + this.lastOccurence.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AllergyIntolerance.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AllergyIntolerance setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + */ + public AllergyIntolerance setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (AllergyIntoleranceEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (Details about each Adverse Reaction Event linked to exposure to the identified Substance.) + */ + // syntactic sugar + public AllergyIntoleranceEventComponent addEvent() { //3 + AllergyIntoleranceEventComponent t = new AllergyIntoleranceEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern 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("recordedDate", "dateTime", "Date when the sensitivity was recorded.", 0, java.lang.Integer.MAX_VALUE, recordedDate)); + childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Indicates who has responsibility for the record.", 0, java.lang.Integer.MAX_VALUE, recorder)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("substance", "CodeableConcept", "Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk.", 0, java.lang.Integer.MAX_VALUE, substance)); + childrenList.add(new Property("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); + childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the Reaction Risk.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("category", "code", "Category of the identified Substance.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("lastOccurence", "dateTime", "Represents the date and/or time of the last known occurence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurence)); + childrenList.add(new Property("comment", "string", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("event", "", "Details about each Adverse Reaction Event linked to exposure to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + public AllergyIntolerance copy() { + AllergyIntolerance dst = new AllergyIntolerance(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.recordedDate = recordedDate == null ? null : recordedDate.copy(); + dst.recorder = recorder == null ? null : recorder.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.substance = substance == null ? null : substance.copy(); + dst.status = status == null ? null : status.copy(); + dst.criticality = criticality == null ? null : criticality.copy(); + dst.type = type == null ? null : type.copy(); + dst.category = category == null ? null : category.copy(); + dst.lastOccurence = lastOccurence == null ? null : lastOccurence.copy(); + dst.comment = comment == null ? null : comment.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (AllergyIntoleranceEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + protected AllergyIntolerance typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (recordedDate == null || recordedDate.isEmpty()) + && (recorder == null || recorder.isEmpty()) && (subject == null || subject.isEmpty()) && (substance == null || substance.isEmpty()) + && (status == null || status.isEmpty()) && (criticality == null || criticality.isEmpty()) + && (type == null || type.isEmpty()) && (category == null || category.isEmpty()) && (lastOccurence == null || lastOccurence.isEmpty()) + && (comment == null || comment.isEmpty()) && (event == null || event.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AllergyIntolerance; + } + + @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="unconfirmed | confirmed | resolved | refuted", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="AllergyIntolerance.subject", description="Who the sensitivity is for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="onset", path="AllergyIntolerance.event.onset", description="Date(/time) when manifestations showed", type="date" ) + public static final String SP_ONSET = "onset"; + @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurence", description="Date(/time) of last known occurence of a reaction", type="date" ) + 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="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 | 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"; + @SearchParamDefinition(name="duration", path="AllergyIntolerance.event.duration", description="How long Manifestations persisted", type="quantity" ) + public static final String SP_DURATION = "duration"; + @SearchParamDefinition(name="patient", path="AllergyIntolerance.subject", description="Who the sensitivity is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="recorder", path="AllergyIntolerance.recorder", description="Who recorded the sensitivity", type="reference" ) + public static final String SP_RECORDER = "recorder"; + @SearchParamDefinition(name="route", path="AllergyIntolerance.event.exposureRoute", description="How the subject was exposed to the substance", type="token" ) + public static final String SP_ROUTE = "route"; + @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier", description="External Ids for this item", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="manifestation", path="AllergyIntolerance.event.manifestation", description="Clinical symptoms/signs associated with the Event", type="token" ) + public static final String SP_MANIFESTATION = "manifestation"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java index 387c44280bd..1a30371bb15 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java @@ -20,1348 +20,1348 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time. - */ -@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") -public class Appointment extends DomainResource { - - public enum Participantrequired implements FhirEnum { - /** - * The participant is required to attend the appointment. - */ - REQUIRED, - /** - * The participant may optionally attend the appointment. - */ - OPTIONAL, - /** - * The participant is not required to attend the appointment (appointment is about them, not for them). - */ - INFORMATIONONLY, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REQUIRED; - if ("optional".equals(codeString)) - return OPTIONAL; - if ("information-only".equals(codeString)) - return INFORMATIONONLY; - throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case OPTIONAL: return "optional"; - case INFORMATIONONLY: return "information-only"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return ""; - case OPTIONAL: return ""; - case INFORMATIONONLY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "The participant is required to attend the appointment."; - case OPTIONAL: return "The participant may optionally attend the appointment."; - case INFORMATIONONLY: return "The participant is not required to attend the appointment (appointment is about them, not for them)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "required"; - case OPTIONAL: return "optional"; - case INFORMATIONONLY: return "information-only"; - default: return "?"; - } - } - } - - public static class ParticipantrequiredEnumFactory implements EnumFactory { - public Participantrequired fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return Participantrequired.REQUIRED; - if ("optional".equals(codeString)) - return Participantrequired.OPTIONAL; - if ("information-only".equals(codeString)) - return Participantrequired.INFORMATIONONLY; - throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); - } - public String toCode(Participantrequired code) throws IllegalArgumentException { - if (code == Participantrequired.REQUIRED) - return "required"; - if (code == Participantrequired.OPTIONAL) - return "optional"; - if (code == Participantrequired.INFORMATIONONLY) - return "information-only"; - return "?"; - } - } - - public enum Participationstatus implements FhirEnum { - /** - * The participant has accepted the appointment. - */ - ACCEPTED, - /** - * The participant has declined the appointment and will not participate in the appointment. - */ - DECLINED, - /** - * The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur. - */ - TENTATIVE, - /** - * The participant has started the appointment. - */ - INPROCESS, - /** - * The participant's involvement in the appointment has been completed. - */ - COMPLETED, - /** - * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses. - */ - NEEDSACTION, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ACCEPTED; - if ("declined".equals(codeString)) - return DECLINED; - if ("tentative".equals(codeString)) - return TENTATIVE; - if ("in-process".equals(codeString)) - return INPROCESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("needs-action".equals(codeString)) - return NEEDSACTION; - throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case INPROCESS: return "in-process"; - case COMPLETED: return "completed"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACCEPTED: return ""; - case DECLINED: return ""; - case TENTATIVE: return ""; - case INPROCESS: return ""; - case COMPLETED: return ""; - case NEEDSACTION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACCEPTED: return "The participant has accepted the appointment."; - case DECLINED: return "The participant has declined the appointment and will not participate in the appointment."; - case TENTATIVE: return "The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur."; - case INPROCESS: return "The participant has started the appointment."; - case COMPLETED: return "The participant's involvement in the appointment has been completed."; - case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case INPROCESS: return "in-process"; - case COMPLETED: return "completed"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - } - - public static class ParticipationstatusEnumFactory implements EnumFactory { - public Participationstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return Participationstatus.ACCEPTED; - if ("declined".equals(codeString)) - return Participationstatus.DECLINED; - if ("tentative".equals(codeString)) - return Participationstatus.TENTATIVE; - if ("in-process".equals(codeString)) - return Participationstatus.INPROCESS; - if ("completed".equals(codeString)) - return Participationstatus.COMPLETED; - if ("needs-action".equals(codeString)) - return Participationstatus.NEEDSACTION; - throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); - } - public String toCode(Participationstatus code) throws IllegalArgumentException { - if (code == Participationstatus.ACCEPTED) - return "accepted"; - if (code == Participationstatus.DECLINED) - return "declined"; - if (code == Participationstatus.TENTATIVE) - return "tentative"; - if (code == Participationstatus.INPROCESS) - return "in-process"; - if (code == Participationstatus.COMPLETED) - return "completed"; - if (code == Participationstatus.NEEDSACTION) - return "needs-action"; - return "?"; - } - } - - @Block() - public static class AppointmentParticipantComponent extends BackboneElement { - /** - * Role of participant in the appointment. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) - protected List type; - - /** - * A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device. - */ - @Child(name="actor", type={}, order=2, min=0, max=1) - @Description(shortDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device", formalDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - protected Resource actorTarget; - - /** - * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - */ - @Child(name="required", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="required | optional | information-only", formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." ) - protected Enumeration required; - - /** - * Participation status of the Patient. - */ - @Child(name="status", type={CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the Patient." ) - protected Enumeration status; - - private static final long serialVersionUID = -1009855227L; - - public AppointmentParticipantComponent() { - super(); - } - - public AppointmentParticipantComponent(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #type} (Role of participant in the appointment.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Role of participant in the appointment.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #actor} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - public AppointmentParticipantComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} 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 Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} 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 Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - public AppointmentParticipantComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public Enumeration getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new Enumeration(); - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public AppointmentParticipantComponent setRequiredElement(Enumeration value) { - this.required = value; - return this; - } - - /** - * @return Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - */ - public Participantrequired getRequired() { - return this.required == null ? null : this.required.getValue(); - } - - /** - * @param value Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - */ - public AppointmentParticipantComponent setRequired(Participantrequired value) { - if (value == null) - this.required = null; - else { - if (this.required == null) - this.required = new Enumeration(Participantrequired.ENUM_FACTORY); - this.required.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public AppointmentParticipantComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Participation status of the Patient. - */ - public Participationstatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Participation status of the Patient. - */ - public AppointmentParticipantComponent setStatus(Participationstatus value) { - if (this.status == null) - this.status = new Enumeration(Participationstatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actor", "Reference(Any)", "A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("status", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - public AppointmentParticipantComponent copy() { - AppointmentParticipantComponent dst = new AppointmentParticipantComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.required = required == null ? null : required.copy(); - dst.status = status == null ? null : status.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (actor == null || actor.isEmpty()) - && (required == null || required.isEmpty()) && (status == null || status.isEmpty()); - } - - } - - /** - * This records identifiers associated with this appointment concern 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 item", formalDefinition="This records identifiers associated with this appointment concern 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; - - /** - * The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept). - */ - @Child(name="priority", type={IntegerType.class}, order=0, min=0, max=1) - @Description(shortDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)", formalDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)." ) - protected IntegerType priority; - - /** - * Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - @Child(name="status", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="The overall status of the Appointment", formalDefinition="Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." ) - protected CodeType status; - - /** - * The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself). - */ - @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself)", formalDefinition="The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself)." ) - protected CodeableConcept type; - - /** - * The reason that this appointment is being scheduled, this is more clinical than administrative. - */ - @Child(name="reason", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative", formalDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative." ) - protected CodeableConcept reason; - - /** - * The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field", formalDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field." ) - protected StringType description; - - /** - * Date/Time that the appointment is to take place. - */ - @Child(name="start", type={InstantType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Date/Time that the appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) - protected InstantType start; - - /** - * Date/Time that the appointment is to conclude. - */ - @Child(name="end", type={InstantType.class}, order=6, min=1, max=1) - @Description(shortDefinition="Date/Time that the appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) - protected InstantType end; - - /** - * The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot. - */ - @Child(name="slot", type={Slot.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot", formalDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot." ) - protected List slot; - /** - * The actual objects that are the target of the reference (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - protected List slotTarget; - - - /** - * The primary location that this appointment is to take place. - */ - @Child(name="location", type={Location.class}, order=8, min=0, max=1) - @Description(shortDefinition="The primary location that this appointment is to take place", formalDefinition="The primary location that this appointment is to take place." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The primary location that this appointment is to take place.) - */ - protected Location locationTarget; - - /** - * Additional comments about the appointment. - */ - @Child(name="comment", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Additional comments about the appointment", formalDefinition="Additional comments about the appointment." ) - protected StringType comment; - - /** - * An Order that lead to the creation of this appointment. - */ - @Child(name="order", type={Order.class}, order=10, min=0, max=1) - @Description(shortDefinition="An Order that lead to the creation of this appointment", formalDefinition="An Order that lead to the creation of this appointment." ) - protected Reference order; - - /** - * The actual object that is the target of the reference (An Order that lead to the creation of this appointment.) - */ - protected Order orderTarget; - - /** - * List of participants involved in the appointment. - */ - @Child(name="participant", type={}, order=11, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of participants involved in the appointment", formalDefinition="List of participants involved in the appointment." ) - protected List participant; - - /** - * Who recorded the appointment. - */ - @Child(name="lastModifiedBy", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=12, min=0, max=1) - @Description(shortDefinition="Who recorded the appointment", formalDefinition="Who recorded the appointment." ) - protected Reference lastModifiedBy; - - /** - * The actual object that is the target of the reference (Who recorded the appointment.) - */ - protected Resource lastModifiedByTarget; - - /** - * Date when the appointment was recorded. - */ - @Child(name="lastModified", type={DateTimeType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Date when the appointment was recorded", formalDefinition="Date when the appointment was recorded." ) - protected DateTimeType lastModified; - - private static final long serialVersionUID = 897214982L; - - public Appointment() { - super(); - } - - public Appointment(InstantType start, InstantType end) { - super(); - this.start = start; - this.end = end; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment concern 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 appointment concern 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public IntegerType getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new IntegerType(); - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Appointment setPriorityElement(IntegerType value) { - this.priority = value; - return this; - } - - /** - * @return The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept). - */ - public int getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept). - */ - public Appointment setPriority(int value) { - if (value == -1) - this.priority = null; - else { - if (this.priority == null) - this.priority = new IntegerType(); - this.priority.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CodeType getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.status"); - else if (Configuration.doAutoCreate()) - this.status = new CodeType(); - 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} (Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Appointment setStatusElement(CodeType value) { - this.status = value; - return this; - } - - /** - * @return Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - public String getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - public Appointment setStatus(String value) { - if (Utilities.noString(value)) - this.status = null; - else { - if (this.status == null) - this.status = new CodeType(); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).) - */ - public Appointment setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) - */ - public Appointment setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). 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 Appointment.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} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Appointment setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. - */ - public Appointment setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Appointment setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the appointment is to take place. - */ - 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(Date value) { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Appointment setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the appointment is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the appointment is to conclude. - */ - public Appointment setEnd(Date value) { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - public List getSlot() { - if (this.slot == null) - this.slot = new ArrayList(); - return this.slot; - } - - public boolean hasSlot() { - if (this.slot == null) - return false; - for (Reference item : this.slot) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - // syntactic sugar - public Reference addSlot() { //3 - Reference t = new Reference(); - if (this.slot == null) - this.slot = new ArrayList(); - this.slot.add(t); - return t; - } - - /** - * @return {@link #slot} (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 slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - public List getSlotTarget() { - if (this.slotTarget == null) - this.slotTarget = new ArrayList(); - return this.slotTarget; - } - - // syntactic sugar - /** - * @return {@link #slot} (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 slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) - */ - public Slot addSlotTarget() { - Slot r = new Slot(); - if (this.slotTarget == null) - this.slotTarget = new ArrayList(); - this.slotTarget.add(r); - return r; - } - - /** - * @return {@link #location} (The primary location that this appointment is to take place.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The primary location that this appointment is to take place.) - */ - public Appointment setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 primary location that this appointment is to take place.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 primary location that this appointment is to take place.) - */ - public Appointment setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Appointment setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional comments about the appointment. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional comments about the appointment. - */ - public Appointment setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #order} (An Order that lead to the creation of this appointment.) - */ - public Reference getOrder() { - if (this.order == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.order"); - else if (Configuration.doAutoCreate()) - this.order = new Reference(); - return this.order; - } - - public boolean hasOrder() { - return this.order != null && !this.order.isEmpty(); - } - - /** - * @param value {@link #order} (An Order that lead to the creation of this appointment.) - */ - public Appointment setOrder(Reference value) { - this.order = value; - return this; - } - - /** - * @return {@link #order} 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. (An Order that lead to the creation of this appointment.) - */ - public Order getOrderTarget() { - if (this.orderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.order"); - else if (Configuration.doAutoCreate()) - this.orderTarget = new Order(); - return this.orderTarget; - } - - /** - * @param value {@link #order} 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. (An Order that lead to the creation of this appointment.) - */ - public Appointment setOrderTarget(Order value) { - this.orderTarget = value; - return this; - } - - /** - * @return {@link #participant} (List of participants involved in the appointment.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (AppointmentParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (List of participants involved in the appointment.) - */ - // syntactic sugar - public AppointmentParticipantComponent addParticipant() { //3 - AppointmentParticipantComponent t = new AppointmentParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - /** - * @return {@link #lastModifiedBy} (Who recorded the appointment.) - */ - public Reference getLastModifiedBy() { - if (this.lastModifiedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.lastModifiedBy"); - else if (Configuration.doAutoCreate()) - this.lastModifiedBy = new Reference(); - return this.lastModifiedBy; - } - - public boolean hasLastModifiedBy() { - return this.lastModifiedBy != null && !this.lastModifiedBy.isEmpty(); - } - - /** - * @param value {@link #lastModifiedBy} (Who recorded the appointment.) - */ - public Appointment setLastModifiedBy(Reference value) { - this.lastModifiedBy = value; - return this; - } - - /** - * @return {@link #lastModifiedBy} 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. (Who recorded the appointment.) - */ - public Resource getLastModifiedByTarget() { - return this.lastModifiedByTarget; - } - - /** - * @param value {@link #lastModifiedBy} 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. (Who recorded the appointment.) - */ - public Appointment setLastModifiedByTarget(Resource value) { - this.lastModifiedByTarget = value; - return this; - } - - /** - * @return {@link #lastModified} (Date when the appointment was recorded.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public DateTimeType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new DateTimeType(); - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (Date when the appointment was recorded.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public Appointment setLastModifiedElement(DateTimeType value) { - this.lastModified = value; - return this; - } - - /** - * @return Date when the appointment was recorded. - */ - public Date getLastModified() { - return this.lastModified == null ? null : this.lastModified.getValue(); - } - - /** - * @param value Date when the appointment was recorded. - */ - public Appointment setLastModified(Date value) { - if (value == null) - this.lastModified = null; - else { - if (this.lastModified == null) - this.lastModified = new DateTimeType(); - this.lastModified.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern 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("priority", "integer", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("status", "code", "Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled, this is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("slot", "Reference(Slot)", "The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.", 0, java.lang.Integer.MAX_VALUE, slot)); - childrenList.add(new Property("location", "Reference(Location)", "The primary location that this appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("order", "Reference(Order)", "An Order that lead to the creation of this appointment.", 0, java.lang.Integer.MAX_VALUE, order)); - childrenList.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("lastModifiedBy", "Reference(Practitioner|Patient|RelatedPerson)", "Who recorded the appointment.", 0, java.lang.Integer.MAX_VALUE, lastModifiedBy)); - childrenList.add(new Property("lastModified", "dateTime", "Date when the appointment was recorded.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - } - - public Appointment copy() { - Appointment dst = new Appointment(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.priority = priority == null ? null : priority.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.description = description == null ? null : description.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - if (slot != null) { - dst.slot = new ArrayList(); - for (Reference i : slot) - dst.slot.add(i.copy()); - }; - dst.location = location == null ? null : location.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.order = order == null ? null : order.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (AppointmentParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.lastModifiedBy = lastModifiedBy == null ? null : lastModifiedBy.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - return dst; - } - - protected Appointment typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (priority == null || priority.isEmpty()) - && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - && (description == null || description.isEmpty()) && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - && (slot == null || slot.isEmpty()) && (location == null || location.isEmpty()) && (comment == null || comment.isEmpty()) - && (order == null || order.isEmpty()) && (participant == null || participant.isEmpty()) && (lastModifiedBy == null || lastModifiedBy.isEmpty()) - && (lastModified == null || lastModified.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Appointment; - } - - @SearchParamDefinition(name="partstatus", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment", type="token" ) - public static final String SP_PARTSTATUS = "partstatus"; - @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="string" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" ) - public static final String SP_DATE = "date"; - -} - + +/* + 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; +/** + * A scheduled healthcare event for a patient and/or practitioner(s) where a service may take place at a specific date/time. + */ +@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") +public class Appointment extends DomainResource { + + public enum Participantrequired implements FhirEnum { + /** + * The participant is required to attend the appointment. + */ + REQUIRED, + /** + * The participant may optionally attend the appointment. + */ + OPTIONAL, + /** + * The participant is not required to attend the appointment (appointment is about them, not for them). + */ + INFORMATIONONLY, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REQUIRED; + if ("optional".equals(codeString)) + return OPTIONAL; + if ("information-only".equals(codeString)) + return INFORMATIONONLY; + throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case OPTIONAL: return "optional"; + case INFORMATIONONLY: return "information-only"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return ""; + case OPTIONAL: return ""; + case INFORMATIONONLY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "The participant is required to attend the appointment."; + case OPTIONAL: return "The participant may optionally attend the appointment."; + case INFORMATIONONLY: return "The participant is not required to attend the appointment (appointment is about them, not for them)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "required"; + case OPTIONAL: return "optional"; + case INFORMATIONONLY: return "information-only"; + default: return "?"; + } + } + } + + public static class ParticipantrequiredEnumFactory implements EnumFactory { + public Participantrequired fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return Participantrequired.REQUIRED; + if ("optional".equals(codeString)) + return Participantrequired.OPTIONAL; + if ("information-only".equals(codeString)) + return Participantrequired.INFORMATIONONLY; + throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); + } + public String toCode(Participantrequired code) throws IllegalArgumentException { + if (code == Participantrequired.REQUIRED) + return "required"; + if (code == Participantrequired.OPTIONAL) + return "optional"; + if (code == Participantrequired.INFORMATIONONLY) + return "information-only"; + return "?"; + } + } + + public enum Participationstatus implements FhirEnum { + /** + * The participant has accepted the appointment. + */ + ACCEPTED, + /** + * The participant has declined the appointment and will not participate in the appointment. + */ + DECLINED, + /** + * The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur. + */ + TENTATIVE, + /** + * The participant has started the appointment. + */ + INPROCESS, + /** + * The participant's involvement in the appointment has been completed. + */ + COMPLETED, + /** + * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses. + */ + NEEDSACTION, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ACCEPTED; + if ("declined".equals(codeString)) + return DECLINED; + if ("tentative".equals(codeString)) + return TENTATIVE; + if ("in-process".equals(codeString)) + return INPROCESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("needs-action".equals(codeString)) + return NEEDSACTION; + throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case INPROCESS: return "in-process"; + case COMPLETED: return "completed"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACCEPTED: return ""; + case DECLINED: return ""; + case TENTATIVE: return ""; + case INPROCESS: return ""; + case COMPLETED: return ""; + case NEEDSACTION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACCEPTED: return "The participant has accepted the appointment."; + case DECLINED: return "The participant has declined the appointment and will not participate in the appointment."; + case TENTATIVE: return "The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur."; + case INPROCESS: return "The participant has started the appointment."; + case COMPLETED: return "The participant's involvement in the appointment has been completed."; + case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case INPROCESS: return "in-process"; + case COMPLETED: return "completed"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + } + + public static class ParticipationstatusEnumFactory implements EnumFactory { + public Participationstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return Participationstatus.ACCEPTED; + if ("declined".equals(codeString)) + return Participationstatus.DECLINED; + if ("tentative".equals(codeString)) + return Participationstatus.TENTATIVE; + if ("in-process".equals(codeString)) + return Participationstatus.INPROCESS; + if ("completed".equals(codeString)) + return Participationstatus.COMPLETED; + if ("needs-action".equals(codeString)) + return Participationstatus.NEEDSACTION; + throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); + } + public String toCode(Participationstatus code) throws IllegalArgumentException { + if (code == Participationstatus.ACCEPTED) + return "accepted"; + if (code == Participationstatus.DECLINED) + return "declined"; + if (code == Participationstatus.TENTATIVE) + return "tentative"; + if (code == Participationstatus.INPROCESS) + return "in-process"; + if (code == Participationstatus.COMPLETED) + return "completed"; + if (code == Participationstatus.NEEDSACTION) + return "needs-action"; + return "?"; + } + } + + @Block() + public static class AppointmentParticipantComponent extends BackboneElement { + /** + * Role of participant in the appointment. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) + protected List type; + + /** + * A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device. + */ + @Child(name="actor", type={}, order=2, min=0, max=1) + @Description(shortDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device", formalDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + protected Resource actorTarget; + + /** + * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + @Child(name="required", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="required | optional | information-only", formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." ) + protected Enumeration required; + + /** + * Participation status of the Patient. + */ + @Child(name="status", type={CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the Patient." ) + protected Enumeration status; + + private static final long serialVersionUID = -1009855227L; + + public AppointmentParticipantComponent() { + super(); + } + + public AppointmentParticipantComponent(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #type} (Role of participant in the appointment.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Role of participant in the appointment.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #actor} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + public AppointmentParticipantComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + public AppointmentParticipantComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public Enumeration getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new Enumeration(); + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public AppointmentParticipantComponent setRequiredElement(Enumeration value) { + this.required = value; + return this; + } + + /** + * @return Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + public Participantrequired getRequired() { + return this.required == null ? null : this.required.getValue(); + } + + /** + * @param value Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + */ + public AppointmentParticipantComponent setRequired(Participantrequired value) { + if (value == null) + this.required = null; + else { + if (this.required == null) + this.required = new Enumeration(Participantrequired.ENUM_FACTORY); + this.required.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentParticipantComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public AppointmentParticipantComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Participation status of the Patient. + */ + public Participationstatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Participation status of the Patient. + */ + public AppointmentParticipantComponent setStatus(Participationstatus value) { + if (this.status == null) + this.status = new Enumeration(Participationstatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actor", "Reference(Any)", "A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("required", "code", "Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("status", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + public AppointmentParticipantComponent copy() { + AppointmentParticipantComponent dst = new AppointmentParticipantComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.required = required == null ? null : required.copy(); + dst.status = status == null ? null : status.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (actor == null || actor.isEmpty()) + && (required == null || required.isEmpty()) && (status == null || status.isEmpty()); + } + + } + + /** + * This records identifiers associated with this appointment concern 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 item", formalDefinition="This records identifiers associated with this appointment concern 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; + + /** + * The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept). + */ + @Child(name="priority", type={IntegerType.class}, order=0, min=0, max=1) + @Description(shortDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)", formalDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)." ) + protected IntegerType priority; + + /** + * Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + @Child(name="status", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The overall status of the Appointment", formalDefinition="Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." ) + protected CodeType status; + + /** + * The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself). + */ + @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself)", formalDefinition="The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself)." ) + protected CodeableConcept type; + + /** + * The reason that this appointment is being scheduled, this is more clinical than administrative. + */ + @Child(name="reason", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative", formalDefinition="The reason that this appointment is being scheduled, this is more clinical than administrative." ) + protected CodeableConcept reason; + + /** + * The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field", formalDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field." ) + protected StringType description; + + /** + * Date/Time that the appointment is to take place. + */ + @Child(name="start", type={InstantType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Date/Time that the appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) + protected InstantType start; + + /** + * Date/Time that the appointment is to conclude. + */ + @Child(name="end", type={InstantType.class}, order=6, min=1, max=1) + @Description(shortDefinition="Date/Time that the appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) + protected InstantType end; + + /** + * The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot. + */ + @Child(name="slot", type={Slot.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot", formalDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot." ) + protected List slot; + /** + * The actual objects that are the target of the reference (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + protected List slotTarget; + + + /** + * The primary location that this appointment is to take place. + */ + @Child(name="location", type={Location.class}, order=8, min=0, max=1) + @Description(shortDefinition="The primary location that this appointment is to take place", formalDefinition="The primary location that this appointment is to take place." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The primary location that this appointment is to take place.) + */ + protected Location locationTarget; + + /** + * Additional comments about the appointment. + */ + @Child(name="comment", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Additional comments about the appointment", formalDefinition="Additional comments about the appointment." ) + protected StringType comment; + + /** + * An Order that lead to the creation of this appointment. + */ + @Child(name="order", type={Order.class}, order=10, min=0, max=1) + @Description(shortDefinition="An Order that lead to the creation of this appointment", formalDefinition="An Order that lead to the creation of this appointment." ) + protected Reference order; + + /** + * The actual object that is the target of the reference (An Order that lead to the creation of this appointment.) + */ + protected Order orderTarget; + + /** + * List of participants involved in the appointment. + */ + @Child(name="participant", type={}, order=11, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of participants involved in the appointment", formalDefinition="List of participants involved in the appointment." ) + protected List participant; + + /** + * Who recorded the appointment. + */ + @Child(name="lastModifiedBy", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=12, min=0, max=1) + @Description(shortDefinition="Who recorded the appointment", formalDefinition="Who recorded the appointment." ) + protected Reference lastModifiedBy; + + /** + * The actual object that is the target of the reference (Who recorded the appointment.) + */ + protected Resource lastModifiedByTarget; + + /** + * Date when the appointment was recorded. + */ + @Child(name="lastModified", type={DateTimeType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Date when the appointment was recorded", formalDefinition="Date when the appointment was recorded." ) + protected DateTimeType lastModified; + + private static final long serialVersionUID = 897214982L; + + public Appointment() { + super(); + } + + public Appointment(InstantType start, InstantType end) { + super(); + this.start = start; + this.end = end; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment concern 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 appointment concern 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public IntegerType getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new IntegerType(); + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Appointment setPriorityElement(IntegerType value) { + this.priority = value; + return this; + } + + /** + * @return The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept). + */ + public int getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept). + */ + public Appointment setPriority(int value) { + if (value == -1) + this.priority = null; + else { + if (this.priority == null) + this.priority = new IntegerType(); + this.priority.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CodeType getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.status"); + else if (Configuration.doAutoCreate()) + this.status = new CodeType(); + 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} (Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Appointment setStatusElement(CodeType value) { + this.status = value; + return this; + } + + /** + * @return Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + public String getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + */ + public Appointment setStatus(String value) { + if (Utilities.noString(value)) + this.status = null; + else { + if (this.status == null) + this.status = new CodeType(); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).) + */ + public Appointment setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason that this appointment is being scheduled, this is more clinical than administrative.) + */ + public Appointment setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #description} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). 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 Appointment.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} (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Appointment setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + */ + public Appointment setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Appointment setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the appointment is to take place. + */ + 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(Date value) { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Appointment setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the appointment is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the appointment is to conclude. + */ + public Appointment setEnd(Date value) { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public List getSlot() { + if (this.slot == null) + this.slot = new ArrayList(); + return this.slot; + } + + public boolean hasSlot() { + if (this.slot == null) + return false; + for (Reference item : this.slot) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #slot} (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + // syntactic sugar + public Reference addSlot() { //3 + Reference t = new Reference(); + if (this.slot == null) + this.slot = new ArrayList(); + this.slot.add(t); + return t; + } + + /** + * @return {@link #slot} (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 slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public List getSlotTarget() { + if (this.slotTarget == null) + this.slotTarget = new ArrayList(); + return this.slotTarget; + } + + // syntactic sugar + /** + * @return {@link #slot} (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 slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.) + */ + public Slot addSlotTarget() { + Slot r = new Slot(); + if (this.slotTarget == null) + this.slotTarget = new ArrayList(); + this.slotTarget.add(r); + return r; + } + + /** + * @return {@link #location} (The primary location that this appointment is to take place.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The primary location that this appointment is to take place.) + */ + public Appointment setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 primary location that this appointment is to take place.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 primary location that this appointment is to take place.) + */ + public Appointment setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Appointment setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional comments about the appointment. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional comments about the appointment. + */ + public Appointment setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #order} (An Order that lead to the creation of this appointment.) + */ + public Reference getOrder() { + if (this.order == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.order"); + else if (Configuration.doAutoCreate()) + this.order = new Reference(); + return this.order; + } + + public boolean hasOrder() { + return this.order != null && !this.order.isEmpty(); + } + + /** + * @param value {@link #order} (An Order that lead to the creation of this appointment.) + */ + public Appointment setOrder(Reference value) { + this.order = value; + return this; + } + + /** + * @return {@link #order} 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. (An Order that lead to the creation of this appointment.) + */ + public Order getOrderTarget() { + if (this.orderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.order"); + else if (Configuration.doAutoCreate()) + this.orderTarget = new Order(); + return this.orderTarget; + } + + /** + * @param value {@link #order} 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. (An Order that lead to the creation of this appointment.) + */ + public Appointment setOrderTarget(Order value) { + this.orderTarget = value; + return this; + } + + /** + * @return {@link #participant} (List of participants involved in the appointment.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (AppointmentParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (List of participants involved in the appointment.) + */ + // syntactic sugar + public AppointmentParticipantComponent addParticipant() { //3 + AppointmentParticipantComponent t = new AppointmentParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + /** + * @return {@link #lastModifiedBy} (Who recorded the appointment.) + */ + public Reference getLastModifiedBy() { + if (this.lastModifiedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.lastModifiedBy"); + else if (Configuration.doAutoCreate()) + this.lastModifiedBy = new Reference(); + return this.lastModifiedBy; + } + + public boolean hasLastModifiedBy() { + return this.lastModifiedBy != null && !this.lastModifiedBy.isEmpty(); + } + + /** + * @param value {@link #lastModifiedBy} (Who recorded the appointment.) + */ + public Appointment setLastModifiedBy(Reference value) { + this.lastModifiedBy = value; + return this; + } + + /** + * @return {@link #lastModifiedBy} 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. (Who recorded the appointment.) + */ + public Resource getLastModifiedByTarget() { + return this.lastModifiedByTarget; + } + + /** + * @param value {@link #lastModifiedBy} 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. (Who recorded the appointment.) + */ + public Appointment setLastModifiedByTarget(Resource value) { + this.lastModifiedByTarget = value; + return this; + } + + /** + * @return {@link #lastModified} (Date when the appointment was recorded.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public DateTimeType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Appointment.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new DateTimeType(); + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (Date when the appointment was recorded.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public Appointment setLastModifiedElement(DateTimeType value) { + this.lastModified = value; + return this; + } + + /** + * @return Date when the appointment was recorded. + */ + public Date getLastModified() { + return this.lastModified == null ? null : this.lastModified.getValue(); + } + + /** + * @param value Date when the appointment was recorded. + */ + public Appointment setLastModified(Date value) { + if (value == null) + this.lastModified = null; + else { + if (this.lastModified == null) + this.lastModified = new DateTimeType(); + this.lastModified.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern 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("priority", "integer", "The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("status", "code", "Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "The type of appointments that is being booked (ideally this would be an identifiable service - which is at a location, rather than the location itself).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled, this is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("description", "string", "The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("slot", "Reference(Slot)", "The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot.", 0, java.lang.Integer.MAX_VALUE, slot)); + childrenList.add(new Property("location", "Reference(Location)", "The primary location that this appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("order", "Reference(Order)", "An Order that lead to the creation of this appointment.", 0, java.lang.Integer.MAX_VALUE, order)); + childrenList.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("lastModifiedBy", "Reference(Practitioner|Patient|RelatedPerson)", "Who recorded the appointment.", 0, java.lang.Integer.MAX_VALUE, lastModifiedBy)); + childrenList.add(new Property("lastModified", "dateTime", "Date when the appointment was recorded.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + } + + public Appointment copy() { + Appointment dst = new Appointment(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.priority = priority == null ? null : priority.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.description = description == null ? null : description.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + if (slot != null) { + dst.slot = new ArrayList(); + for (Reference i : slot) + dst.slot.add(i.copy()); + }; + dst.location = location == null ? null : location.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.order = order == null ? null : order.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (AppointmentParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.lastModifiedBy = lastModifiedBy == null ? null : lastModifiedBy.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + return dst; + } + + protected Appointment typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (priority == null || priority.isEmpty()) + && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + && (description == null || description.isEmpty()) && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + && (slot == null || slot.isEmpty()) && (location == null || location.isEmpty()) && (comment == null || comment.isEmpty()) + && (order == null || order.isEmpty()) && (participant == null || participant.isEmpty()) && (lastModifiedBy == null || lastModifiedBy.isEmpty()) + && (lastModified == null || lastModified.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Appointment; + } + + @SearchParamDefinition(name="partstatus", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment", type="token" ) + public static final String SP_PARTSTATUS = "partstatus"; + @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="string" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" ) + public static final String SP_DATE = "date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java index 1e8272facc8..6430f672be8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java @@ -20,769 +20,769 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ -@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") -public class AppointmentResponse extends DomainResource { - - public enum Participantstatus implements FhirEnum { - /** - * The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse. - */ - ACCEPTED, - /** - * The appointment participant has declined the appointment. - */ - DECLINED, - /** - * The appointment participant has tentatively accepted the appointment. - */ - TENTATIVE, - /** - * The participant has in-process the appointment. - */ - INPROCESS, - /** - * The participant has completed the appointment. - */ - COMPLETED, - /** - * This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment. - */ - NEEDSACTION, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ACCEPTED; - if ("declined".equals(codeString)) - return DECLINED; - if ("tentative".equals(codeString)) - return TENTATIVE; - if ("in-process".equals(codeString)) - return INPROCESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("needs-action".equals(codeString)) - return NEEDSACTION; - throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case INPROCESS: return "in-process"; - case COMPLETED: return "completed"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACCEPTED: return ""; - case DECLINED: return ""; - case TENTATIVE: return ""; - case INPROCESS: return ""; - case COMPLETED: return ""; - case NEEDSACTION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACCEPTED: return "The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse."; - case DECLINED: return "The appointment participant has declined the appointment."; - case TENTATIVE: return "The appointment participant has tentatively accepted the appointment."; - case INPROCESS: return "The participant has in-process the appointment."; - case COMPLETED: return "The participant has completed the appointment."; - case NEEDSACTION: return "This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case INPROCESS: return "in-process"; - case COMPLETED: return "completed"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - } - - public static class ParticipantstatusEnumFactory implements EnumFactory { - public Participantstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return Participantstatus.ACCEPTED; - if ("declined".equals(codeString)) - return Participantstatus.DECLINED; - if ("tentative".equals(codeString)) - return Participantstatus.TENTATIVE; - if ("in-process".equals(codeString)) - return Participantstatus.INPROCESS; - if ("completed".equals(codeString)) - return Participantstatus.COMPLETED; - if ("needs-action".equals(codeString)) - return Participantstatus.NEEDSACTION; - throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); - } - public String toCode(Participantstatus code) throws IllegalArgumentException { - if (code == Participantstatus.ACCEPTED) - return "accepted"; - if (code == Participantstatus.DECLINED) - return "declined"; - if (code == Participantstatus.TENTATIVE) - return "tentative"; - if (code == Participantstatus.INPROCESS) - return "in-process"; - if (code == Participantstatus.COMPLETED) - return "completed"; - if (code == Participantstatus.NEEDSACTION) - return "needs-action"; - return "?"; - } - } - - /** - * This records identifiers associated with this appointment concern 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 item", formalDefinition="This records identifiers associated with this appointment concern 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; - - /** - * Parent appointment that this response is replying to. - */ - @Child(name="appointment", type={Appointment.class}, order=0, min=1, max=1) - @Description(shortDefinition="Parent appointment that this response is replying to", formalDefinition="Parent appointment that this response is replying to." ) - protected Reference appointment; - - /** - * The actual object that is the target of the reference (Parent appointment that this response is replying to.) - */ - protected Appointment appointmentTarget; - - /** - * Role of participant in the appointment. - */ - @Child(name="participantType", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) - protected List participantType; - - /** - * A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device. - */ - @Child(name="individual", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device", formalDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device." ) - protected List individual; - /** - * The actual objects that are the target of the reference (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - protected List individualTarget; - - - /** - * Participation status of the Patient. - */ - @Child(name="participantStatus", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the Patient." ) - protected Enumeration participantStatus; - - /** - * Additional comments about the appointment. - */ - @Child(name="comment", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Additional comments about the appointment", formalDefinition="Additional comments about the appointment." ) - protected StringType comment; - - /** - * Date/Time that the appointment is to take place. - */ - @Child(name="start", type={InstantType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Date/Time that the appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) - protected InstantType start; - - /** - * Date/Time that the appointment is to conclude. - */ - @Child(name="end", type={InstantType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Date/Time that the appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) - protected InstantType end; - - /** - * Who recorded the appointment response. - */ - @Child(name="lastModifiedBy", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=7, min=0, max=1) - @Description(shortDefinition="Who recorded the appointment response", formalDefinition="Who recorded the appointment response." ) - protected Reference lastModifiedBy; - - /** - * The actual object that is the target of the reference (Who recorded the appointment response.) - */ - protected Resource lastModifiedByTarget; - - /** - * Date when the response was recorded or last updated. - */ - @Child(name="lastModified", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Date when the response was recorded or last updated", formalDefinition="Date when the response was recorded or last updated." ) - protected DateTimeType lastModified; - - private static final long serialVersionUID = 1948503527L; - - public AppointmentResponse() { - super(); - } - - public AppointmentResponse(Reference appointment, Enumeration participantStatus) { - super(); - this.appointment = appointment; - this.participantStatus = participantStatus; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment concern 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 appointment concern 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #appointment} (Parent appointment that this response is replying to.) - */ - public Reference getAppointment() { - if (this.appointment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.appointment"); - else if (Configuration.doAutoCreate()) - this.appointment = new Reference(); - return this.appointment; - } - - public boolean hasAppointment() { - return this.appointment != null && !this.appointment.isEmpty(); - } - - /** - * @param value {@link #appointment} (Parent appointment that this response is replying to.) - */ - public AppointmentResponse setAppointment(Reference value) { - this.appointment = value; - return this; - } - - /** - * @return {@link #appointment} 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. (Parent appointment that this response is replying to.) - */ - public Appointment getAppointmentTarget() { - if (this.appointmentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.appointment"); - else if (Configuration.doAutoCreate()) - this.appointmentTarget = new Appointment(); - return this.appointmentTarget; - } - - /** - * @param value {@link #appointment} 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. (Parent appointment that this response is replying to.) - */ - public AppointmentResponse setAppointmentTarget(Appointment value) { - this.appointmentTarget = value; - return this; - } - - /** - * @return {@link #participantType} (Role of participant in the appointment.) - */ - public List getParticipantType() { - if (this.participantType == null) - this.participantType = new ArrayList(); - return this.participantType; - } - - public boolean hasParticipantType() { - if (this.participantType == null) - return false; - for (CodeableConcept item : this.participantType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participantType} (Role of participant in the appointment.) - */ - // syntactic sugar - public CodeableConcept addParticipantType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.participantType == null) - this.participantType = new ArrayList(); - this.participantType.add(t); - return t; - } - - /** - * @return {@link #individual} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - public List getIndividual() { - if (this.individual == null) - this.individual = new ArrayList(); - return this.individual; - } - - public boolean hasIndividual() { - if (this.individual == null) - return false; - for (Reference item : this.individual) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #individual} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - // syntactic sugar - public Reference addIndividual() { //3 - Reference t = new Reference(); - if (this.individual == null) - this.individual = new ArrayList(); - this.individual.add(t); - return t; - } - - /** - * @return {@link #individual} (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. A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) - */ - public List getIndividualTarget() { - if (this.individualTarget == null) - this.individualTarget = new ArrayList(); - return this.individualTarget; - } - - /** - * @return {@link #participantStatus} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value - */ - public Enumeration getParticipantStatusElement() { - if (this.participantStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.participantStatus"); - else if (Configuration.doAutoCreate()) - this.participantStatus = new Enumeration(); - return this.participantStatus; - } - - public boolean hasParticipantStatusElement() { - return this.participantStatus != null && !this.participantStatus.isEmpty(); - } - - public boolean hasParticipantStatus() { - return this.participantStatus != null && !this.participantStatus.isEmpty(); - } - - /** - * @param value {@link #participantStatus} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value - */ - public AppointmentResponse setParticipantStatusElement(Enumeration value) { - this.participantStatus = value; - return this; - } - - /** - * @return Participation status of the Patient. - */ - public Participantstatus getParticipantStatus() { - return this.participantStatus == null ? null : this.participantStatus.getValue(); - } - - /** - * @param value Participation status of the Patient. - */ - public AppointmentResponse setParticipantStatus(Participantstatus value) { - if (this.participantStatus == null) - this.participantStatus = new Enumeration(Participantstatus.ENUM_FACTORY); - this.participantStatus.setValue(value); - return this; - } - - /** - * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AppointmentResponse setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional comments about the appointment. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional comments about the appointment. - */ - public AppointmentResponse setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public AppointmentResponse setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the appointment is to take place. - */ - 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(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public AppointmentResponse setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the appointment is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the appointment is to conclude. - */ - public AppointmentResponse setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - /** - * @return {@link #lastModifiedBy} (Who recorded the appointment response.) - */ - public Reference getLastModifiedBy() { - if (this.lastModifiedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.lastModifiedBy"); - else if (Configuration.doAutoCreate()) - this.lastModifiedBy = new Reference(); - return this.lastModifiedBy; - } - - public boolean hasLastModifiedBy() { - return this.lastModifiedBy != null && !this.lastModifiedBy.isEmpty(); - } - - /** - * @param value {@link #lastModifiedBy} (Who recorded the appointment response.) - */ - public AppointmentResponse setLastModifiedBy(Reference value) { - this.lastModifiedBy = value; - return this; - } - - /** - * @return {@link #lastModifiedBy} 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. (Who recorded the appointment response.) - */ - public Resource getLastModifiedByTarget() { - return this.lastModifiedByTarget; - } - - /** - * @param value {@link #lastModifiedBy} 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. (Who recorded the appointment response.) - */ - public AppointmentResponse setLastModifiedByTarget(Resource value) { - this.lastModifiedByTarget = value; - return this; - } - - /** - * @return {@link #lastModified} (Date when the response was recorded or last updated.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public DateTimeType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new DateTimeType(); - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (Date when the response was recorded or last updated.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public AppointmentResponse setLastModifiedElement(DateTimeType value) { - this.lastModified = value; - return this; - } - - /** - * @return Date when the response was recorded or last updated. - */ - 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(Date value) { - if (value == null) - this.lastModified = null; - else { - if (this.lastModified == null) - this.lastModified = new DateTimeType(); - this.lastModified.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern 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("appointment", "Reference(Appointment)", "Parent appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment)); - childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType)); - childrenList.add(new Property("individual", "Reference(Any)", "A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.", 0, java.lang.Integer.MAX_VALUE, individual)); - childrenList.add(new Property("participantStatus", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, participantStatus)); - childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("lastModifiedBy", "Reference(Practitioner|Patient|RelatedPerson)", "Who recorded the appointment response.", 0, java.lang.Integer.MAX_VALUE, lastModifiedBy)); - childrenList.add(new Property("lastModified", "dateTime", "Date when the response was recorded or last updated.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - } - - public AppointmentResponse copy() { - AppointmentResponse dst = new AppointmentResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.appointment = appointment == null ? null : appointment.copy(); - if (participantType != null) { - dst.participantType = new ArrayList(); - for (CodeableConcept i : participantType) - dst.participantType.add(i.copy()); - }; - if (individual != null) { - dst.individual = new ArrayList(); - for (Reference i : individual) - dst.individual.add(i.copy()); - }; - dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.lastModifiedBy = lastModifiedBy == null ? null : lastModifiedBy.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - return dst; - } - - protected AppointmentResponse typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty()) - && (participantType == null || participantType.isEmpty()) && (individual == null || individual.isEmpty()) - && (participantStatus == null || participantStatus.isEmpty()) && (comment == null || comment.isEmpty()) - && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (lastModifiedBy == null || lastModifiedBy.isEmpty()) - && (lastModified == null || lastModified.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AppointmentResponse; - } - - @SearchParamDefinition(name="partstatus", path="AppointmentResponse.participantStatus", description="The overall status of the appointment", type="token" ) - public static final String SP_PARTSTATUS = "partstatus"; - @SearchParamDefinition(name="subject", path="AppointmentResponse.individual", description="The subject that the appointment response replies for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" ) - public static final String SP_APPOINTMENT = "appointment"; - -} - + +/* + 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; +/** + * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + */ +@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") +public class AppointmentResponse extends DomainResource { + + public enum Participantstatus implements FhirEnum { + /** + * The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse. + */ + ACCEPTED, + /** + * The appointment participant has declined the appointment. + */ + DECLINED, + /** + * The appointment participant has tentatively accepted the appointment. + */ + TENTATIVE, + /** + * The participant has in-process the appointment. + */ + INPROCESS, + /** + * The participant has completed the appointment. + */ + COMPLETED, + /** + * This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment. + */ + NEEDSACTION, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ACCEPTED; + if ("declined".equals(codeString)) + return DECLINED; + if ("tentative".equals(codeString)) + return TENTATIVE; + if ("in-process".equals(codeString)) + return INPROCESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("needs-action".equals(codeString)) + return NEEDSACTION; + throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case INPROCESS: return "in-process"; + case COMPLETED: return "completed"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACCEPTED: return ""; + case DECLINED: return ""; + case TENTATIVE: return ""; + case INPROCESS: return ""; + case COMPLETED: return ""; + case NEEDSACTION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACCEPTED: return "The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse."; + case DECLINED: return "The appointment participant has declined the appointment."; + case TENTATIVE: return "The appointment participant has tentatively accepted the appointment."; + case INPROCESS: return "The participant has in-process the appointment."; + case COMPLETED: return "The participant has completed the appointment."; + case NEEDSACTION: return "This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACCEPTED: return "accepted"; + case DECLINED: return "declined"; + case TENTATIVE: return "tentative"; + case INPROCESS: return "in-process"; + case COMPLETED: return "completed"; + case NEEDSACTION: return "needs-action"; + default: return "?"; + } + } + } + + public static class ParticipantstatusEnumFactory implements EnumFactory { + public Participantstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("accepted".equals(codeString)) + return Participantstatus.ACCEPTED; + if ("declined".equals(codeString)) + return Participantstatus.DECLINED; + if ("tentative".equals(codeString)) + return Participantstatus.TENTATIVE; + if ("in-process".equals(codeString)) + return Participantstatus.INPROCESS; + if ("completed".equals(codeString)) + return Participantstatus.COMPLETED; + if ("needs-action".equals(codeString)) + return Participantstatus.NEEDSACTION; + throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); + } + public String toCode(Participantstatus code) throws IllegalArgumentException { + if (code == Participantstatus.ACCEPTED) + return "accepted"; + if (code == Participantstatus.DECLINED) + return "declined"; + if (code == Participantstatus.TENTATIVE) + return "tentative"; + if (code == Participantstatus.INPROCESS) + return "in-process"; + if (code == Participantstatus.COMPLETED) + return "completed"; + if (code == Participantstatus.NEEDSACTION) + return "needs-action"; + return "?"; + } + } + + /** + * This records identifiers associated with this appointment concern 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 item", formalDefinition="This records identifiers associated with this appointment concern 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; + + /** + * Parent appointment that this response is replying to. + */ + @Child(name="appointment", type={Appointment.class}, order=0, min=1, max=1) + @Description(shortDefinition="Parent appointment that this response is replying to", formalDefinition="Parent appointment that this response is replying to." ) + protected Reference appointment; + + /** + * The actual object that is the target of the reference (Parent appointment that this response is replying to.) + */ + protected Appointment appointmentTarget; + + /** + * Role of participant in the appointment. + */ + @Child(name="participantType", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) + protected List participantType; + + /** + * A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device. + */ + @Child(name="individual", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device", formalDefinition="A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device." ) + protected List individual; + /** + * The actual objects that are the target of the reference (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + protected List individualTarget; + + + /** + * Participation status of the Patient. + */ + @Child(name="participantStatus", type={CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the Patient." ) + protected Enumeration participantStatus; + + /** + * Additional comments about the appointment. + */ + @Child(name="comment", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Additional comments about the appointment", formalDefinition="Additional comments about the appointment." ) + protected StringType comment; + + /** + * Date/Time that the appointment is to take place. + */ + @Child(name="start", type={InstantType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Date/Time that the appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) + protected InstantType start; + + /** + * Date/Time that the appointment is to conclude. + */ + @Child(name="end", type={InstantType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date/Time that the appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) + protected InstantType end; + + /** + * Who recorded the appointment response. + */ + @Child(name="lastModifiedBy", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=7, min=0, max=1) + @Description(shortDefinition="Who recorded the appointment response", formalDefinition="Who recorded the appointment response." ) + protected Reference lastModifiedBy; + + /** + * The actual object that is the target of the reference (Who recorded the appointment response.) + */ + protected Resource lastModifiedByTarget; + + /** + * Date when the response was recorded or last updated. + */ + @Child(name="lastModified", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Date when the response was recorded or last updated", formalDefinition="Date when the response was recorded or last updated." ) + protected DateTimeType lastModified; + + private static final long serialVersionUID = 1948503527L; + + public AppointmentResponse() { + super(); + } + + public AppointmentResponse(Reference appointment, Enumeration participantStatus) { + super(); + this.appointment = appointment; + this.participantStatus = participantStatus; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this appointment concern 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 appointment concern 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #appointment} (Parent appointment that this response is replying to.) + */ + public Reference getAppointment() { + if (this.appointment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.appointment"); + else if (Configuration.doAutoCreate()) + this.appointment = new Reference(); + return this.appointment; + } + + public boolean hasAppointment() { + return this.appointment != null && !this.appointment.isEmpty(); + } + + /** + * @param value {@link #appointment} (Parent appointment that this response is replying to.) + */ + public AppointmentResponse setAppointment(Reference value) { + this.appointment = value; + return this; + } + + /** + * @return {@link #appointment} 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. (Parent appointment that this response is replying to.) + */ + public Appointment getAppointmentTarget() { + if (this.appointmentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.appointment"); + else if (Configuration.doAutoCreate()) + this.appointmentTarget = new Appointment(); + return this.appointmentTarget; + } + + /** + * @param value {@link #appointment} 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. (Parent appointment that this response is replying to.) + */ + public AppointmentResponse setAppointmentTarget(Appointment value) { + this.appointmentTarget = value; + return this; + } + + /** + * @return {@link #participantType} (Role of participant in the appointment.) + */ + public List getParticipantType() { + if (this.participantType == null) + this.participantType = new ArrayList(); + return this.participantType; + } + + public boolean hasParticipantType() { + if (this.participantType == null) + return false; + for (CodeableConcept item : this.participantType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participantType} (Role of participant in the appointment.) + */ + // syntactic sugar + public CodeableConcept addParticipantType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.participantType == null) + this.participantType = new ArrayList(); + this.participantType.add(t); + return t; + } + + /** + * @return {@link #individual} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + public List getIndividual() { + if (this.individual == null) + this.individual = new ArrayList(); + return this.individual; + } + + public boolean hasIndividual() { + if (this.individual == null) + return false; + for (Reference item : this.individual) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #individual} (A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + // syntactic sugar + public Reference addIndividual() { //3 + Reference t = new Reference(); + if (this.individual == null) + this.individual = new ArrayList(); + this.individual.add(t); + return t; + } + + /** + * @return {@link #individual} (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. A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.) + */ + public List getIndividualTarget() { + if (this.individualTarget == null) + this.individualTarget = new ArrayList(); + return this.individualTarget; + } + + /** + * @return {@link #participantStatus} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value + */ + public Enumeration getParticipantStatusElement() { + if (this.participantStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.participantStatus"); + else if (Configuration.doAutoCreate()) + this.participantStatus = new Enumeration(); + return this.participantStatus; + } + + public boolean hasParticipantStatusElement() { + return this.participantStatus != null && !this.participantStatus.isEmpty(); + } + + public boolean hasParticipantStatus() { + return this.participantStatus != null && !this.participantStatus.isEmpty(); + } + + /** + * @param value {@link #participantStatus} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value + */ + public AppointmentResponse setParticipantStatusElement(Enumeration value) { + this.participantStatus = value; + return this; + } + + /** + * @return Participation status of the Patient. + */ + public Participantstatus getParticipantStatus() { + return this.participantStatus == null ? null : this.participantStatus.getValue(); + } + + /** + * @param value Participation status of the Patient. + */ + public AppointmentResponse setParticipantStatus(Participantstatus value) { + if (this.participantStatus == null) + this.participantStatus = new Enumeration(Participantstatus.ENUM_FACTORY); + this.participantStatus.setValue(value); + return this; + } + + /** + * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public AppointmentResponse setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional comments about the appointment. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional comments about the appointment. + */ + public AppointmentResponse setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public AppointmentResponse setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the appointment is to take place. + */ + 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(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public AppointmentResponse setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the appointment is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the appointment is to conclude. + */ + public AppointmentResponse setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + /** + * @return {@link #lastModifiedBy} (Who recorded the appointment response.) + */ + public Reference getLastModifiedBy() { + if (this.lastModifiedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.lastModifiedBy"); + else if (Configuration.doAutoCreate()) + this.lastModifiedBy = new Reference(); + return this.lastModifiedBy; + } + + public boolean hasLastModifiedBy() { + return this.lastModifiedBy != null && !this.lastModifiedBy.isEmpty(); + } + + /** + * @param value {@link #lastModifiedBy} (Who recorded the appointment response.) + */ + public AppointmentResponse setLastModifiedBy(Reference value) { + this.lastModifiedBy = value; + return this; + } + + /** + * @return {@link #lastModifiedBy} 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. (Who recorded the appointment response.) + */ + public Resource getLastModifiedByTarget() { + return this.lastModifiedByTarget; + } + + /** + * @param value {@link #lastModifiedBy} 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. (Who recorded the appointment response.) + */ + public AppointmentResponse setLastModifiedByTarget(Resource value) { + this.lastModifiedByTarget = value; + return this; + } + + /** + * @return {@link #lastModified} (Date when the response was recorded or last updated.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public DateTimeType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AppointmentResponse.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new DateTimeType(); + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (Date when the response was recorded or last updated.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public AppointmentResponse setLastModifiedElement(DateTimeType value) { + this.lastModified = value; + return this; + } + + /** + * @return Date when the response was recorded or last updated. + */ + 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(Date value) { + if (value == null) + this.lastModified = null; + else { + if (this.lastModified == null) + this.lastModified = new DateTimeType(); + this.lastModified.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern 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("appointment", "Reference(Appointment)", "Parent appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment)); + childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType)); + childrenList.add(new Property("individual", "Reference(Any)", "A Person of device that is participating in the appointment, usually Practitioner, Patient, RelatedPerson or Device.", 0, java.lang.Integer.MAX_VALUE, individual)); + childrenList.add(new Property("participantStatus", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, participantStatus)); + childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("lastModifiedBy", "Reference(Practitioner|Patient|RelatedPerson)", "Who recorded the appointment response.", 0, java.lang.Integer.MAX_VALUE, lastModifiedBy)); + childrenList.add(new Property("lastModified", "dateTime", "Date when the response was recorded or last updated.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + } + + public AppointmentResponse copy() { + AppointmentResponse dst = new AppointmentResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.appointment = appointment == null ? null : appointment.copy(); + if (participantType != null) { + dst.participantType = new ArrayList(); + for (CodeableConcept i : participantType) + dst.participantType.add(i.copy()); + }; + if (individual != null) { + dst.individual = new ArrayList(); + for (Reference i : individual) + dst.individual.add(i.copy()); + }; + dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.lastModifiedBy = lastModifiedBy == null ? null : lastModifiedBy.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + return dst; + } + + protected AppointmentResponse typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty()) + && (participantType == null || participantType.isEmpty()) && (individual == null || individual.isEmpty()) + && (participantStatus == null || participantStatus.isEmpty()) && (comment == null || comment.isEmpty()) + && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (lastModifiedBy == null || lastModifiedBy.isEmpty()) + && (lastModified == null || lastModified.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.AppointmentResponse; + } + + @SearchParamDefinition(name="partstatus", path="AppointmentResponse.participantStatus", description="The overall status of the appointment", type="token" ) + public static final String SP_PARTSTATUS = "partstatus"; + @SearchParamDefinition(name="subject", path="AppointmentResponse.individual", description="The subject that the appointment response replies for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" ) + public static final String SP_APPOINTMENT = "appointment"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java index 0dc8594611e..c4935b570b7 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java @@ -20,482 +20,482 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * For referring to data content defined in other formats. - */ -@DatatypeDef(name="Attachment") -public class Attachment extends Type implements ICompositeType{ - - /** - * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - @Child(name="contentType", type={CodeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) - protected CodeType contentType; - - /** - * The human language of the content. The value can be any valid value according to BCP 47. - */ - @Child(name="language", type={CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) - protected CodeType language; - - /** - * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - @Child(name="data", type={Base64BinaryType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) - protected Base64BinaryType data; - - /** - * An alternative location where the data can be accessed. - */ - @Child(name="url", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) - protected UriType url; - - /** - * The number of bytes of data that make up this attachment. - */ - @Child(name="size", type={IntegerType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) - protected IntegerType size; - - /** - * The calculated hash of the data using SHA-1. Represented using base64. - */ - @Child(name="hash", type={Base64BinaryType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) - protected Base64BinaryType hash; - - /** - * A label or set of text to display in place of the data. - */ - @Child(name="title", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) - protected StringType title; - - private static final long serialVersionUID = 483430116L; - - public Attachment() { - super(); - } - - /** - * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Attachment setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public Attachment setContentType(String value) { - if (Utilities.noString(value)) - this.contentType = null; - else { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - } - return this; - } - - /** - * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public Attachment setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The human language of the content. The value can be any valid value according to BCP 47. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The human language of the content. The value can be any valid value according to BCP 47. - */ - public Attachment setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public Base64BinaryType getDataElement() { - if (this.data == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.data"); - else if (Configuration.doAutoCreate()) - this.data = new Base64BinaryType(); - return this.data; - } - - public boolean hasDataElement() { - return this.data != null && !this.data.isEmpty(); - } - - public boolean hasData() { - return this.data != null && !this.data.isEmpty(); - } - - /** - * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public Attachment setDataElement(Base64BinaryType value) { - this.data = value; - return this; - } - - /** - * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - public byte[] getData() { - return this.data == null ? null : this.data.getValue(); - } - - /** - * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - public Attachment setData(byte[] value) { - if (value == null) - this.data = null; - else { - if (this.data == null) - this.data = new Base64BinaryType(); - this.data.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Attachment setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An alternative location where the data can be accessed. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An alternative location where the data can be accessed. - */ - public Attachment setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public IntegerType getSizeElement() { - if (this.size == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.size"); - else if (Configuration.doAutoCreate()) - this.size = new IntegerType(); - return this.size; - } - - public boolean hasSizeElement() { - return this.size != null && !this.size.isEmpty(); - } - - public boolean hasSize() { - return this.size != null && !this.size.isEmpty(); - } - - /** - * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public Attachment setSizeElement(IntegerType value) { - this.size = value; - return this; - } - - /** - * @return The number of bytes of data that make up this attachment. - */ - public int getSize() { - return this.size == null ? null : this.size.getValue(); - } - - /** - * @param value The number of bytes of data that make up this attachment. - */ - public Attachment setSize(int value) { - if (value == -1) - this.size = null; - else { - if (this.size == null) - this.size = new IntegerType(); - this.size.setValue(value); - } - return this; - } - - /** - * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Base64BinaryType getHashElement() { - if (this.hash == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.hash"); - else if (Configuration.doAutoCreate()) - this.hash = new Base64BinaryType(); - return this.hash; - } - - public boolean hasHashElement() { - return this.hash != null && !this.hash.isEmpty(); - } - - public boolean hasHash() { - return this.hash != null && !this.hash.isEmpty(); - } - - /** - * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Attachment setHashElement(Base64BinaryType value) { - this.hash = value; - return this; - } - - /** - * @return The calculated hash of the data using SHA-1. Represented using base64. - */ - public byte[] getHash() { - return this.hash == null ? null : this.hash.getValue(); - } - - /** - * @param value The calculated hash of the data using SHA-1. Represented using base64. - */ - public Attachment setHash(byte[] value) { - if (value == null) - this.hash = null; - else { - if (this.hash == null) - this.hash = new Base64BinaryType(); - this.hash.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Attachment setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A label or set of text to display in place of the data. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A label or set of text to display in place of the data. - */ - public Attachment setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); - childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("size", "integer", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); - childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); - childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); - } - - public Attachment copy() { - Attachment dst = new Attachment(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.language = language == null ? null : language.copy(); - dst.data = data == null ? null : data.copy(); - dst.url = url == null ? null : url.copy(); - dst.size = size == null ? null : size.copy(); - dst.hash = hash == null ? null : hash.copy(); - dst.title = title == null ? null : title.copy(); - return dst; - } - - protected Attachment typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) - && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) - && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()); - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * For referring to data content defined in other formats. + */ +@DatatypeDef(name="Attachment") +public class Attachment extends Type implements ICompositeType{ + + /** + * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + @Child(name="contentType", type={CodeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) + protected CodeType contentType; + + /** + * The human language of the content. The value can be any valid value according to BCP 47. + */ + @Child(name="language", type={CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) + protected CodeType language; + + /** + * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + @Child(name="data", type={Base64BinaryType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) + protected Base64BinaryType data; + + /** + * An alternative location where the data can be accessed. + */ + @Child(name="url", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) + protected UriType url; + + /** + * The number of bytes of data that make up this attachment. + */ + @Child(name="size", type={IntegerType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) + protected IntegerType size; + + /** + * The calculated hash of the data using SHA-1. Represented using base64. + */ + @Child(name="hash", type={Base64BinaryType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Hash of the data (sha-1, base64ed )", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) + protected Base64BinaryType hash; + + /** + * A label or set of text to display in place of the data. + */ + @Child(name="title", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) + protected StringType title; + + private static final long serialVersionUID = 483430116L; + + public Attachment() { + super(); + } + + /** + * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Attachment setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + */ + public Attachment setContentType(String value) { + if (Utilities.noString(value)) + this.contentType = null; + else { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + } + return this; + } + + /** + * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public Attachment setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The human language of the content. The value can be any valid value according to BCP 47. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The human language of the content. The value can be any valid value according to BCP 47. + */ + public Attachment setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public Base64BinaryType getDataElement() { + if (this.data == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.data"); + else if (Configuration.doAutoCreate()) + this.data = new Base64BinaryType(); + return this.data; + } + + public boolean hasDataElement() { + return this.data != null && !this.data.isEmpty(); + } + + public boolean hasData() { + return this.data != null && !this.data.isEmpty(); + } + + /** + * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public Attachment setDataElement(Base64BinaryType value) { + this.data = value; + return this; + } + + /** + * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + public byte[] getData() { + return this.data == null ? null : this.data.getValue(); + } + + /** + * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + */ + public Attachment setData(byte[] value) { + if (value == null) + this.data = null; + else { + if (this.data == null) + this.data = new Base64BinaryType(); + this.data.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Attachment setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return An alternative location where the data can be accessed. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value An alternative location where the data can be accessed. + */ + public Attachment setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public IntegerType getSizeElement() { + if (this.size == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.size"); + else if (Configuration.doAutoCreate()) + this.size = new IntegerType(); + return this.size; + } + + public boolean hasSizeElement() { + return this.size != null && !this.size.isEmpty(); + } + + public boolean hasSize() { + return this.size != null && !this.size.isEmpty(); + } + + /** + * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public Attachment setSizeElement(IntegerType value) { + this.size = value; + return this; + } + + /** + * @return The number of bytes of data that make up this attachment. + */ + public int getSize() { + return this.size == null ? null : this.size.getValue(); + } + + /** + * @param value The number of bytes of data that make up this attachment. + */ + public Attachment setSize(int value) { + if (value == -1) + this.size = null; + else { + if (this.size == null) + this.size = new IntegerType(); + this.size.setValue(value); + } + return this; + } + + /** + * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Base64BinaryType getHashElement() { + if (this.hash == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.hash"); + else if (Configuration.doAutoCreate()) + this.hash = new Base64BinaryType(); + return this.hash; + } + + public boolean hasHashElement() { + return this.hash != null && !this.hash.isEmpty(); + } + + public boolean hasHash() { + return this.hash != null && !this.hash.isEmpty(); + } + + /** + * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Attachment setHashElement(Base64BinaryType value) { + this.hash = value; + return this; + } + + /** + * @return The calculated hash of the data using SHA-1. Represented using base64. + */ + public byte[] getHash() { + return this.hash == null ? null : this.hash.getValue(); + } + + /** + * @param value The calculated hash of the data using SHA-1. Represented using base64. + */ + public Attachment setHash(byte[] value) { + if (value == null) + this.hash = null; + else { + if (this.hash == null) + this.hash = new Base64BinaryType(); + this.hash.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Attachment.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Attachment setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A label or set of text to display in place of the data. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A label or set of text to display in place of the data. + */ + public Attachment setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); + childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("size", "integer", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); + childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); + childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); + } + + public Attachment copy() { + Attachment dst = new Attachment(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.language = language == null ? null : language.copy(); + dst.data = data == null ? null : data.copy(); + dst.url = url == null ? null : url.copy(); + dst.size = size == null ? null : size.copy(); + dst.hash = hash == null ? null : hash.copy(); + dst.title = title == null ? null : title.copy(); + return dst; + } + + protected Attachment typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) + && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) + && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java index de61690e5c3..ff753daf871 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java @@ -20,383 +20,383 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * (informative) A container for slot(s) of time that may be available for booking appointments. - */ -@ResourceDef(name="Availability", profile="http://hl7.org/fhir/Profile/Availability") -public class Availability extends DomainResource { - - /** - * External Ids for this item. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * The schedule type can be used for the categorization of healthcare services or other appointment types. - */ - @Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types", formalDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types." ) - protected List type; - - /** - * The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. - */ - @Child(name="actor", type={}, order=1, min=1, max=1) - @Description(shortDefinition="The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson", formalDefinition="The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - protected Resource actorTarget; - - /** - * The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. - */ - @Child(name="planningHorizon", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates", formalDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates." ) - protected Period planningHorizon; - - /** - * Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - @Child(name="comment", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." ) - protected StringType comment; - - /** - * When this availability was created, or last revised. - */ - @Child(name="lastModified", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="When this availability was created, or last revised", formalDefinition="When this availability was created, or last revised." ) - protected DateTimeType lastModified; - - private static final long serialVersionUID = -461457234L; - - public Availability() { - super(); - } - - public Availability(Reference actor) { - super(); - this.actor = actor; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #actor} (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Availability.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Availability setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} 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 resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} 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 resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Availability setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #planningHorizon} (The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) - */ - public Period getPlanningHorizon() { - if (this.planningHorizon == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Availability.planningHorizon"); - else if (Configuration.doAutoCreate()) - this.planningHorizon = new Period(); - return this.planningHorizon; - } - - public boolean hasPlanningHorizon() { - return this.planningHorizon != null && !this.planningHorizon.isEmpty(); - } - - /** - * @param value {@link #planningHorizon} (The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) - */ - public Availability setPlanningHorizon(Period value) { - this.planningHorizon = value; - return this; - } - - /** - * @return {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Availability.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Availability setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - public Availability setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #lastModified} (When this availability was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public DateTimeType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Availability.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new DateTimeType(); - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (When this availability was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public Availability setLastModifiedElement(DateTimeType value) { - this.lastModified = value; - return this; - } - - /** - * @return When this availability was created, or last revised. - */ - public Date getLastModified() { - return this.lastModified == null ? null : this.lastModified.getValue(); - } - - /** - * @param value When this availability was created, or last revised. - */ - public Availability setLastModified(Date value) { - if (value == null) - this.lastModified = null; - else { - if (this.lastModified == null) - this.lastModified = new DateTimeType(); - this.lastModified.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "The schedule type can be used for the categorization of healthcare services or other appointment types.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actor", "Reference(Any)", "The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("planningHorizon", "Period", "The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates.", 0, java.lang.Integer.MAX_VALUE, planningHorizon)); - childrenList.add(new Property("comment", "string", "Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("lastModified", "dateTime", "When this availability was created, or last revised.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - } - - public Availability copy() { - Availability dst = new Availability(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.planningHorizon = planningHorizon == null ? null : planningHorizon.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - return dst; - } - - protected Availability typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty()) - && (comment == null || comment.isEmpty()) && (lastModified == null || lastModified.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Availability; - } - - @SearchParamDefinition(name="actor", path="Availability.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find an availability for", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="date", path="Availability.planningHorizon", description="Search for availability resources that have a period that contains this date specified", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="Availability.type", description="The type of appointments that can be booked into associated slot(s)", type="token" ) - public static final String SP_TYPE = "type"; - -} - + +/* + 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; +/** + * (informative) A container for slot(s) of time that may be available for booking appointments. + */ +@ResourceDef(name="Availability", profile="http://hl7.org/fhir/Profile/Availability") +public class Availability extends DomainResource { + + /** + * External Ids for this item. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * The schedule type can be used for the categorization of healthcare services or other appointment types. + */ + @Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types", formalDefinition="The schedule type can be used for the categorization of healthcare services or other appointment types." ) + protected List type; + + /** + * The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. + */ + @Child(name="actor", type={}, order=1, min=1, max=1) + @Description(shortDefinition="The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson", formalDefinition="The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + protected Resource actorTarget; + + /** + * The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. + */ + @Child(name="planningHorizon", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates", formalDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates." ) + protected Period planningHorizon; + + /** + * Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + @Child(name="comment", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." ) + protected StringType comment; + + /** + * When this availability was created, or last revised. + */ + @Child(name="lastModified", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="When this availability was created, or last revised", formalDefinition="When this availability was created, or last revised." ) + protected DateTimeType lastModified; + + private static final long serialVersionUID = -461457234L; + + public Availability() { + super(); + } + + public Availability(Reference actor) { + super(); + this.actor = actor; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The schedule type can be used for the categorization of healthcare services or other appointment types.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #actor} (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Availability.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Availability setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} 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 resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} 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 resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) + */ + public Availability setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + /** + * @return {@link #planningHorizon} (The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) + */ + public Period getPlanningHorizon() { + if (this.planningHorizon == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Availability.planningHorizon"); + else if (Configuration.doAutoCreate()) + this.planningHorizon = new Period(); + return this.planningHorizon; + } + + public boolean hasPlanningHorizon() { + return this.planningHorizon != null && !this.planningHorizon.isEmpty(); + } + + /** + * @param value {@link #planningHorizon} (The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) + */ + public Availability setPlanningHorizon(Period value) { + this.planningHorizon = value; + return this; + } + + /** + * @return {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Availability.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Availability setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + */ + public Availability setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #lastModified} (When this availability was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public DateTimeType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Availability.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new DateTimeType(); + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (When this availability was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public Availability setLastModifiedElement(DateTimeType value) { + this.lastModified = value; + return this; + } + + /** + * @return When this availability was created, or last revised. + */ + public Date getLastModified() { + return this.lastModified == null ? null : this.lastModified.getValue(); + } + + /** + * @param value When this availability was created, or last revised. + */ + public Availability setLastModified(Date value) { + if (value == null) + this.lastModified = null; + else { + if (this.lastModified == null) + this.lastModified = new DateTimeType(); + this.lastModified.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "The schedule type can be used for the categorization of healthcare services or other appointment types.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actor", "Reference(Any)", "The resource this availability resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.", 0, java.lang.Integer.MAX_VALUE, actor)); + childrenList.add(new Property("planningHorizon", "Period", "The period of time that the slots that are attached to this availability resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a 'template' for planning outside these dates.", 0, java.lang.Integer.MAX_VALUE, planningHorizon)); + childrenList.add(new Property("comment", "string", "Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("lastModified", "dateTime", "When this availability was created, or last revised.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + } + + public Availability copy() { + Availability dst = new Availability(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.actor = actor == null ? null : actor.copy(); + dst.planningHorizon = planningHorizon == null ? null : planningHorizon.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + return dst; + } + + protected Availability typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty()) + && (comment == null || comment.isEmpty()) && (lastModified == null || lastModified.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Availability; + } + + @SearchParamDefinition(name="actor", path="Availability.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find an availability for", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="date", path="Availability.planningHorizon", description="Search for availability resources that have a period that contains this date specified", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="type", path="Availability.type", description="The type of appointments that can be booked into associated slot(s)", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java index bdfb73cb145..5c83834c9e0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java @@ -20,110 +20,110 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ -@DatatypeDef(name="BackboneElement") -public abstract class BackboneElement extends Element { - - /** - * May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. - */ - @Child(name="modifierExtension", type={Extension.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) - protected List modifierExtension; - - private static final long serialVersionUID = -1431673179L; - - public BackboneElement() { - super(); - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - public List getModifierExtension() { - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - return this.modifierExtension; - } - - public boolean hasModifierExtension() { - if (this.modifierExtension == null) - return false; - for (Extension item : this.modifierExtension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - // syntactic sugar - public Extension addModifierExtension() { //3 - Extension t = new Extension(); - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return t; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); - } - - public abstract BackboneElement copy(); - - public void copyValues(BackboneElement dst) { - if (modifierExtension != null) { - dst.modifierExtension = new ArrayList(); - for (Extension i : modifierExtension) - dst.modifierExtension.add(i.copy()); - }; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty()); - } - - -} - + +/* + 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.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * Base definition for all elements that are defined inside a resource - but not those in a data type. + */ +@DatatypeDef(name="BackboneElement") +public abstract class BackboneElement extends Element { + + /** + * May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + */ + @Child(name="modifierExtension", type={Extension.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) + protected List modifierExtension; + + private static final long serialVersionUID = -1431673179L; + + public BackboneElement() { + super(); + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + public List getModifierExtension() { + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + return this.modifierExtension; + } + + public boolean hasModifierExtension() { + if (this.modifierExtension == null) + return false; + for (Extension item : this.modifierExtension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + // syntactic sugar + public Extension addModifierExtension() { //3 + Extension t = new Extension(); + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return t; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); + } + + public abstract BackboneElement copy(); + + public void copyValues(BackboneElement dst) { + if (modifierExtension != null) { + dst.modifierExtension = new ArrayList(); + for (Extension i : modifierExtension) + dst.modifierExtension.add(i.copy()); + }; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base.java index 8f75d302e8c..86abeae0415 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base.java @@ -20,86 +20,86 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public abstract class Base implements Serializable, IBase { - - /** - * User appended data items - allow users to add extra information to the class - */ -private Map userData; - - /** - * Round tracking xml comments for testing convenience - */ - private List formatComments; - - - public Object getUserData(String name) { - if (userData == null) - return null; - return userData.get(name); - } - - public void setUserData(String name, Object value) { - if (userData == null) - userData = new HashMap(); - userData.put(name, value); - } - - public boolean hasFormatComment() { - return (formatComments != null && !formatComments.isEmpty()); - } - - public List getFormatComments() { - if (formatComments == null) - formatComments = new ArrayList(); - return formatComments; - } - - protected abstract void listChildren(List result) ; - - /** - * Supports iterating the children elements in some generic processor or browser - * All defined children will be listed, even if they have no value on this instance - * - * Note that the actual content of primitive or xhtml elements is not iterated explicitly. - * To find these, the processing code must recognise the element as a primitive, typecast - * the value to a {@link Type}, and examine the value - * - * @return a list of all the children defined for this element - */ - public List children() { - List result = new ArrayList(); - listChildren(result); - return result; - } - - public Property getChildByName(String name) { - List children = new ArrayList(); - listChildren(children); - for (Property c : children) - if (c.getName().equals(name)) - return c; - return null; - } - - public List listChildrenByName(String name) { - List children = new ArrayList(); - listChildren(children); - for (Property c : children) - if (c.getName().equals(name) || (c.getName().endsWith("[x]") && name.startsWith(c.getName()))) - return c.values; - return new ArrayList(); - } - - public boolean isEmpty() { - return true; // userData does not count - } - -} + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public abstract class Base implements Serializable, IBase { + + /** + * User appended data items - allow users to add extra information to the class + */ +private Map userData; + + /** + * Round tracking xml comments for testing convenience + */ + private List formatComments; + + + public Object getUserData(String name) { + if (userData == null) + return null; + return userData.get(name); + } + + public void setUserData(String name, Object value) { + if (userData == null) + userData = new HashMap(); + userData.put(name, value); + } + + public boolean hasFormatComment() { + return (formatComments != null && !formatComments.isEmpty()); + } + + public List getFormatComments() { + if (formatComments == null) + formatComments = new ArrayList(); + return formatComments; + } + + protected abstract void listChildren(List result) ; + + /** + * Supports iterating the children elements in some generic processor or browser + * All defined children will be listed, even if they have no value on this instance + * + * Note that the actual content of primitive or xhtml elements is not iterated explicitly. + * To find these, the processing code must recognise the element as a primitive, typecast + * the value to a {@link Type}, and examine the value + * + * @return a list of all the children defined for this element + */ + public List children() { + List result = new ArrayList(); + listChildren(result); + return result; + } + + public Property getChildByName(String name) { + List children = new ArrayList(); + listChildren(children); + for (Property c : children) + if (c.getName().equals(name)) + return c; + return null; + } + + public List listChildrenByName(String name) { + List children = new ArrayList(); + listChildren(children); + for (Property c : children) + if (c.getName().equals(name) || (c.getName().endsWith("[x]") && name.startsWith(c.getName()))) + return c.values; + return new ArrayList(); + } + + public boolean isEmpty() { + return true; // userData does not count + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java index b0c138c0d69..5c980b73300 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java @@ -1,31 +1,31 @@ -/* -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. - - */ +/* +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. + + */ package org.hl7.fhir.instance.model; /* @@ -48,49 +48,49 @@ package org.hl7.fhir.instance.model; * #L% */ - -import org.apache.commons.codec.binary.Base64; - -/** - * Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64 - */ -public class Base64BinaryType extends PrimitiveType { - - private static final long serialVersionUID = 2L; - - /** - * Constructor - */ - public Base64BinaryType() { - super(); - } - - /** - * Constructor - */ - public Base64BinaryType(byte[] theBytes) { - setValue(theBytes); - } - - /** - * Constructor - */ - public Base64BinaryType(String theValue) { - setValueAsString(theValue); - } - - @Override - protected byte[] parse(String theValue) { - return Base64.decodeBase64(theValue); - } - - @Override - protected String encode(byte[] theValue) { - return Base64.encodeBase64String(theValue); - } - - @Override - public Base64BinaryType copy() { - return new Base64BinaryType(getValue()); - } -} + +import org.apache.commons.codec.binary.Base64; + +/** + * Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64 + */ +public class Base64BinaryType extends PrimitiveType { + + private static final long serialVersionUID = 2L; + + /** + * Constructor + */ + public Base64BinaryType() { + super(); + } + + /** + * Constructor + */ + public Base64BinaryType(byte[] theBytes) { + setValue(theBytes); + } + + /** + * Constructor + */ + public Base64BinaryType(String theValue) { + setValueAsString(theValue); + } + + @Override + protected byte[] parse(String theValue) { + return Base64.decodeBase64(theValue); + } + + @Override + protected String encode(byte[] theValue) { + return Base64.encodeBase64String(theValue); + } + + @Override + public Base64BinaryType copy() { + return new Base64BinaryType(getValue()); + } +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java index 6836aa075c3..f838ad61cb1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java @@ -20,335 +20,335 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ -@ResourceDef(name="Basic", profile="http://hl7.org/fhir/Profile/Basic") -public class Basic extends DomainResource { - - /** - * Identifier assigned to the resource for business purposes, outside the context of FHIR. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) - protected List identifier; - - /** - * Identifies the 'type' of resource - equivalent to the resource name for other resources. - */ - @Child(name="code", type={CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="Kind of Resource", formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." ) - protected CodeableConcept code; - - /** - * Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce. - */ - @Child(name="subject", type={}, order=1, min=0, max=1) - @Description(shortDefinition="Identifies the", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - protected Resource subjectTarget; - - /** - * Indicates who was responsible for creating the resource instance. - */ - @Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who created", formalDefinition="Indicates who was responsible for creating the resource instance." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Indicates who was responsible for creating the resource instance.) - */ - protected Resource authorTarget; - - /** - * Identifies when the resource was first created. - */ - @Child(name="created", type={DateType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." ) - protected DateType created; - - private static final long serialVersionUID = 916539354L; - - public Basic() { - super(); - } - - public Basic(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public Basic setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.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} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Basic 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Resource getSubjectTarget() { - 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Basic setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Basic setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Basic setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Basic setCreatedElement(DateType value) { - this.created = value; - return this; - } - - /** - * @return Identifies when the resource was first created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value Identifies when the resource was first created. - */ - public Basic setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateType(); - this.created.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Indicates who was responsible for creating the resource instance.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created)); - } - - public Basic copy() { - Basic dst = new Basic(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.author = author == null ? null : author.copy(); - dst.created = created == null ? null : created.copy(); - return dst; - } - - protected Basic typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Basic; - } - - @SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" ) - public static final String SP_CODE = "code"; - -} - + +/* + 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.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; +/** + * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + */ +@ResourceDef(name="Basic", profile="http://hl7.org/fhir/Profile/Basic") +public class Basic extends DomainResource { + + /** + * Identifier assigned to the resource for business purposes, outside the context of FHIR. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) + protected List identifier; + + /** + * Identifies the 'type' of resource - equivalent to the resource name for other resources. + */ + @Child(name="code", type={CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="Kind of Resource", formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." ) + protected CodeableConcept code; + + /** + * Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce. + */ + @Child(name="subject", type={}, order=1, min=0, max=1) + @Description(shortDefinition="Identifies the", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + protected Resource subjectTarget; + + /** + * Indicates who was responsible for creating the resource instance. + */ + @Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who created", formalDefinition="Indicates who was responsible for creating the resource instance." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Indicates who was responsible for creating the resource instance.) + */ + protected Resource authorTarget; + + /** + * Identifies when the resource was first created. + */ + @Child(name="created", type={DateType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." ) + protected DateType created; + + private static final long serialVersionUID = 916539354L; + + public Basic() { + super(); + } + + public Basic(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public Basic setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.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} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Basic 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Basic setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Basic setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) + */ + public Basic setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Basic.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Basic setCreatedElement(DateType value) { + this.created = value; + return this; + } + + /** + * @return Identifies when the resource was first created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value Identifies when the resource was first created. + */ + public Basic setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateType(); + this.created.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Indicates who was responsible for creating the resource instance.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created)); + } + + public Basic copy() { + Basic dst = new Basic(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.author = author == null ? null : author.copy(); + dst.created = created == null ? null : created.copy(); + return dst; + } + + protected Basic typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Basic; + } + + @SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" ) + public static final String SP_CODE = "code"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java index 72c6b8aff9a..050587b2ded 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java @@ -20,198 +20,198 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ -@ResourceDef(name="Binary", profile="http://hl7.org/fhir/Profile/Binary") -public class Binary extends Resource { - - /** - * MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - @Child(name="contentType", type={CodeType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) - protected CodeType contentType; - - /** - * The actual content, base64 encoded. - */ - @Child(name="content", type={Base64BinaryType.class}, order=0, min=1, max=1) - @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) - protected Base64BinaryType content; - - private static final long serialVersionUID = 974764407L; - - public Binary() { - super(); - } - - public Binary(CodeType contentType, Base64BinaryType content) { - super(); - this.contentType = contentType; - this.content = content; - } - - /** - * @return {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Binary.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Binary setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - public Binary setContentType(String value) { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - return this; - } - - /** - * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Base64BinaryType getContentElement() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Binary.content"); - else if (Configuration.doAutoCreate()) - this.content = new Base64BinaryType(); - return this.content; - } - - public boolean hasContentElement() { - return this.content != null && !this.content.isEmpty(); - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Binary setContentElement(Base64BinaryType value) { - this.content = value; - return this; - } - - /** - * @return The actual content, base64 encoded. - */ - public byte[] getContent() { - return this.content == null ? null : this.content.getValue(); - } - - /** - * @param value The actual content, base64 encoded. - */ - public Binary setContent(byte[] value) { - if (this.content == null) - this.content = new Base64BinaryType(); - this.content.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public Binary copy() { - Binary dst = new Binary(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.content = content == null ? null : content.copy(); - return dst; - } - - protected Binary typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Binary; - } - - @SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" ) - public static final String SP_CONTENTTYPE = "contenttype"; - -} - + +/* + 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; +/** + * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + */ +@ResourceDef(name="Binary", profile="http://hl7.org/fhir/Profile/Binary") +public class Binary extends Resource { + + /** + * MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + @Child(name="contentType", type={CodeType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) + protected CodeType contentType; + + /** + * The actual content, base64 encoded. + */ + @Child(name="content", type={Base64BinaryType.class}, order=0, min=1, max=1) + @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) + protected Base64BinaryType content; + + private static final long serialVersionUID = 974764407L; + + public Binary() { + super(); + } + + public Binary(CodeType contentType, Base64BinaryType content) { + super(); + this.contentType = contentType; + this.content = content; + } + + /** + * @return {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public CodeType getContentTypeElement() { + if (this.contentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.contentType"); + else if (Configuration.doAutoCreate()) + this.contentType = new CodeType(); + return this.contentType; + } + + public boolean hasContentTypeElement() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + public boolean hasContentType() { + return this.contentType != null && !this.contentType.isEmpty(); + } + + /** + * @param value {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value + */ + public Binary setContentTypeElement(CodeType value) { + this.contentType = value; + return this; + } + + /** + * @return MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + public String getContentType() { + return this.contentType == null ? null : this.contentType.getValue(); + } + + /** + * @param value MimeType of the binary content represented as a standard MimeType (BCP 13). + */ + public Binary setContentType(String value) { + if (this.contentType == null) + this.contentType = new CodeType(); + this.contentType.setValue(value); + return this; + } + + /** + * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Base64BinaryType getContentElement() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Binary.content"); + else if (Configuration.doAutoCreate()) + this.content = new Base64BinaryType(); + return this.content; + } + + public boolean hasContentElement() { + return this.content != null && !this.content.isEmpty(); + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value + */ + public Binary setContentElement(Base64BinaryType value) { + this.content = value; + return this; + } + + /** + * @return The actual content, base64 encoded. + */ + public byte[] getContent() { + return this.content == null ? null : this.content.getValue(); + } + + /** + * @param value The actual content, base64 encoded. + */ + public Binary setContent(byte[] value) { + if (this.content == null) + this.content = new Base64BinaryType(); + this.content.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); + childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public Binary copy() { + Binary dst = new Binary(); + copyValues(dst); + dst.contentType = contentType == null ? null : contentType.copy(); + dst.content = content == null ? null : content.copy(); + return dst; + } + + protected Binary typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Binary; + } + + @SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" ) + public static final String SP_CONTENTTYPE = "contenttype"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java index f3e13c2a6e6..bc1a2ba5737 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java @@ -1,34 +1,34 @@ -/* -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. - -*/ -/** - * - */ +/* +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. + +*/ +/** + * + */ package org.hl7.fhir.instance.model; /* @@ -51,62 +51,62 @@ package org.hl7.fhir.instance.model; * #L% */ - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "boolean" in FHIR "true" or "false" - */ -@DatatypeDef(name="boolean") -public class BooleanType extends PrimitiveType { - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public BooleanType() { - super(); - } - - /** - * Constructor - */ - public BooleanType(boolean theBoolean) { - setValue(theBoolean); - } - - /** - * Constructor - */ - public BooleanType(Boolean theBoolean) { - setValue(theBoolean); - } - - @Override - protected Boolean parse(String theValue) { - String value = theValue.trim(); - if ("true".equals(value)) { - return Boolean.TRUE; - } else if ("false".equals(value)) { - return Boolean.FALSE; - } else { - throw new IllegalArgumentException("Invalid boolean string: '" + theValue + "'"); - } - } - - @Override - protected String encode(Boolean theValue) { - if (Boolean.TRUE.equals(theValue)) { - return "true"; - } else { - return "false"; - } - } - - @Override - public BooleanType copy() { - return new BooleanType(getValue()); - } - -} + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "boolean" in FHIR "true" or "false" + */ +@DatatypeDef(name="boolean") +public class BooleanType extends PrimitiveType { + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public BooleanType() { + super(); + } + + /** + * Constructor + */ + public BooleanType(boolean theBoolean) { + setValue(theBoolean); + } + + /** + * Constructor + */ + public BooleanType(Boolean theBoolean) { + setValue(theBoolean); + } + + @Override + protected Boolean parse(String theValue) { + String value = theValue.trim(); + if ("true".equals(value)) { + return Boolean.TRUE; + } else if ("false".equals(value)) { + return Boolean.FALSE; + } else { + throw new IllegalArgumentException("Invalid boolean string: '" + theValue + "'"); + } + } + + @Override + protected String encode(Boolean theValue) { + if (Boolean.TRUE.equals(theValue)) { + return "true"; + } else { + return "false"; + } + } + + @Override + public BooleanType copy() { + return new BooleanType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java index 8a83aec56b3..a0eb5b9cd0a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java @@ -20,1366 +20,1366 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A container for a group of resources. - */ -@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") -public class Bundle extends Resource { - - public enum BundleType implements FhirEnum { - /** - * The bundle is a document. The first resource is a Composition. - */ - DOCUMENT, - /** - * The bundle is a message. The first resource is a MessageHeader. - */ - MESSAGE, - /** - * The bundle is a transaction - intended to be processed by a server as an atomic commit. - */ - TRANSACTION, - /** - * The bundle is a transaction response. - */ - TRANSACTIONRESPONSE, - /** - * The bundle is a list of resources from a _history interaction on a server. - */ - HISTORY, - /** - * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. - */ - SEARCHSET, - /** - * The bundle is a set of resources collected into a single document for ease of distribution. - */ - COLLECTION, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DOCUMENT; - if ("message".equals(codeString)) - return MESSAGE; - if ("transaction".equals(codeString)) - return TRANSACTION; - if ("transaction-response".equals(codeString)) - return TRANSACTIONRESPONSE; - if ("history".equals(codeString)) - return HISTORY; - if ("searchset".equals(codeString)) - return SEARCHSET; - if ("collection".equals(codeString)) - return COLLECTION; - throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DOCUMENT: return "document"; - case MESSAGE: return "message"; - case TRANSACTION: return "transaction"; - case TRANSACTIONRESPONSE: return "transaction-response"; - case HISTORY: return "history"; - case SEARCHSET: return "searchset"; - case COLLECTION: return "collection"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DOCUMENT: return ""; - case MESSAGE: return ""; - case TRANSACTION: return ""; - case TRANSACTIONRESPONSE: return ""; - case HISTORY: return ""; - case SEARCHSET: return ""; - case COLLECTION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; - case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; - case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; - case TRANSACTIONRESPONSE: return "The bundle is a transaction response."; - case HISTORY: return "The bundle is a list of resources from a _history interaction on a server."; - case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; - case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DOCUMENT: return "Document"; - case MESSAGE: return "Message"; - case TRANSACTION: return "Transaction"; - case TRANSACTIONRESPONSE: return "Transaction Response"; - case HISTORY: return "History List"; - case SEARCHSET: return "Search Results"; - case COLLECTION: return "Collection"; - default: return "?"; - } - } - } - - public static class BundleTypeEnumFactory implements EnumFactory { - public BundleType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("document".equals(codeString)) - return BundleType.DOCUMENT; - if ("message".equals(codeString)) - return BundleType.MESSAGE; - if ("transaction".equals(codeString)) - return BundleType.TRANSACTION; - if ("transaction-response".equals(codeString)) - return BundleType.TRANSACTIONRESPONSE; - if ("history".equals(codeString)) - return BundleType.HISTORY; - if ("searchset".equals(codeString)) - return BundleType.SEARCHSET; - if ("collection".equals(codeString)) - return BundleType.COLLECTION; - throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); - } - public String toCode(BundleType code) throws IllegalArgumentException { - if (code == BundleType.DOCUMENT) - return "document"; - if (code == BundleType.MESSAGE) - return "message"; - if (code == BundleType.TRANSACTION) - return "transaction"; - if (code == BundleType.TRANSACTIONRESPONSE) - return "transaction-response"; - if (code == BundleType.HISTORY) - return "history"; - if (code == BundleType.SEARCHSET) - return "searchset"; - if (code == BundleType.COLLECTION) - return "collection"; - return "?"; - } - } - - public enum BundleEntryStatus implements FhirEnum { - /** - * Transaction: perform a create operation on this resource. - */ - CREATE, - /** - * Transaction: perform an update operation on this resource. - */ - UPDATE, - /** - * Transaction: look for this resource using the search url provided. If there's no match, create it. Search: this resource is returned because it matches the search criteria. - */ - MATCH, - /** - * Search: this resource is returned because it meets an _include criteria. - */ - INCLUDE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CREATE; - if ("update".equals(codeString)) - return UPDATE; - if ("match".equals(codeString)) - return MATCH; - if ("include".equals(codeString)) - return INCLUDE; - throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CREATE: return "create"; - case UPDATE: return "update"; - case MATCH: return "match"; - case INCLUDE: return "include"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CREATE: return ""; - case UPDATE: return ""; - case MATCH: return ""; - case INCLUDE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CREATE: return "Transaction: perform a create operation on this resource."; - case UPDATE: return "Transaction: perform an update operation on this resource."; - case MATCH: return "Transaction: look for this resource using the search url provided. If there's no match, create it. Search: this resource is returned because it matches the search criteria."; - case INCLUDE: return "Search: this resource is returned because it meets an _include criteria."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CREATE: return "Create"; - case UPDATE: return "Update"; - case MATCH: return "Match"; - case INCLUDE: return "Include"; - default: return "?"; - } - } - } - - public static class BundleEntryStatusEnumFactory implements EnumFactory { - public BundleEntryStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return BundleEntryStatus.CREATE; - if ("update".equals(codeString)) - return BundleEntryStatus.UPDATE; - if ("match".equals(codeString)) - return BundleEntryStatus.MATCH; - if ("include".equals(codeString)) - return BundleEntryStatus.INCLUDE; - throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'"); - } - public String toCode(BundleEntryStatus code) throws IllegalArgumentException { - if (code == BundleEntryStatus.CREATE) - return "create"; - if (code == BundleEntryStatus.UPDATE) - return "update"; - if (code == BundleEntryStatus.MATCH) - return "match"; - if (code == BundleEntryStatus.INCLUDE) - return "include"; - return "?"; - } - } - - @Block() - public static class BundleLinkComponent extends BackboneElement { - /** - * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - @Child(name="relation", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) - protected StringType relation; - - /** - * The reference details for the link. - */ - @Child(name="url", type={UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) - protected UriType url; - - private static final long serialVersionUID = -1010386066L; - - public BundleLinkComponent() { - super(); - } - - public BundleLinkComponent(StringType relation, UriType url) { - super(); - this.relation = relation; - this.url = url; - } - - /** - * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value - */ - public StringType getRelationElement() { - if (this.relation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleLinkComponent.relation"); - else if (Configuration.doAutoCreate()) - this.relation = new StringType(); - return this.relation; - } - - public boolean hasRelationElement() { - return this.relation != null && !this.relation.isEmpty(); - } - - public boolean hasRelation() { - return this.relation != null && !this.relation.isEmpty(); - } - - /** - * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value - */ - public BundleLinkComponent setRelationElement(StringType value) { - this.relation = value; - return this; - } - - /** - * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - public String getRelation() { - return this.relation == null ? null : this.relation.getValue(); - } - - /** - * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - public BundleLinkComponent setRelation(String value) { - if (this.relation == null) - this.relation = new StringType(); - this.relation.setValue(value); - return this; - } - - /** - * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleLinkComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public BundleLinkComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The reference details for the link. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The reference details for the link. - */ - public BundleLinkComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); - childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public BundleLinkComponent copy() { - BundleLinkComponent dst = new BundleLinkComponent(); - copyValues(dst); - dst.relation = relation == null ? null : relation.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - } - - @Block() - public static class BundleEntryComponent extends BackboneElement { - /** - * The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - */ - @Child(name="base", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Base URL, if different to bundle base", formalDefinition="The Base URL for the resource, if different to the base URL specified for the bundle as a whole." ) - protected UriType base; - - /** - * The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). - */ - @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="create | update | match | include - for search & transaction", formalDefinition="The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete)." ) - protected Enumeration status; - - /** - * Search URL for this resource when processing a transaction (see transaction documentation). - */ - @Child(name="search", type={UriType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Search URL (see transaction)", formalDefinition="Search URL for this resource when processing a transaction (see transaction documentation)." ) - protected UriType search; - - /** - * When searching, the server's search ranking score for the entry. - */ - @Child(name="score", type={DecimalType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) - protected DecimalType score; - - /** - * If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino. - */ - @Child(name="deleted", type={}, order=5, min=0, max=1) - @Description(shortDefinition="If this is a deleted resource (transaction/history)", formalDefinition="If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino." ) - protected BundleEntryDeletedComponent deleted; - - /** - * The Resources for the entry. - */ - @Child(name="resource", type={Resource.class}, order=6, min=0, max=1) - @Description(shortDefinition="Resources in this bundle", formalDefinition="The Resources for the entry." ) - protected Resource resource; - - private static final long serialVersionUID = 509077972L; - - public BundleEntryComponent() { - super(); - } - - /** - * @return {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public UriType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.base"); - else if (Configuration.doAutoCreate()) - this.base = new UriType(); - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public BundleEntryComponent setBaseElement(UriType value) { - this.base = value; - return this; - } - - /** - * @return The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - */ - public BundleEntryComponent setBase(String value) { - if (Utilities.noString(value)) - this.base = null; - else { - if (this.base == null) - this.base = new UriType(); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public BundleEntryComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). - */ - public BundleEntryStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). - */ - public BundleEntryComponent setStatus(BundleEntryStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(BundleEntryStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #search} (Search URL for this resource when processing a transaction (see transaction documentation).). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value - */ - public UriType getSearchElement() { - if (this.search == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.search"); - else if (Configuration.doAutoCreate()) - this.search = new UriType(); - return this.search; - } - - public boolean hasSearchElement() { - return this.search != null && !this.search.isEmpty(); - } - - public boolean hasSearch() { - return this.search != null && !this.search.isEmpty(); - } - - /** - * @param value {@link #search} (Search URL for this resource when processing a transaction (see transaction documentation).). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value - */ - public BundleEntryComponent setSearchElement(UriType value) { - this.search = value; - return this; - } - - /** - * @return Search URL for this resource when processing a transaction (see transaction documentation). - */ - public String getSearch() { - return this.search == null ? null : this.search.getValue(); - } - - /** - * @param value Search URL for this resource when processing a transaction (see transaction documentation). - */ - public BundleEntryComponent setSearch(String value) { - if (Utilities.noString(value)) - this.search = null; - else { - if (this.search == null) - this.search = new UriType(); - this.search.setValue(value); - } - return this; - } - - /** - * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value - */ - public DecimalType getScoreElement() { - if (this.score == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.score"); - else if (Configuration.doAutoCreate()) - this.score = new DecimalType(); - return this.score; - } - - public boolean hasScoreElement() { - return this.score != null && !this.score.isEmpty(); - } - - public boolean hasScore() { - return this.score != null && !this.score.isEmpty(); - } - - /** - * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value - */ - public BundleEntryComponent setScoreElement(DecimalType value) { - this.score = value; - return this; - } - - /** - * @return When searching, the server's search ranking score for the entry. - */ - public BigDecimal getScore() { - return this.score == null ? null : this.score.getValue(); - } - - /** - * @param value When searching, the server's search ranking score for the entry. - */ - public BundleEntryComponent setScore(BigDecimal value) { - if (value == null) - this.score = null; - else { - if (this.score == null) - this.score = new DecimalType(); - this.score.setValue(value); - } - return this; - } - - /** - * @return {@link #deleted} (If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.) - */ - public BundleEntryDeletedComponent getDeleted() { - if (this.deleted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.deleted"); - else if (Configuration.doAutoCreate()) - this.deleted = new BundleEntryDeletedComponent(); - return this.deleted; - } - - public boolean hasDeleted() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - /** - * @param value {@link #deleted} (If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.) - */ - public BundleEntryComponent setDeleted(BundleEntryDeletedComponent value) { - this.deleted = value; - return this; - } - - /** - * @return {@link #resource} (The Resources for the entry.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The Resources for the entry.) - */ - public BundleEntryComponent setResource(Resource value) { - this.resource = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("base", "uri", "The Base URL for the resource, if different to the base URL specified for the bundle as a whole.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("status", "code", "The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("search", "uri", "Search URL for this resource when processing a transaction (see transaction documentation).", 0, java.lang.Integer.MAX_VALUE, search)); - childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); - childrenList.add(new Property("deleted", "", "If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.", 0, java.lang.Integer.MAX_VALUE, deleted)); - childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - public BundleEntryComponent copy() { - BundleEntryComponent dst = new BundleEntryComponent(); - copyValues(dst); - dst.base = base == null ? null : base.copy(); - dst.status = status == null ? null : status.copy(); - dst.search = search == null ? null : search.copy(); - dst.score = score == null ? null : score.copy(); - dst.deleted = deleted == null ? null : deleted.copy(); - dst.resource = resource == null ? null : resource.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (base == null || base.isEmpty()) && (status == null || status.isEmpty()) - && (search == null || search.isEmpty()) && (score == null || score.isEmpty()) && (deleted == null || deleted.isEmpty()) - && (resource == null || resource.isEmpty()); - } - - } - - @Block() - public static class BundleEntryDeletedComponent extends BackboneElement { - /** - * The type of resource that was deleted (required to construct the identity). - */ - @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type of resource that was deleted", formalDefinition="The type of resource that was deleted (required to construct the identity)." ) - protected CodeType type; - - /** - * The id of the resource that was deleted. - */ - @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 resourceId; - - /** - * Version id for releted resource. - */ - @Child(name="versionId", type={IdType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Version id for releted resource", formalDefinition="Version id for releted resource." ) - protected IdType versionId; - - /** - * The date/time that the resource was deleted. - */ - @Child(name="instant", type={InstantType.class}, order=4, min=1, max=1) - @Description(shortDefinition="When the resource was deleted", formalDefinition="The date/time that the resource was deleted." ) - protected InstantType instant; - - private static final long serialVersionUID = -1528107649L; - - public BundleEntryDeletedComponent() { - super(); - } - - public BundleEntryDeletedComponent(CodeType type, IdType resourceId, IdType versionId, InstantType instant) { - super(); - this.type = type; - this.resourceId = resourceId; - this.versionId = versionId; - this.instant = instant; - } - - /** - * @return {@link #type} (The type of resource that was deleted (required to construct the identity).). 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 BundleEntryDeletedComponent.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 of resource that was deleted (required to construct the identity).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public BundleEntryDeletedComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of resource that was deleted (required to construct the identity). - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of resource that was deleted (required to construct the identity). - */ - public BundleEntryDeletedComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @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 getResourceIdElement() { - if (this.resourceId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryDeletedComponent.resourceId"); - else if (Configuration.doAutoCreate()) - this.resourceId = new IdType(); - return this.resourceId; - } - - public boolean hasResourceIdElement() { - return this.resourceId != null && !this.resourceId.isEmpty(); - } - - public boolean hasResourceId() { - return this.resourceId != null && !this.resourceId.isEmpty(); - } - - /** - * @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 setResourceIdElement(IdType value) { - this.resourceId = value; - return this; - } - - /** - * @return The id of the resource that was deleted. - */ - public String getResourceId() { - return this.resourceId == null ? null : this.resourceId.getValue(); - } - - /** - * @param value The id of the resource that was deleted. - */ - public BundleEntryDeletedComponent setResourceId(String value) { - if (this.resourceId == null) - this.resourceId = new IdType(); - this.resourceId.setValue(value); - return this; - } - - /** - * @return {@link #versionId} (Version id for releted resource.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public IdType getVersionIdElement() { - if (this.versionId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryDeletedComponent.versionId"); - else if (Configuration.doAutoCreate()) - this.versionId = new IdType(); - return this.versionId; - } - - public boolean hasVersionIdElement() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - public boolean hasVersionId() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - /** - * @param value {@link #versionId} (Version id for releted resource.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public BundleEntryDeletedComponent setVersionIdElement(IdType value) { - this.versionId = value; - return this; - } - - /** - * @return Version id for releted resource. - */ - public String getVersionId() { - return this.versionId == null ? null : this.versionId.getValue(); - } - - /** - * @param value Version id for releted resource. - */ - public BundleEntryDeletedComponent setVersionId(String value) { - if (this.versionId == null) - this.versionId = new IdType(); - this.versionId.setValue(value); - return this; - } - - /** - * @return {@link #instant} (The date/time that the resource was deleted.). This is the underlying object with id, value and extensions. The accessor "getInstant" gives direct access to the value - */ - public InstantType getInstantElement() { - if (this.instant == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryDeletedComponent.instant"); - else if (Configuration.doAutoCreate()) - this.instant = new InstantType(); - return this.instant; - } - - public boolean hasInstantElement() { - return this.instant != null && !this.instant.isEmpty(); - } - - public boolean hasInstant() { - return this.instant != null && !this.instant.isEmpty(); - } - - /** - * @param value {@link #instant} (The date/time that the resource was deleted.). This is the underlying object with id, value and extensions. The accessor "getInstant" gives direct access to the value - */ - public BundleEntryDeletedComponent setInstantElement(InstantType value) { - this.instant = value; - return this; - } - - /** - * @return The date/time that the resource was deleted. - */ - public Date getInstant() { - return this.instant == null ? null : this.instant.getValue(); - } - - /** - * @param value The date/time that the resource was deleted. - */ - public BundleEntryDeletedComponent setInstant(Date value) { - if (this.instant == null) - this.instant = new InstantType(); - this.instant.setValue(value); - return this; - } - - protected void listChildren(List 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("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)); - } - - public BundleEntryDeletedComponent copy() { - BundleEntryDeletedComponent dst = new BundleEntryDeletedComponent(); - copyValues(dst); - dst.type = type == null ? null : type.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()) && (resourceId == null || resourceId.isEmpty()) - && (versionId == null || versionId.isEmpty()) && (instant == null || instant.isEmpty()); - } - - } - - /** - * Indicates the purpose of this bundle- how it was intended to be used. - */ - @Child(name="type", type={CodeType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="document | message | transaction | transaction-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) - protected Enumeration type; - - /** - * The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). - */ - @Child(name="base", type={UriType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Stated Base URL", formalDefinition="The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base)." ) - protected UriType base; - - /** - * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - @Child(name="total", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) - protected IntegerType total; - - /** - * A series of links that provide context to this bundle. - */ - @Child(name="link", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) - protected List link; - - /** - * An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only). - */ - @Child(name="entry", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Entry in the bundle - will have deleted or resource", formalDefinition="An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only)." ) - protected List entry; - - /** - * XML Digital Signature - base64 encoded. - */ - @Child(name="signature", type={Base64BinaryType.class}, order=4, min=0, max=1) - @Description(shortDefinition="XML Digital Signature (base64 encoded)", formalDefinition="XML Digital Signature - base64 encoded." ) - protected Base64BinaryType signature; - - private static final long serialVersionUID = -1332054150L; - - public Bundle() { - super(); - } - - public Bundle(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Bundle setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Indicates the purpose of this bundle- how it was intended to be used. - */ - public BundleType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Indicates the purpose of this bundle- how it was intended to be used. - */ - public Bundle setType(BundleType value) { - if (this.type == null) - this.type = new Enumeration(BundleType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public UriType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.base"); - else if (Configuration.doAutoCreate()) - this.base = new UriType(); - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public Bundle setBaseElement(UriType value) { - this.base = value; - return this; - } - - /** - * @return The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). - */ - public Bundle setBase(String value) { - if (Utilities.noString(value)) - this.base = null; - else { - if (this.base == null) - this.base = new UriType(); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public IntegerType getTotalElement() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.total"); - else if (Configuration.doAutoCreate()) - this.total = new IntegerType(); - return this.total; - } - - public boolean hasTotalElement() { - return this.total != null && !this.total.isEmpty(); - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public Bundle setTotalElement(IntegerType value) { - this.total = value; - return this; - } - - /** - * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - public int getTotal() { - return this.total == null ? null : this.total.getValue(); - } - - /** - * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - public Bundle setTotal(int value) { - if (value == -1) - this.total = null; - else { - if (this.total == null) - this.total = new IntegerType(); - this.total.setValue(value); - } - return this; - } - - /** - * @return {@link #link} (A series of links that provide context to this bundle.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (BundleLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (A series of links that provide context to this bundle.) - */ - // syntactic sugar - public BundleLinkComponent addLink() { //3 - BundleLinkComponent t = new BundleLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - /** - * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (BundleEntryComponent item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).) - */ - // syntactic sugar - public BundleEntryComponent addEntry() { //3 - BundleEntryComponent t = new BundleEntryComponent(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - /** - * @return {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public Base64BinaryType getSignatureElement() { - if (this.signature == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.signature"); - else if (Configuration.doAutoCreate()) - this.signature = new Base64BinaryType(); - return this.signature; - } - - public boolean hasSignatureElement() { - return this.signature != null && !this.signature.isEmpty(); - } - - public boolean hasSignature() { - return this.signature != null && !this.signature.isEmpty(); - } - - /** - * @param value {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public Bundle setSignatureElement(Base64BinaryType value) { - this.signature = value; - return this; - } - - /** - * @return XML Digital Signature - base64 encoded. - */ - public byte[] getSignature() { - return this.signature == null ? null : this.signature.getValue(); - } - - /** - * @param value XML Digital Signature - base64 encoded. - */ - public Bundle setSignature(byte[] value) { - if (value == null) - this.signature = null; - else { - if (this.signature == null) - this.signature = new Base64BinaryType(); - this.signature.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("base", "uri", "The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("total", "integer", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("signature", "base64Binary", "XML Digital Signature - base64 encoded.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - public Bundle copy() { - Bundle dst = new Bundle(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.base = base == null ? null : base.copy(); - dst.total = total == null ? null : total.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (BundleLinkComponent i : link) - dst.link.add(i.copy()); - }; - if (entry != null) { - dst.entry = new ArrayList(); - for (BundleEntryComponent i : entry) - dst.entry.add(i.copy()); - }; - dst.signature = signature == null ? null : signature.copy(); - return dst; - } - - protected Bundle typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (base == null || base.isEmpty()) - && (total == null || total.isEmpty()) && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) - && (signature == null || signature.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Bundle; - } - - @SearchParamDefinition(name="message", path="", description="The first resource in the bundle, if the bundle type is 'message' - this is a message header, and this parameter provides access to search it's contents", type="reference" ) - public static final String SP_MESSAGE = "message"; - @SearchParamDefinition(name="composition", path="", description="The first resource in the bundle, if the bundle type is 'document' - this is a composition, and this parameter provides access to searches it's contents", type="reference" ) - public static final String SP_COMPOSITION = "composition"; - @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | history | searchset | collection", type="token" ) - public static final String SP_TYPE = "type"; - -} - + +/* + 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 java.math.*; +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; +/** + * A container for a group of resources. + */ +@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") +public class Bundle extends Resource { + + public enum BundleType implements FhirEnum { + /** + * The bundle is a document. The first resource is a Composition. + */ + DOCUMENT, + /** + * The bundle is a message. The first resource is a MessageHeader. + */ + MESSAGE, + /** + * The bundle is a transaction - intended to be processed by a server as an atomic commit. + */ + TRANSACTION, + /** + * The bundle is a transaction response. + */ + TRANSACTIONRESPONSE, + /** + * The bundle is a list of resources from a _history interaction on a server. + */ + HISTORY, + /** + * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. + */ + SEARCHSET, + /** + * The bundle is a set of resources collected into a single document for ease of distribution. + */ + COLLECTION, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DOCUMENT; + if ("message".equals(codeString)) + return MESSAGE; + if ("transaction".equals(codeString)) + return TRANSACTION; + if ("transaction-response".equals(codeString)) + return TRANSACTIONRESPONSE; + if ("history".equals(codeString)) + return HISTORY; + if ("searchset".equals(codeString)) + return SEARCHSET; + if ("collection".equals(codeString)) + return COLLECTION; + throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DOCUMENT: return "document"; + case MESSAGE: return "message"; + case TRANSACTION: return "transaction"; + case TRANSACTIONRESPONSE: return "transaction-response"; + case HISTORY: return "history"; + case SEARCHSET: return "searchset"; + case COLLECTION: return "collection"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DOCUMENT: return ""; + case MESSAGE: return ""; + case TRANSACTION: return ""; + case TRANSACTIONRESPONSE: return ""; + case HISTORY: return ""; + case SEARCHSET: return ""; + case COLLECTION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; + case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; + case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; + case TRANSACTIONRESPONSE: return "The bundle is a transaction response."; + case HISTORY: return "The bundle is a list of resources from a _history interaction on a server."; + case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; + case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DOCUMENT: return "Document"; + case MESSAGE: return "Message"; + case TRANSACTION: return "Transaction"; + case TRANSACTIONRESPONSE: return "Transaction Response"; + case HISTORY: return "History List"; + case SEARCHSET: return "Search Results"; + case COLLECTION: return "Collection"; + default: return "?"; + } + } + } + + public static class BundleTypeEnumFactory implements EnumFactory { + public BundleType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("document".equals(codeString)) + return BundleType.DOCUMENT; + if ("message".equals(codeString)) + return BundleType.MESSAGE; + if ("transaction".equals(codeString)) + return BundleType.TRANSACTION; + if ("transaction-response".equals(codeString)) + return BundleType.TRANSACTIONRESPONSE; + if ("history".equals(codeString)) + return BundleType.HISTORY; + if ("searchset".equals(codeString)) + return BundleType.SEARCHSET; + if ("collection".equals(codeString)) + return BundleType.COLLECTION; + throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); + } + public String toCode(BundleType code) throws IllegalArgumentException { + if (code == BundleType.DOCUMENT) + return "document"; + if (code == BundleType.MESSAGE) + return "message"; + if (code == BundleType.TRANSACTION) + return "transaction"; + if (code == BundleType.TRANSACTIONRESPONSE) + return "transaction-response"; + if (code == BundleType.HISTORY) + return "history"; + if (code == BundleType.SEARCHSET) + return "searchset"; + if (code == BundleType.COLLECTION) + return "collection"; + return "?"; + } + } + + public enum BundleEntryStatus implements FhirEnum { + /** + * Transaction: perform a create operation on this resource. + */ + CREATE, + /** + * Transaction: perform an update operation on this resource. + */ + UPDATE, + /** + * Transaction: look for this resource using the search url provided. If there's no match, create it. Search: this resource is returned because it matches the search criteria. + */ + MATCH, + /** + * Search: this resource is returned because it meets an _include criteria. + */ + INCLUDE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CREATE; + if ("update".equals(codeString)) + return UPDATE; + if ("match".equals(codeString)) + return MATCH; + if ("include".equals(codeString)) + return INCLUDE; + throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CREATE: return "create"; + case UPDATE: return "update"; + case MATCH: return "match"; + case INCLUDE: return "include"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CREATE: return ""; + case UPDATE: return ""; + case MATCH: return ""; + case INCLUDE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CREATE: return "Transaction: perform a create operation on this resource."; + case UPDATE: return "Transaction: perform an update operation on this resource."; + case MATCH: return "Transaction: look for this resource using the search url provided. If there's no match, create it. Search: this resource is returned because it matches the search criteria."; + case INCLUDE: return "Search: this resource is returned because it meets an _include criteria."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CREATE: return "Create"; + case UPDATE: return "Update"; + case MATCH: return "Match"; + case INCLUDE: return "Include"; + default: return "?"; + } + } + } + + public static class BundleEntryStatusEnumFactory implements EnumFactory { + public BundleEntryStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("create".equals(codeString)) + return BundleEntryStatus.CREATE; + if ("update".equals(codeString)) + return BundleEntryStatus.UPDATE; + if ("match".equals(codeString)) + return BundleEntryStatus.MATCH; + if ("include".equals(codeString)) + return BundleEntryStatus.INCLUDE; + throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'"); + } + public String toCode(BundleEntryStatus code) throws IllegalArgumentException { + if (code == BundleEntryStatus.CREATE) + return "create"; + if (code == BundleEntryStatus.UPDATE) + return "update"; + if (code == BundleEntryStatus.MATCH) + return "match"; + if (code == BundleEntryStatus.INCLUDE) + return "include"; + return "?"; + } + } + + @Block() + public static class BundleLinkComponent extends BackboneElement { + /** + * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + @Child(name="relation", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) + protected StringType relation; + + /** + * The reference details for the link. + */ + @Child(name="url", type={UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) + protected UriType url; + + private static final long serialVersionUID = -1010386066L; + + public BundleLinkComponent() { + super(); + } + + public BundleLinkComponent(StringType relation, UriType url) { + super(); + this.relation = relation; + this.url = url; + } + + /** + * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + */ + public StringType getRelationElement() { + if (this.relation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleLinkComponent.relation"); + else if (Configuration.doAutoCreate()) + this.relation = new StringType(); + return this.relation; + } + + public boolean hasRelationElement() { + return this.relation != null && !this.relation.isEmpty(); + } + + public boolean hasRelation() { + return this.relation != null && !this.relation.isEmpty(); + } + + /** + * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value + */ + public BundleLinkComponent setRelationElement(StringType value) { + this.relation = value; + return this; + } + + /** + * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + public String getRelation() { + return this.relation == null ? null : this.relation.getValue(); + } + + /** + * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + */ + public BundleLinkComponent setRelation(String value) { + if (this.relation == null) + this.relation = new StringType(); + this.relation.setValue(value); + return this; + } + + /** + * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleLinkComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public BundleLinkComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The reference details for the link. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The reference details for the link. + */ + public BundleLinkComponent setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); + childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public BundleLinkComponent copy() { + BundleLinkComponent dst = new BundleLinkComponent(); + copyValues(dst); + dst.relation = relation == null ? null : relation.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + } + + @Block() + public static class BundleEntryComponent extends BackboneElement { + /** + * The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + */ + @Child(name="base", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Base URL, if different to bundle base", formalDefinition="The Base URL for the resource, if different to the base URL specified for the bundle as a whole." ) + protected UriType base; + + /** + * The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="create | update | match | include - for search & transaction", formalDefinition="The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete)." ) + protected Enumeration status; + + /** + * Search URL for this resource when processing a transaction (see transaction documentation). + */ + @Child(name="search", type={UriType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Search URL (see transaction)", formalDefinition="Search URL for this resource when processing a transaction (see transaction documentation)." ) + protected UriType search; + + /** + * When searching, the server's search ranking score for the entry. + */ + @Child(name="score", type={DecimalType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) + protected DecimalType score; + + /** + * If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino. + */ + @Child(name="deleted", type={}, order=5, min=0, max=1) + @Description(shortDefinition="If this is a deleted resource (transaction/history)", formalDefinition="If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino." ) + protected BundleEntryDeletedComponent deleted; + + /** + * The Resources for the entry. + */ + @Child(name="resource", type={Resource.class}, order=6, min=0, max=1) + @Description(shortDefinition="Resources in this bundle", formalDefinition="The Resources for the entry." ) + protected Resource resource; + + private static final long serialVersionUID = 509077972L; + + public BundleEntryComponent() { + super(); + } + + /** + * @return {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public UriType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.base"); + else if (Configuration.doAutoCreate()) + this.base = new UriType(); + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The Base URL for the resource, if different to the base URL specified for the bundle as a whole.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public BundleEntryComponent setBaseElement(UriType value) { + this.base = value; + return this; + } + + /** + * @return The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + */ + public BundleEntryComponent setBase(String value) { + if (Utilities.noString(value)) + this.base = null; + else { + if (this.base == null) + this.base = new UriType(); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public BundleEntryComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). + */ + public BundleEntryStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). + */ + public BundleEntryComponent setStatus(BundleEntryStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(BundleEntryStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #search} (Search URL for this resource when processing a transaction (see transaction documentation).). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value + */ + public UriType getSearchElement() { + if (this.search == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.search"); + else if (Configuration.doAutoCreate()) + this.search = new UriType(); + return this.search; + } + + public boolean hasSearchElement() { + return this.search != null && !this.search.isEmpty(); + } + + public boolean hasSearch() { + return this.search != null && !this.search.isEmpty(); + } + + /** + * @param value {@link #search} (Search URL for this resource when processing a transaction (see transaction documentation).). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value + */ + public BundleEntryComponent setSearchElement(UriType value) { + this.search = value; + return this; + } + + /** + * @return Search URL for this resource when processing a transaction (see transaction documentation). + */ + public String getSearch() { + return this.search == null ? null : this.search.getValue(); + } + + /** + * @param value Search URL for this resource when processing a transaction (see transaction documentation). + */ + public BundleEntryComponent setSearch(String value) { + if (Utilities.noString(value)) + this.search = null; + else { + if (this.search == null) + this.search = new UriType(); + this.search.setValue(value); + } + return this; + } + + /** + * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value + */ + public DecimalType getScoreElement() { + if (this.score == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.score"); + else if (Configuration.doAutoCreate()) + this.score = new DecimalType(); + return this.score; + } + + public boolean hasScoreElement() { + return this.score != null && !this.score.isEmpty(); + } + + public boolean hasScore() { + return this.score != null && !this.score.isEmpty(); + } + + /** + * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value + */ + public BundleEntryComponent setScoreElement(DecimalType value) { + this.score = value; + return this; + } + + /** + * @return When searching, the server's search ranking score for the entry. + */ + public BigDecimal getScore() { + return this.score == null ? null : this.score.getValue(); + } + + /** + * @param value When searching, the server's search ranking score for the entry. + */ + public BundleEntryComponent setScore(BigDecimal value) { + if (value == null) + this.score = null; + else { + if (this.score == null) + this.score = new DecimalType(); + this.score.setValue(value); + } + return this; + } + + /** + * @return {@link #deleted} (If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.) + */ + public BundleEntryDeletedComponent getDeleted() { + if (this.deleted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryComponent.deleted"); + else if (Configuration.doAutoCreate()) + this.deleted = new BundleEntryDeletedComponent(); + return this.deleted; + } + + public boolean hasDeleted() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + /** + * @param value {@link #deleted} (If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.) + */ + public BundleEntryComponent setDeleted(BundleEntryDeletedComponent value) { + this.deleted = value; + return this; + } + + /** + * @return {@link #resource} (The Resources for the entry.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (The Resources for the entry.) + */ + public BundleEntryComponent setResource(Resource value) { + this.resource = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("base", "uri", "The Base URL for the resource, if different to the base URL specified for the bundle as a whole.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("status", "code", "The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete).", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("search", "uri", "Search URL for this resource when processing a transaction (see transaction documentation).", 0, java.lang.Integer.MAX_VALUE, search)); + childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); + childrenList.add(new Property("deleted", "", "If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further informatino.", 0, java.lang.Integer.MAX_VALUE, deleted)); + childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); + } + + public BundleEntryComponent copy() { + BundleEntryComponent dst = new BundleEntryComponent(); + copyValues(dst); + dst.base = base == null ? null : base.copy(); + dst.status = status == null ? null : status.copy(); + dst.search = search == null ? null : search.copy(); + dst.score = score == null ? null : score.copy(); + dst.deleted = deleted == null ? null : deleted.copy(); + dst.resource = resource == null ? null : resource.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (base == null || base.isEmpty()) && (status == null || status.isEmpty()) + && (search == null || search.isEmpty()) && (score == null || score.isEmpty()) && (deleted == null || deleted.isEmpty()) + && (resource == null || resource.isEmpty()); + } + + } + + @Block() + public static class BundleEntryDeletedComponent extends BackboneElement { + /** + * The type of resource that was deleted (required to construct the identity). + */ + @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of resource that was deleted", formalDefinition="The type of resource that was deleted (required to construct the identity)." ) + protected CodeType type; + + /** + * The id of the resource that was deleted. + */ + @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 resourceId; + + /** + * Version id for releted resource. + */ + @Child(name="versionId", type={IdType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Version id for releted resource", formalDefinition="Version id for releted resource." ) + protected IdType versionId; + + /** + * The date/time that the resource was deleted. + */ + @Child(name="instant", type={InstantType.class}, order=4, min=1, max=1) + @Description(shortDefinition="When the resource was deleted", formalDefinition="The date/time that the resource was deleted." ) + protected InstantType instant; + + private static final long serialVersionUID = -1528107649L; + + public BundleEntryDeletedComponent() { + super(); + } + + public BundleEntryDeletedComponent(CodeType type, IdType resourceId, IdType versionId, InstantType instant) { + super(); + this.type = type; + this.resourceId = resourceId; + this.versionId = versionId; + this.instant = instant; + } + + /** + * @return {@link #type} (The type of resource that was deleted (required to construct the identity).). 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 BundleEntryDeletedComponent.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 of resource that was deleted (required to construct the identity).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public BundleEntryDeletedComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type of resource that was deleted (required to construct the identity). + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of resource that was deleted (required to construct the identity). + */ + public BundleEntryDeletedComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @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 getResourceIdElement() { + if (this.resourceId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryDeletedComponent.resourceId"); + else if (Configuration.doAutoCreate()) + this.resourceId = new IdType(); + return this.resourceId; + } + + public boolean hasResourceIdElement() { + return this.resourceId != null && !this.resourceId.isEmpty(); + } + + public boolean hasResourceId() { + return this.resourceId != null && !this.resourceId.isEmpty(); + } + + /** + * @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 setResourceIdElement(IdType value) { + this.resourceId = value; + return this; + } + + /** + * @return The id of the resource that was deleted. + */ + public String getResourceId() { + return this.resourceId == null ? null : this.resourceId.getValue(); + } + + /** + * @param value The id of the resource that was deleted. + */ + public BundleEntryDeletedComponent setResourceId(String value) { + if (this.resourceId == null) + this.resourceId = new IdType(); + this.resourceId.setValue(value); + return this; + } + + /** + * @return {@link #versionId} (Version id for releted resource.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public IdType getVersionIdElement() { + if (this.versionId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryDeletedComponent.versionId"); + else if (Configuration.doAutoCreate()) + this.versionId = new IdType(); + return this.versionId; + } + + public boolean hasVersionIdElement() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + public boolean hasVersionId() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + /** + * @param value {@link #versionId} (Version id for releted resource.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public BundleEntryDeletedComponent setVersionIdElement(IdType value) { + this.versionId = value; + return this; + } + + /** + * @return Version id for releted resource. + */ + public String getVersionId() { + return this.versionId == null ? null : this.versionId.getValue(); + } + + /** + * @param value Version id for releted resource. + */ + public BundleEntryDeletedComponent setVersionId(String value) { + if (this.versionId == null) + this.versionId = new IdType(); + this.versionId.setValue(value); + return this; + } + + /** + * @return {@link #instant} (The date/time that the resource was deleted.). This is the underlying object with id, value and extensions. The accessor "getInstant" gives direct access to the value + */ + public InstantType getInstantElement() { + if (this.instant == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create BundleEntryDeletedComponent.instant"); + else if (Configuration.doAutoCreate()) + this.instant = new InstantType(); + return this.instant; + } + + public boolean hasInstantElement() { + return this.instant != null && !this.instant.isEmpty(); + } + + public boolean hasInstant() { + return this.instant != null && !this.instant.isEmpty(); + } + + /** + * @param value {@link #instant} (The date/time that the resource was deleted.). This is the underlying object with id, value and extensions. The accessor "getInstant" gives direct access to the value + */ + public BundleEntryDeletedComponent setInstantElement(InstantType value) { + this.instant = value; + return this; + } + + /** + * @return The date/time that the resource was deleted. + */ + public Date getInstant() { + return this.instant == null ? null : this.instant.getValue(); + } + + /** + * @param value The date/time that the resource was deleted. + */ + public BundleEntryDeletedComponent setInstant(Date value) { + if (this.instant == null) + this.instant = new InstantType(); + this.instant.setValue(value); + return this; + } + + protected void listChildren(List 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("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)); + } + + public BundleEntryDeletedComponent copy() { + BundleEntryDeletedComponent dst = new BundleEntryDeletedComponent(); + copyValues(dst); + dst.type = type == null ? null : type.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()) && (resourceId == null || resourceId.isEmpty()) + && (versionId == null || versionId.isEmpty()) && (instant == null || instant.isEmpty()); + } + + } + + /** + * Indicates the purpose of this bundle- how it was intended to be used. + */ + @Child(name="type", type={CodeType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="document | message | transaction | transaction-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) + protected Enumeration type; + + /** + * The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + */ + @Child(name="base", type={UriType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Stated Base URL", formalDefinition="The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base)." ) + protected UriType base; + + /** + * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + @Child(name="total", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) + protected IntegerType total; + + /** + * A series of links that provide context to this bundle. + */ + @Child(name="link", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) + protected List link; + + /** + * An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only). + */ + @Child(name="entry", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Entry in the bundle - will have deleted or resource", formalDefinition="An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only)." ) + protected List entry; + + /** + * XML Digital Signature - base64 encoded. + */ + @Child(name="signature", type={Base64BinaryType.class}, order=4, min=0, max=1) + @Description(shortDefinition="XML Digital Signature (base64 encoded)", formalDefinition="XML Digital Signature - base64 encoded." ) + protected Base64BinaryType signature; + + private static final long serialVersionUID = -1332054150L; + + public Bundle() { + super(); + } + + public Bundle(Enumeration type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Bundle setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Indicates the purpose of this bundle- how it was intended to be used. + */ + public BundleType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Indicates the purpose of this bundle- how it was intended to be used. + */ + public Bundle setType(BundleType value) { + if (this.type == null) + this.type = new Enumeration(BundleType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public UriType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.base"); + else if (Configuration.doAutoCreate()) + this.base = new UriType(); + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public Bundle setBaseElement(UriType value) { + this.base = value; + return this; + } + + /** + * @return The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + */ + public Bundle setBase(String value) { + if (Utilities.noString(value)) + this.base = null; + else { + if (this.base == null) + this.base = new UriType(); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public IntegerType getTotalElement() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.total"); + else if (Configuration.doAutoCreate()) + this.total = new IntegerType(); + return this.total; + } + + public boolean hasTotalElement() { + return this.total != null && !this.total.isEmpty(); + } + + public boolean hasTotal() { + return this.total != null && !this.total.isEmpty(); + } + + /** + * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value + */ + public Bundle setTotalElement(IntegerType value) { + this.total = value; + return this; + } + + /** + * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + public int getTotal() { + return this.total == null ? null : this.total.getValue(); + } + + /** + * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + */ + public Bundle setTotal(int value) { + if (value == -1) + this.total = null; + else { + if (this.total == null) + this.total = new IntegerType(); + this.total.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (A series of links that provide context to this bundle.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (BundleLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (A series of links that provide context to this bundle.) + */ + // syntactic sugar + public BundleLinkComponent addLink() { //3 + BundleLinkComponent t = new BundleLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + /** + * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (BundleEntryComponent item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).) + */ + // syntactic sugar + public BundleEntryComponent addEntry() { //3 + BundleEntryComponent t = new BundleEntryComponent(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + /** + * @return {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public Base64BinaryType getSignatureElement() { + if (this.signature == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Bundle.signature"); + else if (Configuration.doAutoCreate()) + this.signature = new Base64BinaryType(); + return this.signature; + } + + public boolean hasSignatureElement() { + return this.signature != null && !this.signature.isEmpty(); + } + + public boolean hasSignature() { + return this.signature != null && !this.signature.isEmpty(); + } + + /** + * @param value {@link #signature} (XML Digital Signature - base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public Bundle setSignatureElement(Base64BinaryType value) { + this.signature = value; + return this; + } + + /** + * @return XML Digital Signature - base64 encoded. + */ + public byte[] getSignature() { + return this.signature == null ? null : this.signature.getValue(); + } + + /** + * @param value XML Digital Signature - base64 encoded. + */ + public Bundle setSignature(byte[] value) { + if (value == null) + this.signature = null; + else { + if (this.signature == null) + this.signature = new Base64BinaryType(); + this.signature.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("base", "uri", "The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base).", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("total", "integer", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only).", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("signature", "base64Binary", "XML Digital Signature - base64 encoded.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + public Bundle copy() { + Bundle dst = new Bundle(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.base = base == null ? null : base.copy(); + dst.total = total == null ? null : total.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (BundleLinkComponent i : link) + dst.link.add(i.copy()); + }; + if (entry != null) { + dst.entry = new ArrayList(); + for (BundleEntryComponent i : entry) + dst.entry.add(i.copy()); + }; + dst.signature = signature == null ? null : signature.copy(); + return dst; + } + + protected Bundle typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (base == null || base.isEmpty()) + && (total == null || total.isEmpty()) && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) + && (signature == null || signature.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Bundle; + } + + @SearchParamDefinition(name="message", path="", description="The first resource in the bundle, if the bundle type is 'message' - this is a message header, and this parameter provides access to search it's contents", type="reference" ) + public static final String SP_MESSAGE = "message"; + @SearchParamDefinition(name="composition", path="", description="The first resource in the bundle, if the bundle type is 'document' - this is a composition, and this parameter provides access to searches it's contents", type="reference" ) + public static final String SP_COMPOSITION = "composition"; + @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | history | searchset | collection", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java index d0362680e44..34766d6249c 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java @@ -20,1324 +20,1324 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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="CareActivity", profile="http://hl7.org/fhir/Profile/CareActivity") -public class CareActivity extends DomainResource { - - public enum CareActivityStatus implements FhirEnum { - /** - * Activity is planned but no action has yet been taken. - */ - NOTSTARTED, - /** - * Appointment or other booking has occurred but activity has not yet begun. - */ - SCHEDULED, - /** - * Activity has been started but is not yet complete. - */ - INPROGRESS, - /** - * Activity was started but has temporarily ceased with an expectation of resumption at a future time. - */ - ONHOLD, - /** - * The activities have been completed (more or less) as planned. - */ - COMPLETED, - /** - * The activities have been ended prior to completion (perhaps even before they were started). - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - - public static final CareActivityStatusEnumFactory ENUM_FACTORY = new CareActivityStatusEnumFactory(); - - public static CareActivityStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not started".equals(codeString)) - return NOTSTARTED; - if ("scheduled".equals(codeString)) - return SCHEDULED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("on hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new IllegalArgumentException("Unknown CareActivityStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case NOTSTARTED: return "not started"; - case SCHEDULED: return "scheduled"; - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTSTARTED: return ""; - case SCHEDULED: return ""; - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTSTARTED: return "Activity is planned but no action has yet been taken."; - case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; - case INPROGRESS: return "Activity has been started but is not yet complete."; - case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; - case COMPLETED: return "The activities have been completed (more or less) as planned."; - case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTSTARTED: return "not started"; - case SCHEDULED: return "scheduled"; - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - } - - public static class CareActivityStatusEnumFactory implements EnumFactory { - public CareActivityStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not started".equals(codeString)) - return CareActivityStatus.NOTSTARTED; - if ("scheduled".equals(codeString)) - return CareActivityStatus.SCHEDULED; - if ("in progress".equals(codeString)) - return CareActivityStatus.INPROGRESS; - if ("on hold".equals(codeString)) - return CareActivityStatus.ONHOLD; - if ("completed".equals(codeString)) - return CareActivityStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return CareActivityStatus.CANCELLED; - throw new IllegalArgumentException("Unknown CareActivityStatus code '"+codeString+"'"); - } - public String toCode(CareActivityStatus code) throws IllegalArgumentException { - if (code == CareActivityStatus.NOTSTARTED) - return "not started"; - if (code == CareActivityStatus.SCHEDULED) - return "scheduled"; - if (code == CareActivityStatus.INPROGRESS) - return "in progress"; - if (code == CareActivityStatus.ONHOLD) - return "on hold"; - if (code == CareActivityStatus.COMPLETED) - return "completed"; - if (code == CareActivityStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum CareActivityCategory implements FhirEnum { - /** - * Plan for the patient to consume food of a specified nature. - */ - DIET, - /** - * Plan for the patient to consume/receive a drug, vaccine or other product. - */ - DRUG, - /** - * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). - */ - ENCOUNTER, - /** - * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). - */ - OBSERVATION, - /** - * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). - */ - PROCEDURE, - /** - * Plan to provide something to the patient (medication, medical supply, etc.). - */ - SUPPLY, - /** - * Some other form of action. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - public static final CareActivityCategoryEnumFactory ENUM_FACTORY = new CareActivityCategoryEnumFactory(); - - public static CareActivityCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return DIET; - if ("drug".equals(codeString)) - return DRUG; - if ("encounter".equals(codeString)) - return ENCOUNTER; - if ("observation".equals(codeString)) - return OBSERVATION; - if ("procedure".equals(codeString)) - return PROCEDURE; - if ("supply".equals(codeString)) - return SUPPLY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown CareActivityCategory code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DIET: return "diet"; - case DRUG: return "drug"; - case ENCOUNTER: return "encounter"; - case OBSERVATION: return "observation"; - case PROCEDURE: return "procedure"; - case SUPPLY: return "supply"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DIET: return ""; - case DRUG: return ""; - case ENCOUNTER: return ""; - case OBSERVATION: return ""; - case PROCEDURE: return ""; - case SUPPLY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DIET: return "Plan for the patient to consume food of a specified nature."; - case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; - case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; - case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; - case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; - case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; - case OTHER: return "Some other form of action."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DIET: return "diet"; - case DRUG: return "drug"; - case ENCOUNTER: return "encounter"; - case OBSERVATION: return "observation"; - case PROCEDURE: return "procedure"; - case SUPPLY: return "supply"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class CareActivityCategoryEnumFactory implements EnumFactory { - public CareActivityCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return CareActivityCategory.DIET; - if ("drug".equals(codeString)) - return CareActivityCategory.DRUG; - if ("encounter".equals(codeString)) - return CareActivityCategory.ENCOUNTER; - if ("observation".equals(codeString)) - return CareActivityCategory.OBSERVATION; - if ("procedure".equals(codeString)) - return CareActivityCategory.PROCEDURE; - if ("supply".equals(codeString)) - return CareActivityCategory.SUPPLY; - if ("other".equals(codeString)) - return CareActivityCategory.OTHER; - throw new IllegalArgumentException("Unknown CareActivityCategory code '"+codeString+"'"); - } - public String toCode(CareActivityCategory code) throws IllegalArgumentException { - if (code == CareActivityCategory.DIET) - return "diet"; - if (code == CareActivityCategory.DRUG) - return "drug"; - if (code == CareActivityCategory.ENCOUNTER) - return "encounter"; - if (code == CareActivityCategory.OBSERVATION) - return "observation"; - if (code == CareActivityCategory.PROCEDURE) - return "procedure"; - if (code == CareActivityCategory.SUPPLY) - return "supply"; - if (code == CareActivityCategory.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class CareActivitySimpleComponent extends BackboneElement { - /** - * High-level categorization of the type of activity in a care plan. - */ - @Child(name="category", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) - protected Enumeration category; - - /** - * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. - */ - @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter." ) - protected CodeableConcept code; - - /** - * The period, timing or frequency upon which the described activity is to occur. - */ - @Child(name="scheduled", type={Timing.class, Period.class, StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) - protected Type scheduled; - - /** - * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. - */ - @Child(name="location", type={Location.class}, order=4, min=0, max=1) - @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - protected Location locationTarget; - - /** - * Identifies who's expected to be involved in the activity. - */ - @Child(name="performer", type={Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who's responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) - */ - protected List performerTarget; - - - /** - * Identifies the food, drug or other product being consumed or supplied in the activity. - */ - @Child(name="product", type={Medication.class, Substance.class}, order=6, min=0, max=1) - @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." ) - protected Reference product; - - /** - * The actual object that is the target of the reference (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - protected Resource productTarget; - - /** - * Identifies the quantity expected to be consumed in a given day. - */ - @Child(name="dailyAmount", type={Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="How much consumed/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) - protected Quantity dailyAmount; - - /** - * Identifies the quantity expected to be supplied. - */ - @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) - @Description(shortDefinition="How much is administered/supplied/consumed", formalDefinition="Identifies the quantity expected to be supplied." ) - protected Quantity quantity; - - /** - * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - @Child(name="details", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) - protected StringType details; - - private static final long serialVersionUID = -17133504L; - - public CareActivitySimpleComponent() { - super(); - } - - public CareActivitySimpleComponent(Enumeration category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(); - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public CareActivitySimpleComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return High-level categorization of the type of activity in a care plan. - */ - public CareActivityCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value High-level categorization of the type of activity in a care plan. - */ - public CareActivitySimpleComponent setCategory(CareActivityCategory value) { - if (this.category == null) - this.category = new Enumeration(CareActivityCategory.ENUM_FACTORY); - this.category.setValue(value); - return this; - } - - /** - * @return {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) - */ - public CareActivitySimpleComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Timing getScheduledTiming() throws Exception { - if (!(this.scheduled instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Period getScheduledPeriod() throws Exception { - if (!(this.scheduled instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public StringType getScheduledStringType() throws Exception { - if (!(this.scheduled instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (StringType) this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public CareActivitySimpleComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public CareActivitySimpleComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public CareActivitySimpleComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - /** - * @return {@link #performer} (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 who's expected to be involved in the activity.) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public Reference getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.product"); - else if (Configuration.doAutoCreate()) - this.product = new Reference(); - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public CareActivitySimpleComponent setProduct(Reference value) { - this.product = value; - return this; - } - - /** - * @return {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) - */ - public Resource getProductTarget() { - return this.productTarget; - } - - /** - * @param value {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) - */ - public CareActivitySimpleComponent setProductTarget(Resource value) { - this.productTarget = value; - return this; - } - - /** - * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public Quantity getDailyAmount() { - if (this.dailyAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.dailyAmount"); - else if (Configuration.doAutoCreate()) - this.dailyAmount = new Quantity(); - return this.dailyAmount; - } - - public boolean hasDailyAmount() { - return this.dailyAmount != null && !this.dailyAmount.isEmpty(); - } - - /** - * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public CareActivitySimpleComponent setDailyAmount(Quantity value) { - this.dailyAmount = value; - return this; - } - - /** - * @return {@link #quantity} (Identifies the quantity expected to be supplied.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Identifies the quantity expected to be supplied.) - */ - public CareActivitySimpleComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public StringType getDetailsElement() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivitySimpleComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new StringType(); - return this.details; - } - - public boolean hasDetailsElement() { - return this.details != null && !this.details.isEmpty(); - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public CareActivitySimpleComponent setDetailsElement(StringType value) { - this.details = value; - return this; - } - - /** - * @return This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - public String getDetails() { - return this.details == null ? null : this.details.getValue(); - } - - /** - * @param value This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - public CareActivitySimpleComponent setDetails(String value) { - if (Utilities.noString(value)) - this.details = null; - else { - if (this.details == null) - this.details = new StringType(); - this.details.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); - childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("details", "string", "This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, details)); - } - - public CareActivitySimpleComponent copy() { - CareActivitySimpleComponent dst = new CareActivitySimpleComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.location = location == null ? null : location.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.product = product == null ? null : product.copy(); - dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.details = details == null ? null : details.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) - && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (details == null || details.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; - - /** - * 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; - - /** - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. - */ - @Child(name="goal", type={Goal.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) - protected List goal; - /** - * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - protected List goalTarget; - - - /** - * Identifies what progress is being made for the specific activity. - */ - @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="not started | scheduled | in progress | on hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) - protected Enumeration status; - - /** - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - @Child(name="prohibited", type={BooleanType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) - protected BooleanType prohibited; - - /** - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - */ - @Child(name="actionResulting", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) - protected List actionResulting; - /** - * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - protected List actionResultingTarget; - - - /** - * Notes about the execution of the activity. - */ - @Child(name="notes", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) - protected StringType notes; - - /** - * The details of the proposed activity represented in a specific resource. - */ - @Child(name="detail", type={Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, Encounter.class, Supply.class}, order=6, min=0, max=1) - @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) - protected Reference detail; - - /** - * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) - */ - protected Resource detailTarget; - - /** - * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. - */ - @Child(name="simple", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Activity details summarised here", formalDefinition="A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) - protected CareActivitySimpleComponent simple; - - private static final long serialVersionUID = 1711521518L; - - public CareActivity() { - super(); - } - - public CareActivity(BooleanType prohibited) { - super(); - this.prohibited = prohibited; - } - - /** - * @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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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(); - 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 CareActivity.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 CareActivity 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 CareActivity.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 CareActivity setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - 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} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - // syntactic sugar - public Reference addGoal() { //3 - Reference t = new Reference(); - if (this.goal == null) - this.goal = new ArrayList(); - 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. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoalTarget() { - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - 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. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public Goal addGoalTarget() { - Goal r = new Goal(); - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - this.goalTarget.add(r); - return r; - } - - /** - * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivity.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CareActivity setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Identifies what progress is being made for the specific activity. - */ - public CareActivityStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Identifies what progress is being made for the specific activity. - */ - public CareActivity setStatus(CareActivityStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(CareActivityStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public BooleanType getProhibitedElement() { - if (this.prohibited == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivity.prohibited"); - else if (Configuration.doAutoCreate()) - this.prohibited = new BooleanType(); - return this.prohibited; - } - - public boolean hasProhibitedElement() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - public boolean hasProhibited() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - /** - * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public CareActivity setProhibitedElement(BooleanType value) { - this.prohibited = value; - return this; - } - - /** - * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public boolean getProhibited() { - return this.prohibited == null ? false : this.prohibited.getValue(); - } - - /** - * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public CareActivity setProhibited(boolean value) { - if (this.prohibited == null) - this.prohibited = new BooleanType(); - this.prohibited.setValue(value); - return this; - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResulting() { - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - return this.actionResulting; - } - - public boolean hasActionResulting() { - if (this.actionResulting == null) - return false; - for (Reference item : this.actionResulting) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - // syntactic sugar - public Reference addActionResulting() { //3 - Reference t = new Reference(); - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - this.actionResulting.add(t); - return t; - } - - /** - * @return {@link #actionResulting} (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. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResultingTarget() { - if (this.actionResultingTarget == null) - this.actionResultingTarget = new ArrayList(); - return this.actionResultingTarget; - } - - /** - * @return {@link #notes} (Notes about the execution of the activity.). 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 CareActivity.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} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public CareActivity setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Notes about the execution of the activity. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Notes about the execution of the activity. - */ - public CareActivity 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 #detail} (The details of the proposed activity represented in a specific resource.) - */ - public Reference getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivity.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new Reference(); - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (The details of the proposed activity represented in a specific resource.) - */ - public CareActivity setDetail(Reference value) { - this.detail = value; - return this; - } - - /** - * @return {@link #detail} 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 details of the proposed activity represented in a specific resource.) - */ - public Resource getDetailTarget() { - return this.detailTarget; - } - - /** - * @param value {@link #detail} 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 details of the proposed activity represented in a specific resource.) - */ - public CareActivity setDetailTarget(Resource value) { - this.detailTarget = value; - return this; - } - - /** - * @return {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CareActivitySimpleComponent getSimple() { - if (this.simple == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareActivity.simple"); - else if (Configuration.doAutoCreate()) - this.simple = new CareActivitySimpleComponent(); - return this.simple; - } - - public boolean hasSimple() { - return this.simple != null && !this.simple.isEmpty(); - } - - /** - * @param value {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CareActivity setSimple(CareActivitySimpleComponent value) { - this.simple = value; - return this; - } - - protected void listChildren(List 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("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); - childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); - childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("detail", "Reference(Procedure|MedicationPrescription|DiagnosticOrder|Encounter|Supply)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("simple", "", "A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, simple)); - } - - public CareActivity copy() { - CareActivity dst = new CareActivity(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (goal != null) { - dst.goal = new ArrayList(); - for (Reference i : goal) - dst.goal.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.prohibited = prohibited == null ? null : prohibited.copy(); - if (actionResulting != null) { - dst.actionResulting = new ArrayList(); - for (Reference i : actionResulting) - dst.actionResulting.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - dst.detail = detail == null ? null : detail.copy(); - dst.simple = simple == null ? null : simple.copy(); - return dst; - } - - protected CareActivity typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) && (prohibited == null || prohibited.isEmpty()) - && (actionResulting == null || actionResulting.isEmpty()) && (notes == null || notes.isEmpty()) - && (detail == null || detail.isEmpty()) && (simple == null || simple.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CareActivity; - } - - @SearchParamDefinition(name="activitycode", path="CareActivity.simple.code", description="Detail type of activity", type="token" ) - public static final String SP_ACTIVITYCODE = "activitycode"; - @SearchParamDefinition(name="patient", path="CareActivity.patient", description="Who care plan is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="activitydetail", path="CareActivity.detail", description="Activity details defined in specific resource", type="reference" ) - public static final String SP_ACTIVITYDETAIL = "activitydetail"; - @SearchParamDefinition(name="activitydate", path="CareActivity.simple.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) - public static final String SP_ACTIVITYDATE = "activitydate"; - -} - + +/* + 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="CareActivity", profile="http://hl7.org/fhir/Profile/CareActivity") +public class CareActivity extends DomainResource { + + public enum CareActivityStatus implements FhirEnum { + /** + * Activity is planned but no action has yet been taken. + */ + NOTSTARTED, + /** + * Appointment or other booking has occurred but activity has not yet begun. + */ + SCHEDULED, + /** + * Activity has been started but is not yet complete. + */ + INPROGRESS, + /** + * Activity was started but has temporarily ceased with an expectation of resumption at a future time. + */ + ONHOLD, + /** + * The activities have been completed (more or less) as planned. + */ + COMPLETED, + /** + * The activities have been ended prior to completion (perhaps even before they were started). + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + public static final CareActivityStatusEnumFactory ENUM_FACTORY = new CareActivityStatusEnumFactory(); + + public static CareActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not started".equals(codeString)) + return NOTSTARTED; + if ("scheduled".equals(codeString)) + return SCHEDULED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("on hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown CareActivityStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NOTSTARTED: return "not started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTSTARTED: return ""; + case SCHEDULED: return ""; + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTSTARTED: return "Activity is planned but no action has yet been taken."; + case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; + case INPROGRESS: return "Activity has been started but is not yet complete."; + case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; + case COMPLETED: return "The activities have been completed (more or less) as planned."; + case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTSTARTED: return "not started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + } + + public static class CareActivityStatusEnumFactory implements EnumFactory { + public CareActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not started".equals(codeString)) + return CareActivityStatus.NOTSTARTED; + if ("scheduled".equals(codeString)) + return CareActivityStatus.SCHEDULED; + if ("in progress".equals(codeString)) + return CareActivityStatus.INPROGRESS; + if ("on hold".equals(codeString)) + return CareActivityStatus.ONHOLD; + if ("completed".equals(codeString)) + return CareActivityStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return CareActivityStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CareActivityStatus code '"+codeString+"'"); + } + public String toCode(CareActivityStatus code) throws IllegalArgumentException { + if (code == CareActivityStatus.NOTSTARTED) + return "not started"; + if (code == CareActivityStatus.SCHEDULED) + return "scheduled"; + if (code == CareActivityStatus.INPROGRESS) + return "in progress"; + if (code == CareActivityStatus.ONHOLD) + return "on hold"; + if (code == CareActivityStatus.COMPLETED) + return "completed"; + if (code == CareActivityStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum CareActivityCategory implements FhirEnum { + /** + * Plan for the patient to consume food of a specified nature. + */ + DIET, + /** + * Plan for the patient to consume/receive a drug, vaccine or other product. + */ + DRUG, + /** + * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). + */ + ENCOUNTER, + /** + * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). + */ + OBSERVATION, + /** + * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). + */ + PROCEDURE, + /** + * Plan to provide something to the patient (medication, medical supply, etc.). + */ + SUPPLY, + /** + * Some other form of action. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + public static final CareActivityCategoryEnumFactory ENUM_FACTORY = new CareActivityCategoryEnumFactory(); + + public static CareActivityCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return DIET; + if ("drug".equals(codeString)) + return DRUG; + if ("encounter".equals(codeString)) + return ENCOUNTER; + if ("observation".equals(codeString)) + return OBSERVATION; + if ("procedure".equals(codeString)) + return PROCEDURE; + if ("supply".equals(codeString)) + return SUPPLY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown CareActivityCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DIET: return ""; + case DRUG: return ""; + case ENCOUNTER: return ""; + case OBSERVATION: return ""; + case PROCEDURE: return ""; + case SUPPLY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DIET: return "Plan for the patient to consume food of a specified nature."; + case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; + case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; + case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; + case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; + case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; + case OTHER: return "Some other form of action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class CareActivityCategoryEnumFactory implements EnumFactory { + public CareActivityCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return CareActivityCategory.DIET; + if ("drug".equals(codeString)) + return CareActivityCategory.DRUG; + if ("encounter".equals(codeString)) + return CareActivityCategory.ENCOUNTER; + if ("observation".equals(codeString)) + return CareActivityCategory.OBSERVATION; + if ("procedure".equals(codeString)) + return CareActivityCategory.PROCEDURE; + if ("supply".equals(codeString)) + return CareActivityCategory.SUPPLY; + if ("other".equals(codeString)) + return CareActivityCategory.OTHER; + throw new IllegalArgumentException("Unknown CareActivityCategory code '"+codeString+"'"); + } + public String toCode(CareActivityCategory code) throws IllegalArgumentException { + if (code == CareActivityCategory.DIET) + return "diet"; + if (code == CareActivityCategory.DRUG) + return "drug"; + if (code == CareActivityCategory.ENCOUNTER) + return "encounter"; + if (code == CareActivityCategory.OBSERVATION) + return "observation"; + if (code == CareActivityCategory.PROCEDURE) + return "procedure"; + if (code == CareActivityCategory.SUPPLY) + return "supply"; + if (code == CareActivityCategory.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class CareActivitySimpleComponent extends BackboneElement { + /** + * High-level categorization of the type of activity in a care plan. + */ + @Child(name="category", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) + protected Enumeration category; + + /** + * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. + */ + @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter." ) + protected CodeableConcept code; + + /** + * The period, timing or frequency upon which the described activity is to occur. + */ + @Child(name="scheduled", type={Timing.class, Period.class, StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) + protected Type scheduled; + + /** + * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. + */ + @Child(name="location", type={Location.class}, order=4, min=0, max=1) + @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + protected Location locationTarget; + + /** + * Identifies who's expected to be involved in the activity. + */ + @Child(name="performer", type={Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who's responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) + */ + protected List performerTarget; + + + /** + * Identifies the food, drug or other product being consumed or supplied in the activity. + */ + @Child(name="product", type={Medication.class, Substance.class}, order=6, min=0, max=1) + @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." ) + protected Reference product; + + /** + * The actual object that is the target of the reference (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + protected Resource productTarget; + + /** + * Identifies the quantity expected to be consumed in a given day. + */ + @Child(name="dailyAmount", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="How much consumed/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) + protected Quantity dailyAmount; + + /** + * Identifies the quantity expected to be supplied. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="How much is administered/supplied/consumed", formalDefinition="Identifies the quantity expected to be supplied." ) + protected Quantity quantity; + + /** + * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + @Child(name="details", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) + protected StringType details; + + private static final long serialVersionUID = -17133504L; + + public CareActivitySimpleComponent() { + super(); + } + + public CareActivitySimpleComponent(Enumeration category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public CareActivitySimpleComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return High-level categorization of the type of activity in a care plan. + */ + public CareActivityCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value High-level categorization of the type of activity in a care plan. + */ + public CareActivitySimpleComponent setCategory(CareActivityCategory value) { + if (this.category == null) + this.category = new Enumeration(CareActivityCategory.ENUM_FACTORY); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CareActivitySimpleComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public StringType getScheduledStringType() throws Exception { + if (!(this.scheduled instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (StringType) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public CareActivitySimpleComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CareActivitySimpleComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CareActivitySimpleComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (Reference item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + /** + * @return {@link #performer} (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 who's expected to be involved in the activity.) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public Reference getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Reference(); + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public CareActivitySimpleComponent setProduct(Reference value) { + this.product = value; + return this; + } + + /** + * @return {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) + */ + public Resource getProductTarget() { + return this.productTarget; + } + + /** + * @param value {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) + */ + public CareActivitySimpleComponent setProductTarget(Resource value) { + this.productTarget = value; + return this; + } + + /** + * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public Quantity getDailyAmount() { + if (this.dailyAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.dailyAmount"); + else if (Configuration.doAutoCreate()) + this.dailyAmount = new Quantity(); + return this.dailyAmount; + } + + public boolean hasDailyAmount() { + return this.dailyAmount != null && !this.dailyAmount.isEmpty(); + } + + /** + * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public CareActivitySimpleComponent setDailyAmount(Quantity value) { + this.dailyAmount = value; + return this; + } + + /** + * @return {@link #quantity} (Identifies the quantity expected to be supplied.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Identifies the quantity expected to be supplied.) + */ + public CareActivitySimpleComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public StringType getDetailsElement() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new StringType(); + return this.details; + } + + public boolean hasDetailsElement() { + return this.details != null && !this.details.isEmpty(); + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public CareActivitySimpleComponent setDetailsElement(StringType value) { + this.details = value; + return this; + } + + /** + * @return This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public String getDetails() { + return this.details == null ? null : this.details.getValue(); + } + + /** + * @param value This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public CareActivitySimpleComponent setDetails(String value) { + if (Utilities.noString(value)) + this.details = null; + else { + if (this.details == null) + this.details = new StringType(); + this.details.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); + childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("details", "string", "This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, details)); + } + + public CareActivitySimpleComponent copy() { + CareActivitySimpleComponent dst = new CareActivitySimpleComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.location = location == null ? null : location.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.product = product == null ? null : product.copy(); + dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.details = details == null ? null : details.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) + && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (details == null || details.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; + + /** + * 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; + + /** + * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. + */ + @Child(name="goal", type={Goal.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) + protected List goal; + /** + * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + protected List goalTarget; + + + /** + * Identifies what progress is being made for the specific activity. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="not started | scheduled | in progress | on hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) + protected Enumeration status; + + /** + * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + @Child(name="prohibited", type={BooleanType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) + protected BooleanType prohibited; + + /** + * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. + */ + @Child(name="actionResulting", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) + protected List actionResulting; + /** + * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + protected List actionResultingTarget; + + + /** + * Notes about the execution of the activity. + */ + @Child(name="notes", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) + protected StringType notes; + + /** + * The details of the proposed activity represented in a specific resource. + */ + @Child(name="detail", type={Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, Encounter.class, Supply.class}, order=6, min=0, max=1) + @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) + protected Reference detail; + + /** + * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) + */ + protected Resource detailTarget; + + /** + * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. + */ + @Child(name="simple", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Activity details summarised here", formalDefinition="A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) + protected CareActivitySimpleComponent simple; + + private static final long serialVersionUID = 1711521518L; + + public CareActivity() { + super(); + } + + public CareActivity(BooleanType prohibited) { + super(); + this.prohibited = prohibited; + } + + /** + * @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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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(); + 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 CareActivity.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 CareActivity 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 CareActivity.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 CareActivity setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + 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} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + // syntactic sugar + public Reference addGoal() { //3 + Reference t = new Reference(); + if (this.goal == null) + this.goal = new ArrayList(); + 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. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoalTarget() { + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + 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. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public Goal addGoalTarget() { + Goal r = new Goal(); + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + this.goalTarget.add(r); + return r; + } + + /** + * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CareActivity setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies what progress is being made for the specific activity. + */ + public CareActivityStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies what progress is being made for the specific activity. + */ + public CareActivity setStatus(CareActivityStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(CareActivityStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public BooleanType getProhibitedElement() { + if (this.prohibited == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.prohibited"); + else if (Configuration.doAutoCreate()) + this.prohibited = new BooleanType(); + return this.prohibited; + } + + public boolean hasProhibitedElement() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + public boolean hasProhibited() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + /** + * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public CareActivity setProhibitedElement(BooleanType value) { + this.prohibited = value; + return this; + } + + /** + * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public boolean getProhibited() { + return this.prohibited == null ? false : this.prohibited.getValue(); + } + + /** + * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public CareActivity setProhibited(boolean value) { + if (this.prohibited == null) + this.prohibited = new BooleanType(); + this.prohibited.setValue(value); + return this; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResulting() { + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + return this.actionResulting; + } + + public boolean hasActionResulting() { + if (this.actionResulting == null) + return false; + for (Reference item : this.actionResulting) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + // syntactic sugar + public Reference addActionResulting() { //3 + Reference t = new Reference(); + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + this.actionResulting.add(t); + return t; + } + + /** + * @return {@link #actionResulting} (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. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResultingTarget() { + if (this.actionResultingTarget == null) + this.actionResultingTarget = new ArrayList(); + return this.actionResultingTarget; + } + + /** + * @return {@link #notes} (Notes about the execution of the activity.). 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 CareActivity.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} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public CareActivity setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Notes about the execution of the activity. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Notes about the execution of the activity. + */ + public CareActivity 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 #detail} (The details of the proposed activity represented in a specific resource.) + */ + public Reference getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new Reference(); + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (The details of the proposed activity represented in a specific resource.) + */ + public CareActivity setDetail(Reference value) { + this.detail = value; + return this; + } + + /** + * @return {@link #detail} 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 details of the proposed activity represented in a specific resource.) + */ + public Resource getDetailTarget() { + return this.detailTarget; + } + + /** + * @param value {@link #detail} 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 details of the proposed activity represented in a specific resource.) + */ + public CareActivity setDetailTarget(Resource value) { + this.detailTarget = value; + return this; + } + + /** + * @return {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CareActivitySimpleComponent getSimple() { + if (this.simple == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.simple"); + else if (Configuration.doAutoCreate()) + this.simple = new CareActivitySimpleComponent(); + return this.simple; + } + + public boolean hasSimple() { + return this.simple != null && !this.simple.isEmpty(); + } + + /** + * @param value {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CareActivity setSimple(CareActivitySimpleComponent value) { + this.simple = value; + return this; + } + + protected void listChildren(List 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("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); + childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); + childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("detail", "Reference(Procedure|MedicationPrescription|DiagnosticOrder|Encounter|Supply)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("simple", "", "A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, simple)); + } + + public CareActivity copy() { + CareActivity dst = new CareActivity(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (goal != null) { + dst.goal = new ArrayList(); + for (Reference i : goal) + dst.goal.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.prohibited = prohibited == null ? null : prohibited.copy(); + if (actionResulting != null) { + dst.actionResulting = new ArrayList(); + for (Reference i : actionResulting) + dst.actionResulting.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + dst.detail = detail == null ? null : detail.copy(); + dst.simple = simple == null ? null : simple.copy(); + return dst; + } + + protected CareActivity typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) && (prohibited == null || prohibited.isEmpty()) + && (actionResulting == null || actionResulting.isEmpty()) && (notes == null || notes.isEmpty()) + && (detail == null || detail.isEmpty()) && (simple == null || simple.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CareActivity; + } + + @SearchParamDefinition(name="activitycode", path="CareActivity.simple.code", description="Detail type of activity", type="token" ) + public static final String SP_ACTIVITYCODE = "activitycode"; + @SearchParamDefinition(name="patient", path="CareActivity.patient", description="Who care plan is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="activitydetail", path="CareActivity.detail", description="Activity details defined in specific resource", type="reference" ) + public static final String SP_ACTIVITYDETAIL = "activitydetail"; + @SearchParamDefinition(name="activitydate", path="CareActivity.simple.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) + public static final String SP_ACTIVITYDATE = "activitydate"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java index a358c910d6c..21f77a17eb3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java @@ -20,2341 +20,2341 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") -public class CarePlan extends DomainResource { - - public enum CarePlanStatus 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 CarePlanStatusEnumFactory ENUM_FACTORY = new CarePlanStatusEnumFactory(); - - public static CarePlanStatus 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 CarePlanStatus 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 CarePlanStatusEnumFactory implements EnumFactory { - public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return CarePlanStatus.PLANNED; - if ("active".equals(codeString)) - return CarePlanStatus.ACTIVE; - if ("completed".equals(codeString)) - return CarePlanStatus.COMPLETED; - throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); - } - public String toCode(CarePlanStatus code) throws IllegalArgumentException { - if (code == CarePlanStatus.PLANNED) - return "planned"; - if (code == CarePlanStatus.ACTIVE) - return "active"; - if (code == CarePlanStatus.COMPLETED) - return "completed"; - return "?"; - } - } - - 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). - */ - 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 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)) - return INPROGRESS; - if ("achieved".equals(codeString)) - return ACHIEVED; - if ("sustaining".equals(codeString)) - return SUSTAINING; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanGoalStatus 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 CarePlanGoalStatusEnumFactory implements EnumFactory { - public CarePlanGoalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in progress".equals(codeString)) - return CarePlanGoalStatus.INPROGRESS; - if ("achieved".equals(codeString)) - return CarePlanGoalStatus.ACHIEVED; - if ("sustaining".equals(codeString)) - return CarePlanGoalStatus.SUSTAINING; - if ("cancelled".equals(codeString)) - return CarePlanGoalStatus.CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanGoalStatus code '"+codeString+"'"); - } - public String toCode(CarePlanGoalStatus code) throws IllegalArgumentException { - if (code == CarePlanGoalStatus.INPROGRESS) - return "in progress"; - if (code == CarePlanGoalStatus.ACHIEVED) - return "achieved"; - if (code == CarePlanGoalStatus.SUSTAINING) - return "sustaining"; - if (code == CarePlanGoalStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum CarePlanActivityStatus implements FhirEnum { - /** - * Activity is planned but no action has yet been taken. - */ - NOTSTARTED, - /** - * Appointment or other booking has occurred but activity has not yet begun. - */ - SCHEDULED, - /** - * Activity has been started but is not yet complete. - */ - INPROGRESS, - /** - * Activity was started but has temporarily ceased with an expectation of resumption at a future time. - */ - ONHOLD, - /** - * The activities have been completed (more or less) as planned. - */ - COMPLETED, - /** - * The activities have been ended prior to completion (perhaps even before they were started). - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return NOTSTARTED; - if ("scheduled".equals(codeString)) - return SCHEDULED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("on hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case NOTSTARTED: return "not started"; - case SCHEDULED: return "scheduled"; - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTSTARTED: return ""; - case SCHEDULED: return ""; - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTSTARTED: return "Activity is planned but no action has yet been taken."; - case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; - case INPROGRESS: return "Activity has been started but is not yet complete."; - case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; - case COMPLETED: return "The activities have been completed (more or less) as planned."; - case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTSTARTED: return "not started"; - case SCHEDULED: return "scheduled"; - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - } - - public static class CarePlanActivityStatusEnumFactory implements EnumFactory { - public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not started".equals(codeString)) - return CarePlanActivityStatus.NOTSTARTED; - if ("scheduled".equals(codeString)) - return CarePlanActivityStatus.SCHEDULED; - if ("in progress".equals(codeString)) - return CarePlanActivityStatus.INPROGRESS; - if ("on hold".equals(codeString)) - return CarePlanActivityStatus.ONHOLD; - if ("completed".equals(codeString)) - return CarePlanActivityStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return CarePlanActivityStatus.CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - public String toCode(CarePlanActivityStatus code) throws IllegalArgumentException { - if (code == CarePlanActivityStatus.NOTSTARTED) - return "not started"; - if (code == CarePlanActivityStatus.SCHEDULED) - return "scheduled"; - if (code == CarePlanActivityStatus.INPROGRESS) - return "in progress"; - if (code == CarePlanActivityStatus.ONHOLD) - return "on hold"; - if (code == CarePlanActivityStatus.COMPLETED) - return "completed"; - if (code == CarePlanActivityStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum CarePlanActivityCategory implements FhirEnum { - /** - * Plan for the patient to consume food of a specified nature. - */ - DIET, - /** - * Plan for the patient to consume/receive a drug, vaccine or other product. - */ - DRUG, - /** - * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). - */ - ENCOUNTER, - /** - * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). - */ - OBSERVATION, - /** - * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). - */ - PROCEDURE, - /** - * Plan to provide something to the patient (medication, medical supply, etc.). - */ - SUPPLY, - /** - * Some other form of action. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DIET; - if ("drug".equals(codeString)) - return DRUG; - if ("encounter".equals(codeString)) - return ENCOUNTER; - if ("observation".equals(codeString)) - return OBSERVATION; - if ("procedure".equals(codeString)) - return PROCEDURE; - if ("supply".equals(codeString)) - return SUPPLY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DIET: return "diet"; - case DRUG: return "drug"; - case ENCOUNTER: return "encounter"; - case OBSERVATION: return "observation"; - case PROCEDURE: return "procedure"; - case SUPPLY: return "supply"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DIET: return ""; - case DRUG: return ""; - case ENCOUNTER: return ""; - case OBSERVATION: return ""; - case PROCEDURE: return ""; - case SUPPLY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DIET: return "Plan for the patient to consume food of a specified nature."; - case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; - case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; - case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; - case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; - case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; - case OTHER: return "Some other form of action."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DIET: return "diet"; - case DRUG: return "drug"; - case ENCOUNTER: return "encounter"; - case OBSERVATION: return "observation"; - case PROCEDURE: return "procedure"; - case SUPPLY: return "supply"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class CarePlanActivityCategoryEnumFactory implements EnumFactory { - public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return CarePlanActivityCategory.DIET; - if ("drug".equals(codeString)) - return CarePlanActivityCategory.DRUG; - if ("encounter".equals(codeString)) - return CarePlanActivityCategory.ENCOUNTER; - if ("observation".equals(codeString)) - return CarePlanActivityCategory.OBSERVATION; - if ("procedure".equals(codeString)) - return CarePlanActivityCategory.PROCEDURE; - if ("supply".equals(codeString)) - return CarePlanActivityCategory.SUPPLY; - if ("other".equals(codeString)) - return CarePlanActivityCategory.OTHER; - throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); - } - public String toCode(CarePlanActivityCategory code) throws IllegalArgumentException { - if (code == CarePlanActivityCategory.DIET) - return "diet"; - if (code == CarePlanActivityCategory.DRUG) - return "drug"; - if (code == CarePlanActivityCategory.ENCOUNTER) - return "encounter"; - if (code == CarePlanActivityCategory.OBSERVATION) - return "observation"; - if (code == CarePlanActivityCategory.PROCEDURE) - return "procedure"; - if (code == CarePlanActivityCategory.SUPPLY) - return "supply"; - if (code == CarePlanActivityCategory.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class CarePlanParticipantComponent 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 CarePlanParticipantComponent() { - super(); - } - - public CarePlanParticipantComponent(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 CarePlanParticipantComponent.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 CarePlanParticipantComponent 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 CarePlanParticipantComponent.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 CarePlanParticipantComponent 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 CarePlanParticipantComponent setMemberTarget(Resource value) { - this.memberTarget = value; - return this; - } - - protected void listChildren(List 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 CarePlanParticipantComponent copy() { - CarePlanParticipantComponent dst = new CarePlanParticipantComponent(); - 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()) - ; - } - - } - - @Block() - public static class CarePlanGoalComponent extends BackboneElement { - /** - * 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 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 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 concernTarget; - - - private static final long serialVersionUID = -1557229012L; - - public CarePlanGoalComponent() { - super(); - } - - public CarePlanGoalComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @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 CarePlanGoalComponent.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 CarePlanGoalComponent 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 CarePlanGoalComponent 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 getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanGoalComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 CarePlanGoalComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the goal has been reached and is still considered relevant. - */ - public CarePlanGoalStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the goal has been reached and is still considered relevant. - */ - public CarePlanGoalComponent setStatus(CarePlanGoalStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(CarePlanGoalStatus.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 CarePlanGoalComponent.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 CarePlanGoalComponent 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 CarePlanGoalComponent 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 getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - 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(); - 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 getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - 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(); - this.concernTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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 CarePlanGoalComponent copy() { - CarePlanGoalComponent dst = new CarePlanGoalComponent(); - copyValues(dst); - 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(); - for (Reference i : concern) - dst.concern.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) - && (notes == null || notes.isEmpty()) && (concern == null || concern.isEmpty()); - } - - } - - @Block() - public static class CarePlanActivityComponent extends BackboneElement { - /** - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. - */ - @Child(name="goal", type={UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) - protected List goal; - - /** - * Identifies what progress is being made for the specific activity. - */ - @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="not started | scheduled | in progress | on hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) - protected Enumeration status; - - /** - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - @Child(name="prohibited", type={BooleanType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) - protected BooleanType prohibited; - - /** - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - */ - @Child(name="actionResulting", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) - protected List actionResulting; - /** - * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - protected List actionResultingTarget; - - - /** - * Notes about the execution of the activity. - */ - @Child(name="notes", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) - protected StringType notes; - - /** - * The details of the proposed activity represented in a specific resource. - */ - @Child(name="detail", type={Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, Encounter.class, Supply.class}, order=6, min=0, max=1) - @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) - protected Reference detail; - - /** - * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) - */ - protected Resource detailTarget; - - /** - * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. - */ - @Child(name="simple", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Activity details summarised here", formalDefinition="A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) - protected CarePlanActivitySimpleComponent simple; - - private static final long serialVersionUID = -1536095647L; - - public CarePlanActivityComponent() { - super(); - } - - public CarePlanActivityComponent(BooleanType prohibited) { - super(); - this.prohibited = prohibited; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - return this.goal; - } - - public boolean hasGoal() { - if (this.goal == null) - return false; - for (UriType item : this.goal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - // syntactic sugar - public UriType addGoalElement() {//2 - UriType t = new UriType(); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return t; - } - - /** - * @param value {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public CarePlanActivityComponent addGoal(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return this; - } - - /** - * @param value {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public boolean hasGoal(String value) { - if (this.goal == null) - return false; - for (UriType v : this.goal) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CarePlanActivityComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Identifies what progress is being made for the specific activity. - */ - public CarePlanActivityStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Identifies what progress is being made for the specific activity. - */ - public CarePlanActivityComponent setStatus(CarePlanActivityStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(CarePlanActivityStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public BooleanType getProhibitedElement() { - if (this.prohibited == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.prohibited"); - else if (Configuration.doAutoCreate()) - this.prohibited = new BooleanType(); - return this.prohibited; - } - - public boolean hasProhibitedElement() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - public boolean hasProhibited() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - /** - * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public CarePlanActivityComponent setProhibitedElement(BooleanType value) { - this.prohibited = value; - return this; - } - - /** - * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public boolean getProhibited() { - return this.prohibited == null ? false : this.prohibited.getValue(); - } - - /** - * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public CarePlanActivityComponent setProhibited(boolean value) { - if (this.prohibited == null) - this.prohibited = new BooleanType(); - this.prohibited.setValue(value); - return this; - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResulting() { - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - return this.actionResulting; - } - - public boolean hasActionResulting() { - if (this.actionResulting == null) - return false; - for (Reference item : this.actionResulting) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - // syntactic sugar - public Reference addActionResulting() { //3 - Reference t = new Reference(); - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - this.actionResulting.add(t); - return t; - } - - /** - * @return {@link #actionResulting} (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. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResultingTarget() { - if (this.actionResultingTarget == null) - this.actionResultingTarget = new ArrayList(); - return this.actionResultingTarget; - } - - /** - * @return {@link #notes} (Notes about the execution of the activity.). 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 CarePlanActivityComponent.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} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public CarePlanActivityComponent setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Notes about the execution of the activity. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Notes about the execution of the activity. - */ - public CarePlanActivityComponent 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 #detail} (The details of the proposed activity represented in a specific resource.) - */ - public Reference getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new Reference(); - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (The details of the proposed activity represented in a specific resource.) - */ - public CarePlanActivityComponent setDetail(Reference value) { - this.detail = value; - return this; - } - - /** - * @return {@link #detail} 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 details of the proposed activity represented in a specific resource.) - */ - public Resource getDetailTarget() { - return this.detailTarget; - } - - /** - * @param value {@link #detail} 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 details of the proposed activity represented in a specific resource.) - */ - public CarePlanActivityComponent setDetailTarget(Resource value) { - this.detailTarget = value; - return this; - } - - /** - * @return {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CarePlanActivitySimpleComponent getSimple() { - if (this.simple == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.simple"); - else if (Configuration.doAutoCreate()) - this.simple = new CarePlanActivitySimpleComponent(); - return this.simple; - } - - public boolean hasSimple() { - return this.simple != null && !this.simple.isEmpty(); - } - - /** - * @param value {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CarePlanActivityComponent setSimple(CarePlanActivitySimpleComponent value) { - this.simple = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("goal", "uri", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); - childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); - childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("detail", "Reference(Procedure|MedicationPrescription|DiagnosticOrder|Encounter|Supply)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("simple", "", "A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, simple)); - } - - public CarePlanActivityComponent copy() { - CarePlanActivityComponent dst = new CarePlanActivityComponent(); - copyValues(dst); - if (goal != null) { - dst.goal = new ArrayList(); - for (UriType i : goal) - dst.goal.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.prohibited = prohibited == null ? null : prohibited.copy(); - if (actionResulting != null) { - dst.actionResulting = new ArrayList(); - for (Reference i : actionResulting) - dst.actionResulting.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - dst.detail = detail == null ? null : detail.copy(); - dst.simple = simple == null ? null : simple.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) - && (prohibited == null || prohibited.isEmpty()) && (actionResulting == null || actionResulting.isEmpty()) - && (notes == null || notes.isEmpty()) && (detail == null || detail.isEmpty()) && (simple == null || simple.isEmpty()) - ; - } - - } - - @Block() - public static class CarePlanActivitySimpleComponent extends BackboneElement { - /** - * High-level categorization of the type of activity in a care plan. - */ - @Child(name="category", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) - protected Enumeration category; - - /** - * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. - */ - @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter." ) - protected CodeableConcept code; - - /** - * The period, timing or frequency upon which the described activity is to occur. - */ - @Child(name="scheduled", type={Timing.class, Period.class, StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) - protected Type scheduled; - - /** - * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. - */ - @Child(name="location", type={Location.class}, order=4, min=0, max=1) - @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - protected Location locationTarget; - - /** - * Identifies who's expected to be involved in the activity. - */ - @Child(name="performer", type={Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who's responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) - */ - protected List performerTarget; - - - /** - * Identifies the food, drug or other product being consumed or supplied in the activity. - */ - @Child(name="product", type={Medication.class, Substance.class}, order=6, min=0, max=1) - @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." ) - protected Reference product; - - /** - * The actual object that is the target of the reference (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - protected Resource productTarget; - - /** - * Identifies the quantity expected to be consumed in a given day. - */ - @Child(name="dailyAmount", type={Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="How much consumed/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) - protected Quantity dailyAmount; - - /** - * Identifies the quantity expected to be supplied. - */ - @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) - @Description(shortDefinition="How much is administered/supplied/consumed", formalDefinition="Identifies the quantity expected to be supplied." ) - protected Quantity quantity; - - /** - * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - @Child(name="details", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) - protected StringType details; - - private static final long serialVersionUID = 1028930313L; - - public CarePlanActivitySimpleComponent() { - super(); - } - - public CarePlanActivitySimpleComponent(Enumeration category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(); - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public CarePlanActivitySimpleComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return High-level categorization of the type of activity in a care plan. - */ - public CarePlanActivityCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value High-level categorization of the type of activity in a care plan. - */ - public CarePlanActivitySimpleComponent setCategory(CarePlanActivityCategory value) { - if (this.category == null) - this.category = new Enumeration(CarePlanActivityCategory.ENUM_FACTORY); - this.category.setValue(value); - return this; - } - - /** - * @return {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) - */ - public CarePlanActivitySimpleComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Timing getScheduledTiming() throws Exception { - if (!(this.scheduled instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Period getScheduledPeriod() throws Exception { - if (!(this.scheduled instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public StringType getScheduledStringType() throws Exception { - if (!(this.scheduled instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (StringType) this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public CarePlanActivitySimpleComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public CarePlanActivitySimpleComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) - */ - public CarePlanActivitySimpleComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - /** - * @return {@link #performer} (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 who's expected to be involved in the activity.) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public Reference getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.product"); - else if (Configuration.doAutoCreate()) - this.product = new Reference(); - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public CarePlanActivitySimpleComponent setProduct(Reference value) { - this.product = value; - return this; - } - - /** - * @return {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) - */ - public Resource getProductTarget() { - return this.productTarget; - } - - /** - * @param value {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) - */ - public CarePlanActivitySimpleComponent setProductTarget(Resource value) { - this.productTarget = value; - return this; - } - - /** - * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public Quantity getDailyAmount() { - if (this.dailyAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.dailyAmount"); - else if (Configuration.doAutoCreate()) - this.dailyAmount = new Quantity(); - return this.dailyAmount; - } - - public boolean hasDailyAmount() { - return this.dailyAmount != null && !this.dailyAmount.isEmpty(); - } - - /** - * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public CarePlanActivitySimpleComponent setDailyAmount(Quantity value) { - this.dailyAmount = value; - return this; - } - - /** - * @return {@link #quantity} (Identifies the quantity expected to be supplied.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Identifies the quantity expected to be supplied.) - */ - public CarePlanActivitySimpleComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public StringType getDetailsElement() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new StringType(); - return this.details; - } - - public boolean hasDetailsElement() { - return this.details != null && !this.details.isEmpty(); - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public CarePlanActivitySimpleComponent setDetailsElement(StringType value) { - this.details = value; - return this; - } - - /** - * @return This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - public String getDetails() { - return this.details == null ? null : this.details.getValue(); - } - - /** - * @param value This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - */ - public CarePlanActivitySimpleComponent setDetails(String value) { - if (Utilities.noString(value)) - this.details = null; - else { - if (this.details == null) - this.details = new StringType(); - this.details.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); - childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("details", "string", "This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, details)); - } - - public CarePlanActivitySimpleComponent copy() { - CarePlanActivitySimpleComponent dst = new CarePlanActivitySimpleComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.location = location == null ? null : location.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.product = product == null ? null : product.copy(); - dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.details = details == null ? null : details.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) - && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (details == null || details.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; - - /** - * 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 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 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 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 participant; - - /** - * Describes the intended objective(s) of carrying out the Care Plan. - */ - @Child(name="goal", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Desired outcome of plan", formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." ) - protected List goal; - - /** - * 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={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Action to occur as part of plan", 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 activity; - - /** - * General notes about the care plan not covered elsewhere. - */ - @Child(name="notes", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) - protected StringType notes; - - private static final long serialVersionUID = -1730021244L; - - public CarePlan() { - super(); - } - - public CarePlan(Enumeration 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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(); - 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 CarePlan.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 CarePlan 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 CarePlan.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 CarePlan 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 getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 CarePlan setStatusElement(Enumeration 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 CarePlanStatus 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 CarePlan setStatus(CarePlanStatus value) { - if (this.status == null) - this.status = new Enumeration(CarePlanStatus.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 CarePlan.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 CarePlan 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 CarePlan.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 CarePlan 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 CarePlan 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 getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - 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(); - 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 getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - 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(); - 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 getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (CarePlanParticipantComponent 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 CarePlanParticipantComponent addParticipant() { //3 - CarePlanParticipantComponent t = new CarePlanParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - /** - * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - return this.goal; - } - - public boolean hasGoal() { - if (this.goal == null) - return false; - for (CarePlanGoalComponent 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 CarePlanGoalComponent addGoal() { //3 - CarePlanGoalComponent t = new CarePlanGoalComponent(); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return t; - } - - /** - * @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 getActivity() { - if (this.activity == null) - this.activity = new ArrayList(); - return this.activity; - } - - public boolean hasActivity() { - if (this.activity == null) - return false; - for (CarePlanActivityComponent 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 CarePlanActivityComponent addActivity() { //3 - CarePlanActivityComponent t = new CarePlanActivityComponent(); - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.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 CarePlan.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 CarePlan 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 CarePlan 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; - } - - protected void listChildren(List 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("goal", "", "Describes the intended objective(s) of carrying out the Care Plan.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("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.", 0, java.lang.Integer.MAX_VALUE, activity)); - childrenList.add(new Property("notes", "string", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - public CarePlan copy() { - CarePlan dst = new CarePlan(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - 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(); - for (Reference i : concern) - dst.concern.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (CarePlanParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - if (goal != null) { - dst.goal = new ArrayList(); - for (CarePlanGoalComponent i : goal) - dst.goal.add(i.copy()); - }; - if (activity != null) { - dst.activity = new ArrayList(); - for (CarePlanActivityComponent i : activity) - dst.activity.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - protected CarePlan 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()) - && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) && (notes == null || notes.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CarePlan; - } - - @SearchParamDefinition(name="activitycode", path="CarePlan.activity.simple.code", description="Detail type of activity", type="token" ) - public static final String SP_ACTIVITYCODE = "activitycode"; - @SearchParamDefinition(name="patient", path="CarePlan.patient", description="Who care plan is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="condition", path="CarePlan.concern", description="Health issues this plan addresses", type="reference" ) - public static final String SP_CONDITION = "condition"; - @SearchParamDefinition(name="activitydetail", path="CarePlan.activity.detail", description="Activity details defined in specific resource", type="reference" ) - public static final String SP_ACTIVITYDETAIL = "activitydetail"; - @SearchParamDefinition(name="activitydate", path="CarePlan.activity.simple.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) - public static final String SP_ACTIVITYDATE = "activitydate"; - @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="Who is involved", type="reference" ) - public static final String SP_PARTICIPANT = "participant"; - @SearchParamDefinition(name="date", path="CarePlan.period", description="Time period plan covers", type="date" ) - public static final String SP_DATE = "date"; - -} - + +/* + 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="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") +public class CarePlan extends DomainResource { + + public enum CarePlanStatus 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 CarePlanStatusEnumFactory ENUM_FACTORY = new CarePlanStatusEnumFactory(); + + public static CarePlanStatus 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 CarePlanStatus 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 CarePlanStatusEnumFactory implements EnumFactory { + public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return CarePlanStatus.PLANNED; + if ("active".equals(codeString)) + return CarePlanStatus.ACTIVE; + if ("completed".equals(codeString)) + return CarePlanStatus.COMPLETED; + throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); + } + public String toCode(CarePlanStatus code) throws IllegalArgumentException { + if (code == CarePlanStatus.PLANNED) + return "planned"; + if (code == CarePlanStatus.ACTIVE) + return "active"; + if (code == CarePlanStatus.COMPLETED) + return "completed"; + return "?"; + } + } + + 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). + */ + 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 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)) + return INPROGRESS; + if ("achieved".equals(codeString)) + return ACHIEVED; + if ("sustaining".equals(codeString)) + return SUSTAINING; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanGoalStatus 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 CarePlanGoalStatusEnumFactory implements EnumFactory { + public CarePlanGoalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return CarePlanGoalStatus.INPROGRESS; + if ("achieved".equals(codeString)) + return CarePlanGoalStatus.ACHIEVED; + if ("sustaining".equals(codeString)) + return CarePlanGoalStatus.SUSTAINING; + if ("cancelled".equals(codeString)) + return CarePlanGoalStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanGoalStatus code '"+codeString+"'"); + } + public String toCode(CarePlanGoalStatus code) throws IllegalArgumentException { + if (code == CarePlanGoalStatus.INPROGRESS) + return "in progress"; + if (code == CarePlanGoalStatus.ACHIEVED) + return "achieved"; + if (code == CarePlanGoalStatus.SUSTAINING) + return "sustaining"; + if (code == CarePlanGoalStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum CarePlanActivityStatus implements FhirEnum { + /** + * Activity is planned but no action has yet been taken. + */ + NOTSTARTED, + /** + * Appointment or other booking has occurred but activity has not yet begun. + */ + SCHEDULED, + /** + * Activity has been started but is not yet complete. + */ + INPROGRESS, + /** + * Activity was started but has temporarily ceased with an expectation of resumption at a future time. + */ + ONHOLD, + /** + * The activities have been completed (more or less) as planned. + */ + COMPLETED, + /** + * The activities have been ended prior to completion (perhaps even before they were started). + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return NOTSTARTED; + if ("scheduled".equals(codeString)) + return SCHEDULED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("on hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NOTSTARTED: return "not started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTSTARTED: return ""; + case SCHEDULED: return ""; + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTSTARTED: return "Activity is planned but no action has yet been taken."; + case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; + case INPROGRESS: return "Activity has been started but is not yet complete."; + case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; + case COMPLETED: return "The activities have been completed (more or less) as planned."; + case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTSTARTED: return "not started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + } + + public static class CarePlanActivityStatusEnumFactory implements EnumFactory { + public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not started".equals(codeString)) + return CarePlanActivityStatus.NOTSTARTED; + if ("scheduled".equals(codeString)) + return CarePlanActivityStatus.SCHEDULED; + if ("in progress".equals(codeString)) + return CarePlanActivityStatus.INPROGRESS; + if ("on hold".equals(codeString)) + return CarePlanActivityStatus.ONHOLD; + if ("completed".equals(codeString)) + return CarePlanActivityStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return CarePlanActivityStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); + } + public String toCode(CarePlanActivityStatus code) throws IllegalArgumentException { + if (code == CarePlanActivityStatus.NOTSTARTED) + return "not started"; + if (code == CarePlanActivityStatus.SCHEDULED) + return "scheduled"; + if (code == CarePlanActivityStatus.INPROGRESS) + return "in progress"; + if (code == CarePlanActivityStatus.ONHOLD) + return "on hold"; + if (code == CarePlanActivityStatus.COMPLETED) + return "completed"; + if (code == CarePlanActivityStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum CarePlanActivityCategory implements FhirEnum { + /** + * Plan for the patient to consume food of a specified nature. + */ + DIET, + /** + * Plan for the patient to consume/receive a drug, vaccine or other product. + */ + DRUG, + /** + * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). + */ + ENCOUNTER, + /** + * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). + */ + OBSERVATION, + /** + * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). + */ + PROCEDURE, + /** + * Plan to provide something to the patient (medication, medical supply, etc.). + */ + SUPPLY, + /** + * Some other form of action. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DIET; + if ("drug".equals(codeString)) + return DRUG; + if ("encounter".equals(codeString)) + return ENCOUNTER; + if ("observation".equals(codeString)) + return OBSERVATION; + if ("procedure".equals(codeString)) + return PROCEDURE; + if ("supply".equals(codeString)) + return SUPPLY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DIET: return ""; + case DRUG: return ""; + case ENCOUNTER: return ""; + case OBSERVATION: return ""; + case PROCEDURE: return ""; + case SUPPLY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DIET: return "Plan for the patient to consume food of a specified nature."; + case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; + case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; + case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; + case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; + case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; + case OTHER: return "Some other form of action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class CarePlanActivityCategoryEnumFactory implements EnumFactory { + public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return CarePlanActivityCategory.DIET; + if ("drug".equals(codeString)) + return CarePlanActivityCategory.DRUG; + if ("encounter".equals(codeString)) + return CarePlanActivityCategory.ENCOUNTER; + if ("observation".equals(codeString)) + return CarePlanActivityCategory.OBSERVATION; + if ("procedure".equals(codeString)) + return CarePlanActivityCategory.PROCEDURE; + if ("supply".equals(codeString)) + return CarePlanActivityCategory.SUPPLY; + if ("other".equals(codeString)) + return CarePlanActivityCategory.OTHER; + throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); + } + public String toCode(CarePlanActivityCategory code) throws IllegalArgumentException { + if (code == CarePlanActivityCategory.DIET) + return "diet"; + if (code == CarePlanActivityCategory.DRUG) + return "drug"; + if (code == CarePlanActivityCategory.ENCOUNTER) + return "encounter"; + if (code == CarePlanActivityCategory.OBSERVATION) + return "observation"; + if (code == CarePlanActivityCategory.PROCEDURE) + return "procedure"; + if (code == CarePlanActivityCategory.SUPPLY) + return "supply"; + if (code == CarePlanActivityCategory.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class CarePlanParticipantComponent 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 CarePlanParticipantComponent() { + super(); + } + + public CarePlanParticipantComponent(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 CarePlanParticipantComponent.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 CarePlanParticipantComponent 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 CarePlanParticipantComponent.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 CarePlanParticipantComponent 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 CarePlanParticipantComponent setMemberTarget(Resource value) { + this.memberTarget = value; + return this; + } + + protected void listChildren(List 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 CarePlanParticipantComponent copy() { + CarePlanParticipantComponent dst = new CarePlanParticipantComponent(); + 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()) + ; + } + + } + + @Block() + public static class CarePlanGoalComponent extends BackboneElement { + /** + * 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 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 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 concernTarget; + + + private static final long serialVersionUID = -1557229012L; + + public CarePlanGoalComponent() { + super(); + } + + public CarePlanGoalComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @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 CarePlanGoalComponent.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 CarePlanGoalComponent 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 CarePlanGoalComponent 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 getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanGoalComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 CarePlanGoalComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the goal has been reached and is still considered relevant. + */ + public CarePlanGoalStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the goal has been reached and is still considered relevant. + */ + public CarePlanGoalComponent setStatus(CarePlanGoalStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(CarePlanGoalStatus.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 CarePlanGoalComponent.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 CarePlanGoalComponent 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 CarePlanGoalComponent 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 getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + 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(); + 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 getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + 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(); + this.concernTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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 CarePlanGoalComponent copy() { + CarePlanGoalComponent dst = new CarePlanGoalComponent(); + copyValues(dst); + 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(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) + && (notes == null || notes.isEmpty()) && (concern == null || concern.isEmpty()); + } + + } + + @Block() + public static class CarePlanActivityComponent extends BackboneElement { + /** + * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. + */ + @Child(name="goal", type={UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) + protected List goal; + + /** + * Identifies what progress is being made for the specific activity. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="not started | scheduled | in progress | on hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) + protected Enumeration status; + + /** + * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + @Child(name="prohibited", type={BooleanType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) + protected BooleanType prohibited; + + /** + * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. + */ + @Child(name="actionResulting", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) + protected List actionResulting; + /** + * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + protected List actionResultingTarget; + + + /** + * Notes about the execution of the activity. + */ + @Child(name="notes", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) + protected StringType notes; + + /** + * The details of the proposed activity represented in a specific resource. + */ + @Child(name="detail", type={Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, Encounter.class, Supply.class}, order=6, min=0, max=1) + @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) + protected Reference detail; + + /** + * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) + */ + protected Resource detailTarget; + + /** + * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. + */ + @Child(name="simple", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Activity details summarised here", formalDefinition="A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) + protected CarePlanActivitySimpleComponent simple; + + private static final long serialVersionUID = -1536095647L; + + public CarePlanActivityComponent() { + super(); + } + + public CarePlanActivityComponent(BooleanType prohibited) { + super(); + this.prohibited = prohibited; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + return this.goal; + } + + public boolean hasGoal() { + if (this.goal == null) + return false; + for (UriType item : this.goal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + // syntactic sugar + public UriType addGoalElement() {//2 + UriType t = new UriType(); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return t; + } + + /** + * @param value {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public CarePlanActivityComponent addGoal(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return this; + } + + /** + * @param value {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public boolean hasGoal(String value) { + if (this.goal == null) + return false; + for (UriType v : this.goal) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CarePlanActivityComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies what progress is being made for the specific activity. + */ + public CarePlanActivityStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies what progress is being made for the specific activity. + */ + public CarePlanActivityComponent setStatus(CarePlanActivityStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(CarePlanActivityStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public BooleanType getProhibitedElement() { + if (this.prohibited == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.prohibited"); + else if (Configuration.doAutoCreate()) + this.prohibited = new BooleanType(); + return this.prohibited; + } + + public boolean hasProhibitedElement() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + public boolean hasProhibited() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + /** + * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public CarePlanActivityComponent setProhibitedElement(BooleanType value) { + this.prohibited = value; + return this; + } + + /** + * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public boolean getProhibited() { + return this.prohibited == null ? false : this.prohibited.getValue(); + } + + /** + * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public CarePlanActivityComponent setProhibited(boolean value) { + if (this.prohibited == null) + this.prohibited = new BooleanType(); + this.prohibited.setValue(value); + return this; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResulting() { + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + return this.actionResulting; + } + + public boolean hasActionResulting() { + if (this.actionResulting == null) + return false; + for (Reference item : this.actionResulting) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + // syntactic sugar + public Reference addActionResulting() { //3 + Reference t = new Reference(); + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + this.actionResulting.add(t); + return t; + } + + /** + * @return {@link #actionResulting} (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. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResultingTarget() { + if (this.actionResultingTarget == null) + this.actionResultingTarget = new ArrayList(); + return this.actionResultingTarget; + } + + /** + * @return {@link #notes} (Notes about the execution of the activity.). 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 CarePlanActivityComponent.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} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public CarePlanActivityComponent setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Notes about the execution of the activity. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Notes about the execution of the activity. + */ + public CarePlanActivityComponent 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 #detail} (The details of the proposed activity represented in a specific resource.) + */ + public Reference getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new Reference(); + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (The details of the proposed activity represented in a specific resource.) + */ + public CarePlanActivityComponent setDetail(Reference value) { + this.detail = value; + return this; + } + + /** + * @return {@link #detail} 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 details of the proposed activity represented in a specific resource.) + */ + public Resource getDetailTarget() { + return this.detailTarget; + } + + /** + * @param value {@link #detail} 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 details of the proposed activity represented in a specific resource.) + */ + public CarePlanActivityComponent setDetailTarget(Resource value) { + this.detailTarget = value; + return this; + } + + /** + * @return {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CarePlanActivitySimpleComponent getSimple() { + if (this.simple == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivityComponent.simple"); + else if (Configuration.doAutoCreate()) + this.simple = new CarePlanActivitySimpleComponent(); + return this.simple; + } + + public boolean hasSimple() { + return this.simple != null && !this.simple.isEmpty(); + } + + /** + * @param value {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CarePlanActivityComponent setSimple(CarePlanActivitySimpleComponent value) { + this.simple = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("goal", "uri", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); + childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); + childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("detail", "Reference(Procedure|MedicationPrescription|DiagnosticOrder|Encounter|Supply)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("simple", "", "A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, simple)); + } + + public CarePlanActivityComponent copy() { + CarePlanActivityComponent dst = new CarePlanActivityComponent(); + copyValues(dst); + if (goal != null) { + dst.goal = new ArrayList(); + for (UriType i : goal) + dst.goal.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.prohibited = prohibited == null ? null : prohibited.copy(); + if (actionResulting != null) { + dst.actionResulting = new ArrayList(); + for (Reference i : actionResulting) + dst.actionResulting.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + dst.detail = detail == null ? null : detail.copy(); + dst.simple = simple == null ? null : simple.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) + && (prohibited == null || prohibited.isEmpty()) && (actionResulting == null || actionResulting.isEmpty()) + && (notes == null || notes.isEmpty()) && (detail == null || detail.isEmpty()) && (simple == null || simple.isEmpty()) + ; + } + + } + + @Block() + public static class CarePlanActivitySimpleComponent extends BackboneElement { + /** + * High-level categorization of the type of activity in a care plan. + */ + @Child(name="category", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) + protected Enumeration category; + + /** + * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. + */ + @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter." ) + protected CodeableConcept code; + + /** + * The period, timing or frequency upon which the described activity is to occur. + */ + @Child(name="scheduled", type={Timing.class, Period.class, StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) + protected Type scheduled; + + /** + * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. + */ + @Child(name="location", type={Location.class}, order=4, min=0, max=1) + @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + protected Location locationTarget; + + /** + * Identifies who's expected to be involved in the activity. + */ + @Child(name="performer", type={Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who's responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) + */ + protected List performerTarget; + + + /** + * Identifies the food, drug or other product being consumed or supplied in the activity. + */ + @Child(name="product", type={Medication.class, Substance.class}, order=6, min=0, max=1) + @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." ) + protected Reference product; + + /** + * The actual object that is the target of the reference (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + protected Resource productTarget; + + /** + * Identifies the quantity expected to be consumed in a given day. + */ + @Child(name="dailyAmount", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="How much consumed/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) + protected Quantity dailyAmount; + + /** + * Identifies the quantity expected to be supplied. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="How much is administered/supplied/consumed", formalDefinition="Identifies the quantity expected to be supplied." ) + protected Quantity quantity; + + /** + * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + @Child(name="details", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) + protected StringType details; + + private static final long serialVersionUID = 1028930313L; + + public CarePlanActivitySimpleComponent() { + super(); + } + + public CarePlanActivitySimpleComponent(Enumeration category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public CarePlanActivitySimpleComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return High-level categorization of the type of activity in a care plan. + */ + public CarePlanActivityCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value High-level categorization of the type of activity in a care plan. + */ + public CarePlanActivitySimpleComponent setCategory(CarePlanActivityCategory value) { + if (this.category == null) + this.category = new Enumeration(CarePlanActivityCategory.ENUM_FACTORY); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CarePlanActivitySimpleComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public StringType getScheduledStringType() throws Exception { + if (!(this.scheduled instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (StringType) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public CarePlanActivitySimpleComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CarePlanActivitySimpleComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CarePlanActivitySimpleComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (Reference item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + /** + * @return {@link #performer} (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 who's expected to be involved in the activity.) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public Reference getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Reference(); + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public CarePlanActivitySimpleComponent setProduct(Reference value) { + this.product = value; + return this; + } + + /** + * @return {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) + */ + public Resource getProductTarget() { + return this.productTarget; + } + + /** + * @param value {@link #product} 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 food, drug or other product being consumed or supplied in the activity.) + */ + public CarePlanActivitySimpleComponent setProductTarget(Resource value) { + this.productTarget = value; + return this; + } + + /** + * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public Quantity getDailyAmount() { + if (this.dailyAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.dailyAmount"); + else if (Configuration.doAutoCreate()) + this.dailyAmount = new Quantity(); + return this.dailyAmount; + } + + public boolean hasDailyAmount() { + return this.dailyAmount != null && !this.dailyAmount.isEmpty(); + } + + /** + * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public CarePlanActivitySimpleComponent setDailyAmount(Quantity value) { + this.dailyAmount = value; + return this; + } + + /** + * @return {@link #quantity} (Identifies the quantity expected to be supplied.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Identifies the quantity expected to be supplied.) + */ + public CarePlanActivitySimpleComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public StringType getDetailsElement() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlanActivitySimpleComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new StringType(); + return this.details; + } + + public boolean hasDetailsElement() { + return this.details != null && !this.details.isEmpty(); + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public CarePlanActivitySimpleComponent setDetailsElement(StringType value) { + this.details = value; + return this; + } + + /** + * @return This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public String getDetails() { + return this.details == null ? null : this.details.getValue(); + } + + /** + * @param value This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public CarePlanActivitySimpleComponent setDetails(String value) { + if (Utilities.noString(value)) + this.details = null; + else { + if (this.details == null) + this.details = new StringType(); + this.details.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); + childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("details", "string", "This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, details)); + } + + public CarePlanActivitySimpleComponent copy() { + CarePlanActivitySimpleComponent dst = new CarePlanActivitySimpleComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.location = location == null ? null : location.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.product = product == null ? null : product.copy(); + dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.details = details == null ? null : details.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) + && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (details == null || details.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; + + /** + * 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 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 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 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 participant; + + /** + * Describes the intended objective(s) of carrying out the Care Plan. + */ + @Child(name="goal", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Desired outcome of plan", formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." ) + protected List goal; + + /** + * 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={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Action to occur as part of plan", 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 activity; + + /** + * General notes about the care plan not covered elsewhere. + */ + @Child(name="notes", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) + protected StringType notes; + + private static final long serialVersionUID = -1730021244L; + + public CarePlan() { + super(); + } + + public CarePlan(Enumeration 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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(); + 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 CarePlan.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 CarePlan 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 CarePlan.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 CarePlan 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 getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 CarePlan setStatusElement(Enumeration 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 CarePlanStatus 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 CarePlan setStatus(CarePlanStatus value) { + if (this.status == null) + this.status = new Enumeration(CarePlanStatus.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 CarePlan.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 CarePlan 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 CarePlan.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 CarePlan 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 CarePlan 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 getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + 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(); + 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 getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + 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(); + 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 getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (CarePlanParticipantComponent 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 CarePlanParticipantComponent addParticipant() { //3 + CarePlanParticipantComponent t = new CarePlanParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + /** + * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + return this.goal; + } + + public boolean hasGoal() { + if (this.goal == null) + return false; + for (CarePlanGoalComponent 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 CarePlanGoalComponent addGoal() { //3 + CarePlanGoalComponent t = new CarePlanGoalComponent(); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return t; + } + + /** + * @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 getActivity() { + if (this.activity == null) + this.activity = new ArrayList(); + return this.activity; + } + + public boolean hasActivity() { + if (this.activity == null) + return false; + for (CarePlanActivityComponent 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 CarePlanActivityComponent addActivity() { //3 + CarePlanActivityComponent t = new CarePlanActivityComponent(); + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.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 CarePlan.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 CarePlan 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 CarePlan 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; + } + + protected void listChildren(List 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("goal", "", "Describes the intended objective(s) of carrying out the Care Plan.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("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.", 0, java.lang.Integer.MAX_VALUE, activity)); + childrenList.add(new Property("notes", "string", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + public CarePlan copy() { + CarePlan dst = new CarePlan(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + 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(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (CarePlanParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + if (goal != null) { + dst.goal = new ArrayList(); + for (CarePlanGoalComponent i : goal) + dst.goal.add(i.copy()); + }; + if (activity != null) { + dst.activity = new ArrayList(); + for (CarePlanActivityComponent i : activity) + dst.activity.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + protected CarePlan 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()) + && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) && (notes == null || notes.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CarePlan; + } + + @SearchParamDefinition(name="activitycode", path="CarePlan.activity.simple.code", description="Detail type of activity", type="token" ) + public static final String SP_ACTIVITYCODE = "activitycode"; + @SearchParamDefinition(name="patient", path="CarePlan.patient", description="Who care plan is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="condition", path="CarePlan.concern", description="Health issues this plan addresses", type="reference" ) + public static final String SP_CONDITION = "condition"; + @SearchParamDefinition(name="activitydetail", path="CarePlan.activity.detail", description="Activity details defined in specific resource", type="reference" ) + public static final String SP_ACTIVITYDETAIL = "activitydetail"; + @SearchParamDefinition(name="activitydate", path="CarePlan.activity.simple.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) + public static final String SP_ACTIVITYDATE = "activitydate"; + @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="Who is involved", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + @SearchParamDefinition(name="date", path="CarePlan.period", description="Time period plan covers", type="date" ) + public static final String SP_DATE = "date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java index d7eb71915d9..ca9cc561d1a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java @@ -20,858 +20,858 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 { - 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 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; - - /** - * 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 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 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 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 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 goal; - /** - * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the Care Plan.) - */ - protected List 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 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 activityTarget; - - - private static final long serialVersionUID = -1325874459L; - - public CarePlan2() { - super(); - } - - public CarePlan2(Enumeration 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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(); - 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 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(); - 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 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.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 getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - 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(); - 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 getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - 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(); - 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 getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - 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(); - 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 getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - 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(); - 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 getGoalTarget() { - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - 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(); - 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 getActivity() { - if (this.activity == null) - this.activity = new ArrayList(); - 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(); - 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 getActivityTarget() { - if (this.activityTarget == null) - this.activityTarget = new ArrayList(); - 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(); - this.activityTarget.add(r); - return r; - } - - protected void listChildren(List 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(); - 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(); - for (Reference i : concern) - dst.concern.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (CarePlan2ParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - if (goal != null) { - dst.goal = new ArrayList(); - for (Reference i : goal) - dst.goal.add(i.copy()); - }; - if (activity != null) { - dst.activity = new ArrayList(); - 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"; - -} - + +/* + 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 { + 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 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; + + /** + * 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 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 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 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 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 goal; + /** + * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the Care Plan.) + */ + protected List 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 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 activityTarget; + + + private static final long serialVersionUID = -1325874459L; + + public CarePlan2() { + super(); + } + + public CarePlan2(Enumeration 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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(); + 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 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(); + 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 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.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 getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + 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(); + 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 getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + 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(); + 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 getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + 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(); + 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 getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + 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(); + 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 getGoalTarget() { + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + 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(); + 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 getActivity() { + if (this.activity == null) + this.activity = new ArrayList(); + 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(); + 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 getActivityTarget() { + if (this.activityTarget == null) + this.activityTarget = new ArrayList(); + 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(); + this.activityTarget.add(r); + return r; + } + + protected void listChildren(List 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(); + 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(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (CarePlan2ParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + if (goal != null) { + dst.goal = new ArrayList(); + for (Reference i : goal) + dst.goal.add(i.copy()); + }; + if (activity != null) { + dst.activity = new ArrayList(); + 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"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java index 70dcf5b6f8e..79e43ae995d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java @@ -20,3420 +20,3420 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * This resource provides the adjudication details from the processing of a Claim resource. - */ -@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") -public class ClaimResponse extends DomainResource { - - public enum RSLink implements FhirEnum { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) throws IllegalArgumentException { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequenceLinkId; - - /** - * A list of note references to the notes provided below. - */ - @Child(name="noteNumber", type={IntegerType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumber; - - /** - * The adjudications results. - */ - @Child(name="adjudication", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for submitted services. - */ - @Child(name="detail", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." ) - protected List detail; - - private static final long serialVersionUID = -1140851161L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemsComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public List getNoteNumber() { - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - return this.noteNumber; - } - - public boolean hasNoteNumber() { - if (this.noteNumber == null) - return false; - for (IntegerType item : this.noteNumber) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public IntegerType addNoteNumberElement() {//2 - IntegerType t = new IntegerType(); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return t; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public ItemsComponent addNoteNumber(int value) { //1 - IntegerType t = new IntegerType(); - t.setValue(value); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return this; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumber(int value) { - if (this.noteNumber == null) - return false; - for (IntegerType v : this.noteNumber) - if (v.equals(value)) // integer - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (ItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public ItemAdjudicationComponent addAdjudication() { //3 - ItemAdjudicationComponent t = new ItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - /** - * @return {@link #detail} (The second tier service adjudications for submitted services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (ItemDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemDetailComponent addDetail() { //3 - ItemDetailComponent t = new ItemDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("noteNumber", "integer", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (noteNumber != null) { - dst.noteNumber = new ArrayList(); - for (IntegerType i : noteNumber) - dst.noteNumber.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (ItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (ItemDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class ItemAdjudicationComponent extends BackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name="code", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name="amount", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - public ItemAdjudicationComponent() { - super(); - } - - public ItemAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public ItemAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public ItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ItemAdjudicationComponent copy() { - ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ItemDetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequenceLinkId; - - /** - * The adjudications results. - */ - @Child(name="adjudication", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The third tier service adjudications for submitted services. - */ - @Child(name="subdetail", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." ) - protected List subdetail; - - private static final long serialVersionUID = -812538L; - - public ItemDetailComponent() { - super(); - } - - public ItemDetailComponent(IntegerType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemDetailComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemDetailComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (DetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public DetailAdjudicationComponent addAdjudication() { //3 - DetailAdjudicationComponent t = new DetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - /** - * @return {@link #subdetail} (The third tier service adjudications for submitted services.) - */ - public List getSubdetail() { - if (this.subdetail == null) - this.subdetail = new ArrayList(); - return this.subdetail; - } - - public boolean hasSubdetail() { - if (this.subdetail == null) - return false; - for (ItemSubdetailComponent item : this.subdetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subdetail} (The third tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemSubdetailComponent addSubdetail() { //3 - ItemSubdetailComponent t = new ItemSubdetailComponent(); - if (this.subdetail == null) - this.subdetail = new ArrayList(); - this.subdetail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("subdetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subdetail)); - } - - public ItemDetailComponent copy() { - ItemDetailComponent dst = new ItemDetailComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (DetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (subdetail != null) { - dst.subdetail = new ArrayList(); - for (ItemSubdetailComponent i : subdetail) - dst.subdetail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) - && (subdetail == null || subdetail.isEmpty()); - } - - } - - @Block() - public static class DetailAdjudicationComponent extends BackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name="code", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name="amount", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - public DetailAdjudicationComponent() { - super(); - } - - public DetailAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public DetailAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public DetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public DetailAdjudicationComponent copy() { - DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ItemSubdetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequenceLinkId; - - /** - * The adjudications results. - */ - @Child(name="adjudication", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = -1143083130L; - - public ItemSubdetailComponent() { - super(); - } - - public ItemSubdetailComponent(IntegerType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemSubdetailComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemSubdetailComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemSubdetailComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (SubdetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public SubdetailAdjudicationComponent addAdjudication() { //3 - SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - public ItemSubdetailComponent copy() { - ItemSubdetailComponent dst = new ItemSubdetailComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (SubdetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) - ; - } - - } - - @Block() - public static class SubdetailAdjudicationComponent extends BackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name="code", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name="amount", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - public SubdetailAdjudicationComponent() { - super(); - } - - public SubdetailAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public SubdetailAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public SubdetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SubdetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubdetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public SubdetailAdjudicationComponent copy() { - SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class AddedItemComponent extends BackboneElement { - /** - * List of input service items which this service line is intended to replace. - */ - @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) - protected List sequenceLinkId; - - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name="service", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name="fee", type={Money.class}, order=3, min=0, max=1) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * A list of note references to the notes provided below. - */ - @Child(name="noteNumberLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumberLinkId; - - /** - * The adjudications results. - */ - @Child(name="adjudication", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for payor added services. - */ - @Child(name="detail", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) - protected List detail; - - private static final long serialVersionUID = -1703432926L; - - public AddedItemComponent() { - super(); - } - - public AddedItemComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public List getSequenceLinkId() { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkId() { - if (this.sequenceLinkId == null) - return false; - for (IntegerType item : this.sequenceLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - // syntactic sugar - public IntegerType addSequenceLinkIdElement() {//2 - IntegerType t = new IntegerType(); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return t; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public AddedItemComponent addSequenceLinkId(int value) { //1 - IntegerType t = new IntegerType(); - t.setValue(value); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return this; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public boolean hasSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - return false; - for (IntegerType v : this.sequenceLinkId) - if (v.equals(value)) // integer - return true; - return false; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public List getNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - return this.noteNumberLinkId; - } - - public boolean hasNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - return false; - for (IntegerType item : this.noteNumberLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public IntegerType addNoteNumberLinkIdElement() {//2 - IntegerType t = new IntegerType(); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return t; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public AddedItemComponent addNoteNumberLinkId(int value) { //1 - IntegerType t = new IntegerType(); - t.setValue(value); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return this; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumberLinkId(int value) { - if (this.noteNumberLinkId == null) - return false; - for (IntegerType v : this.noteNumberLinkId) - if (v.equals(value)) // integer - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemAdjudicationComponent addAdjudication() { //3 - AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (AddedItemsDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemsDetailComponent addDetail() { //3 - AddedItemsDetailComponent t = new AddedItemsDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("noteNumberLinkId", "integer", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public AddedItemComponent copy() { - AddedItemComponent dst = new AddedItemComponent(); - copyValues(dst); - if (sequenceLinkId != null) { - dst.sequenceLinkId = new ArrayList(); - for (IntegerType i : sequenceLinkId) - dst.sequenceLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (noteNumberLinkId != null) { - dst.noteNumberLinkId = new ArrayList(); - for (IntegerType i : noteNumberLinkId) - dst.noteNumberLinkId.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (AddedItemsDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) - && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class AddedItemAdjudicationComponent extends BackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name="code", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name="amount", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - public AddedItemAdjudicationComponent() { - super(); - } - - public AddedItemAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public AddedItemAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public AddedItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public AddedItemAdjudicationComponent copy() { - AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class AddedItemsDetailComponent extends BackboneElement { - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name="service", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name="fee", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * The adjudications results. - */ - @Child(name="adjudication", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = -2104242020L; - - public AddedItemsDetailComponent() { - super(); - } - - public AddedItemsDetailComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemsDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemsDetailComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemDetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemDetailAdjudicationComponent addAdjudication() { //3 - AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - public AddedItemsDetailComponent copy() { - AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); - copyValues(dst); - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemDetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) - && (adjudication == null || adjudication.isEmpty()); - } - - } - - @Block() - public static class AddedItemDetailAdjudicationComponent extends BackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name="code", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding code; - - /** - * Monitory amount associated with the code. - */ - @Child(name="amount", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -949880587L; - - public AddedItemDetailAdjudicationComponent() { - super(); - } - - public AddedItemDetailAdjudicationComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public AddedItemDetailAdjudicationComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public AddedItemDetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public AddedItemDetailAdjudicationComponent copy() { - AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ErrorsComponent extends BackboneElement { - /** - * The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. - */ - @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere." ) - protected IntegerType sequenceLinkId; - - /** - * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - @Child(name="detailSequenceLinkId", type={IntegerType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) - protected IntegerType detailSequenceLinkId; - - /** - * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - @Child(name="subdetailSequenceLinkId", type={IntegerType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) - protected IntegerType subdetailSequenceLinkId; - - /** - * An error code,froma specified code system, which details why the claim could not be adjudicated. - */ - @Child(name="code", type={Coding.class}, order=4, min=1, max=1) - @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,froma specified code system, which details why the claim could not be adjudicated." ) - protected Coding code; - - private static final long serialVersionUID = 878850209L; - - public ErrorsComponent() { - super(); - } - - public ErrorsComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. - */ - public ErrorsComponent setSequenceLinkId(int value) { - if (value == -1) - this.sequenceLinkId = null; - else { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - } - return this; - } - - /** - * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value - */ - public IntegerType getDetailSequenceLinkIdElement() { - if (this.detailSequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.detailSequenceLinkId = new IntegerType(); - return this.detailSequenceLinkId; - } - - public boolean hasDetailSequenceLinkIdElement() { - return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); - } - - public boolean hasDetailSequenceLinkId() { - return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setDetailSequenceLinkIdElement(IntegerType value) { - this.detailSequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public int getDetailSequenceLinkId() { - return this.detailSequenceLinkId == null ? null : this.detailSequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public ErrorsComponent setDetailSequenceLinkId(int value) { - if (value == -1) - this.detailSequenceLinkId = null; - else { - if (this.detailSequenceLinkId == null) - this.detailSequenceLinkId = new IntegerType(); - this.detailSequenceLinkId.setValue(value); - } - return this; - } - - /** - * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value - */ - public IntegerType getSubdetailSequenceLinkIdElement() { - if (this.subdetailSequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.subdetailSequenceLinkId = new IntegerType(); - return this.subdetailSequenceLinkId; - } - - public boolean hasSubdetailSequenceLinkIdElement() { - return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); - } - - public boolean hasSubdetailSequenceLinkId() { - return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setSubdetailSequenceLinkIdElement(IntegerType value) { - this.subdetailSequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public int getSubdetailSequenceLinkId() { - return this.subdetailSequenceLinkId == null ? null : this.subdetailSequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. - */ - public ErrorsComponent setSubdetailSequenceLinkId(int value) { - if (value == -1) - this.subdetailSequenceLinkId = null; - else { - if (this.subdetailSequenceLinkId == null) - this.subdetailSequenceLinkId = new IntegerType(); - this.subdetailSequenceLinkId.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) - */ - public ErrorsComponent setCode(Coding value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("detailSequenceLinkId", "integer", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); - childrenList.add(new Property("subdetailSequenceLinkId", "integer", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); - childrenList.add(new Property("code", "Coding", "An error code,froma specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public ErrorsComponent copy() { - ErrorsComponent dst = new ErrorsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy(); - dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty()) - && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - } - - @Block() - public static class NotesComponent extends BackboneElement { - /** - * An integer associated with each note which may be referred to from each service line item. - */ - @Child(name="number", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) - protected IntegerType number; - - /** - * The note purpose: Print/Display. - */ - @Child(name="type", type={Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name="text", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Note explanitory text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = -1837694409L; - - public NotesComponent() { - super(); - } - - /** - * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public IntegerType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new IntegerType(); - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public NotesComponent setNumberElement(IntegerType value) { - this.number = value; - return this; - } - - /** - * @return An integer associated with each note which may be referred to from each service line item. - */ - public int getNumber() { - return this.number == null ? null : this.number.getValue(); - } - - /** - * @param value An integer associated with each note which may be referred to from each service line item. - */ - public NotesComponent setNumber(int value) { - if (value == -1) - this.number = null; - else { - if (this.number == null) - this.number = new IntegerType(); - this.number.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "integer", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) - && (text == null || text.isEmpty()); - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Response number", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @Child(name="request", type={OralHealthClaim.class}, order=0, min=0, max=1) - @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource referrence.) - */ - protected OralHealthClaim requestTarget; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name="organization", type={Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="requestProvider", type={Practitioner.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="requestOrganization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name="outcome", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name="disposition", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="payeeType", type={Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding payeeType; - - /** - * The first tier service adjudications for submitted services. - */ - @Child(name="item", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) - protected List item; - - /** - * The first tier service adjudications for payor added services. - */ - @Child(name="additem", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) - protected List additem; - - /** - * Mutually exclusive with Services Provided (Item). - */ - @Child(name="error", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) - protected List error; - - /** - * The total cost of the services reported. - */ - @Child(name="totalCost", type={Money.class}, order=13, min=0, max=1) - @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) - protected Money totalCost; - - /** - * The amount of deductable applied which was not allocated to any particular service line. - */ - @Child(name="unallocDeductable", type={Money.class}, order=14, min=0, max=1) - @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) - protected Money unallocDeductable; - - /** - * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). - */ - @Child(name="totalBenefit", type={Money.class}, order=15, min=0, max=1) - @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) - protected Money totalBenefit; - - /** - * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. - */ - @Child(name="paymentAdjustment", type={Money.class}, order=16, min=0, max=1) - @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) - protected Money paymentAdjustment; - - /** - * Reason for the payment adjustment. - */ - @Child(name="paymentAdjustmentReason", type={Coding.class}, order=17, min=0, max=1) - @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) - protected Coding paymentAdjustmentReason; - - /** - * Estimated payment data. - */ - @Child(name="paymentDate", type={DateType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) - protected DateType paymentDate; - - /** - * Payable less any payment adjustment. - */ - @Child(name="paymentAmount", type={Money.class}, order=19, min=0, max=1) - @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) - protected Money paymentAmount; - - /** - * Payment identifer. - */ - @Child(name="paymentRef", type={Identifier.class}, order=20, min=0, max=1) - @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) - protected Identifier paymentRef; - - /** - * Status of funds reservation (For provider, for Patient, None). - */ - @Child(name="reserved", type={Coding.class}, order=21, min=0, max=1) - @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) - protected Coding reserved; - - /** - * The form to be used for printing the content. - */ - @Child(name="form", type={Coding.class}, order=22, min=0, max=1) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Note text. - */ - @Child(name="note", type={}, order=23, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) - protected List note; - - private static final long serialVersionUID = -1199888229L; - - public ClaimResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public ClaimResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 OralHealthClaim getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new OralHealthClaim(); - 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 ClaimResponse setRequestTarget(OralHealthClaim value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 ClaimResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ClaimResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public ClaimResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Insurer who produced this adjudicated response.) - */ - public ClaimResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} 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 ClaimResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} 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 ClaimResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public ClaimResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public ClaimResponse setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(RSLink.ENUM_FACTORY); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ClaimResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public ClaimResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getPayeeType() { - if (this.payeeType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.payeeType"); - else if (Configuration.doAutoCreate()) - this.payeeType = new Coding(); - return this.payeeType; - } - - public boolean hasPayeeType() { - return this.payeeType != null && !this.payeeType.isEmpty(); - } - - /** - * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) - */ - public ClaimResponse setPayeeType(Coding value) { - this.payeeType = value; - return this; - } - - /** - * @return {@link #item} (The first tier service adjudications for submitted services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (The first tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #additem} (The first tier service adjudications for payor added services.) - */ - public List getAdditem() { - if (this.additem == null) - this.additem = new ArrayList(); - return this.additem; - } - - public boolean hasAdditem() { - if (this.additem == null) - return false; - for (AddedItemComponent item : this.additem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additem} (The first tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemComponent addAdditem() { //3 - AddedItemComponent t = new AddedItemComponent(); - if (this.additem == null) - this.additem = new ArrayList(); - this.additem.add(t); - return t; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (ErrorsComponent item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - // syntactic sugar - public ErrorsComponent addError() { //3 - ErrorsComponent t = new ErrorsComponent(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - /** - * @return {@link #totalCost} (The total cost of the services reported.) - */ - public Money getTotalCost() { - if (this.totalCost == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.totalCost"); - else if (Configuration.doAutoCreate()) - this.totalCost = new Money(); - return this.totalCost; - } - - public boolean hasTotalCost() { - return this.totalCost != null && !this.totalCost.isEmpty(); - } - - /** - * @param value {@link #totalCost} (The total cost of the services reported.) - */ - public ClaimResponse setTotalCost(Money value) { - this.totalCost = value; - return this; - } - - /** - * @return {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) - */ - public Money getUnallocDeductable() { - if (this.unallocDeductable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable"); - else if (Configuration.doAutoCreate()) - this.unallocDeductable = new Money(); - return this.unallocDeductable; - } - - public boolean hasUnallocDeductable() { - return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); - } - - /** - * @param value {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) - */ - public ClaimResponse setUnallocDeductable(Money value) { - this.unallocDeductable = value; - return this; - } - - /** - * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) - */ - public Money getTotalBenefit() { - if (this.totalBenefit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.totalBenefit"); - else if (Configuration.doAutoCreate()) - this.totalBenefit = new Money(); - return this.totalBenefit; - } - - public boolean hasTotalBenefit() { - return this.totalBenefit != null && !this.totalBenefit.isEmpty(); - } - - /** - * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) - */ - public ClaimResponse setTotalBenefit(Money value) { - this.totalBenefit = value; - return this; - } - - /** - * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public Money getPaymentAdjustment() { - if (this.paymentAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustment = new Money(); - return this.paymentAdjustment; - } - - public boolean hasPaymentAdjustment() { - return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public ClaimResponse setPaymentAdjustment(Money value) { - this.paymentAdjustment = value; - return this; - } - - /** - * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public Coding getPaymentAdjustmentReason() { - if (this.paymentAdjustmentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustmentReason = new Coding(); - return this.paymentAdjustmentReason; - } - - public boolean hasPaymentAdjustmentReason() { - return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public ClaimResponse setPaymentAdjustmentReason(Coding value) { - this.paymentAdjustmentReason = value; - return this; - } - - /** - * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public DateType getPaymentDateElement() { - if (this.paymentDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentDate"); - else if (Configuration.doAutoCreate()) - this.paymentDate = new DateType(); - return this.paymentDate; - } - - public boolean hasPaymentDateElement() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - public boolean hasPaymentDate() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - /** - * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public ClaimResponse setPaymentDateElement(DateType value) { - this.paymentDate = value; - return this; - } - - /** - * @return Estimated payment data. - */ - public Date getPaymentDate() { - return this.paymentDate == null ? null : this.paymentDate.getValue(); - } - - /** - * @param value Estimated payment data. - */ - public ClaimResponse setPaymentDate(Date value) { - if (value == null) - this.paymentDate = null; - else { - if (this.paymentDate == null) - this.paymentDate = new DateType(); - this.paymentDate.setValue(value); - } - return this; - } - - /** - * @return {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public Money getPaymentAmount() { - if (this.paymentAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAmount"); - else if (Configuration.doAutoCreate()) - this.paymentAmount = new Money(); - return this.paymentAmount; - } - - public boolean hasPaymentAmount() { - return this.paymentAmount != null && !this.paymentAmount.isEmpty(); - } - - /** - * @param value {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public ClaimResponse setPaymentAmount(Money value) { - this.paymentAmount = value; - return this; - } - - /** - * @return {@link #paymentRef} (Payment identifer.) - */ - public Identifier getPaymentRef() { - if (this.paymentRef == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentRef"); - else if (Configuration.doAutoCreate()) - this.paymentRef = new Identifier(); - return this.paymentRef; - } - - public boolean hasPaymentRef() { - return this.paymentRef != null && !this.paymentRef.isEmpty(); - } - - /** - * @param value {@link #paymentRef} (Payment identifer.) - */ - public ClaimResponse setPaymentRef(Identifier value) { - this.paymentRef = value; - return this; - } - - /** - * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public Coding getReserved() { - if (this.reserved == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.reserved"); - else if (Configuration.doAutoCreate()) - this.reserved = new Coding(); - return this.reserved; - } - - public boolean hasReserved() { - return this.reserved != null && !this.reserved.isEmpty(); - } - - /** - * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public ClaimResponse setReserved(Coding value) { - this.reserved = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public ClaimResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #note} (Note text.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Note text.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - protected void listChildren(List 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(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("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)); - 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("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); - childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, additem)); - childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); - childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); - childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); - childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); - childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); - childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); - childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); - childrenList.add(new Property("paymentRef", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); - childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public ClaimResponse copy() { - ClaimResponse dst = new ClaimResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.payeeType = payeeType == null ? null : payeeType.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additem != null) { - dst.additem = new ArrayList(); - for (AddedItemComponent i : additem) - dst.additem.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (ErrorsComponent i : error) - dst.error.add(i.copy()); - }; - dst.totalCost = totalCost == null ? null : totalCost.copy(); - dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); - dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); - dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); - dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); - dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); - dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); - dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); - dst.reserved = reserved == null ? null : reserved.copy(); - dst.form = form == null ? null : form.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - protected ClaimResponse typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.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()) - && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ClaimResponse; - } - - @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * This resource provides the adjudication details from the processing of a Claim resource. + */ +@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") +public class ClaimResponse extends DomainResource { + + public enum RSLink implements FhirEnum { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) throws IllegalArgumentException { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequenceLinkId; + + /** + * A list of note references to the notes provided below. + */ + @Child(name="noteNumber", type={IntegerType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumber; + + /** + * The adjudications results. + */ + @Child(name="adjudication", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for submitted services. + */ + @Child(name="detail", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." ) + protected List detail; + + private static final long serialVersionUID = -1140851161L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemsComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public List getNoteNumber() { + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + return this.noteNumber; + } + + public boolean hasNoteNumber() { + if (this.noteNumber == null) + return false; + for (IntegerType item : this.noteNumber) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumber} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public IntegerType addNoteNumberElement() {//2 + IntegerType t = new IntegerType(); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return t; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public ItemsComponent addNoteNumber(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.noteNumber == null) + this.noteNumber = new ArrayList(); + this.noteNumber.add(t); + return this; + } + + /** + * @param value {@link #noteNumber} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumber(int value) { + if (this.noteNumber == null) + return false; + for (IntegerType v : this.noteNumber) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (ItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public ItemAdjudicationComponent addAdjudication() { //3 + ItemAdjudicationComponent t = new ItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + /** + * @return {@link #detail} (The second tier service adjudications for submitted services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (ItemDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for submitted services.) + */ + // syntactic sugar + public ItemDetailComponent addDetail() { //3 + ItemDetailComponent t = new ItemDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("noteNumber", "integer", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (noteNumber != null) { + dst.noteNumber = new ArrayList(); + for (IntegerType i : noteNumber) + dst.noteNumber.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (ItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (ItemDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class ItemAdjudicationComponent extends BackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name="code", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name="amount", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + public ItemAdjudicationComponent() { + super(); + } + + public ItemAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public ItemAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public ItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public ItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ItemAdjudicationComponent copy() { + ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ItemDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequenceLinkId; + + /** + * The adjudications results. + */ + @Child(name="adjudication", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The third tier service adjudications for submitted services. + */ + @Child(name="subdetail", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." ) + protected List subdetail; + + private static final long serialVersionUID = -812538L; + + public ItemDetailComponent() { + super(); + } + + public ItemDetailComponent(IntegerType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemDetailComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemDetailComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (DetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public DetailAdjudicationComponent addAdjudication() { //3 + DetailAdjudicationComponent t = new DetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + /** + * @return {@link #subdetail} (The third tier service adjudications for submitted services.) + */ + public List getSubdetail() { + if (this.subdetail == null) + this.subdetail = new ArrayList(); + return this.subdetail; + } + + public boolean hasSubdetail() { + if (this.subdetail == null) + return false; + for (ItemSubdetailComponent item : this.subdetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subdetail} (The third tier service adjudications for submitted services.) + */ + // syntactic sugar + public ItemSubdetailComponent addSubdetail() { //3 + ItemSubdetailComponent t = new ItemSubdetailComponent(); + if (this.subdetail == null) + this.subdetail = new ArrayList(); + this.subdetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("subdetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subdetail)); + } + + public ItemDetailComponent copy() { + ItemDetailComponent dst = new ItemDetailComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (DetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (subdetail != null) { + dst.subdetail = new ArrayList(); + for (ItemSubdetailComponent i : subdetail) + dst.subdetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) + && (subdetail == null || subdetail.isEmpty()); + } + + } + + @Block() + public static class DetailAdjudicationComponent extends BackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name="code", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name="amount", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + public DetailAdjudicationComponent() { + super(); + } + + public DetailAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public DetailAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public DetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public DetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public DetailAdjudicationComponent copy() { + DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ItemSubdetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequenceLinkId; + + /** + * The adjudications results. + */ + @Child(name="adjudication", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = -1143083130L; + + public ItemSubdetailComponent() { + super(); + } + + public ItemSubdetailComponent(IntegerType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemSubdetailComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemSubdetailComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemSubdetailComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (SubdetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public SubdetailAdjudicationComponent addAdjudication() { //3 + SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + public ItemSubdetailComponent copy() { + ItemSubdetailComponent dst = new ItemSubdetailComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (SubdetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) + ; + } + + } + + @Block() + public static class SubdetailAdjudicationComponent extends BackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name="code", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name="amount", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + public SubdetailAdjudicationComponent() { + super(); + } + + public SubdetailAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public SubdetailAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public SubdetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SubdetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public SubdetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public SubdetailAdjudicationComponent copy() { + SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class AddedItemComponent extends BackboneElement { + /** + * List of input service items which this service line is intended to replace. + */ + @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) + protected List sequenceLinkId; + + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name="fee", type={Money.class}, order=3, min=0, max=1) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * A list of note references to the notes provided below. + */ + @Child(name="noteNumberLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) + protected List noteNumberLinkId; + + /** + * The adjudications results. + */ + @Child(name="adjudication", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + /** + * The second tier service adjudications for payor added services. + */ + @Child(name="detail", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) + protected List detail; + + private static final long serialVersionUID = -1703432926L; + + public AddedItemComponent() { + super(); + } + + public AddedItemComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public List getSequenceLinkId() { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkId() { + if (this.sequenceLinkId == null) + return false; + for (IntegerType item : this.sequenceLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + // syntactic sugar + public IntegerType addSequenceLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return t; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public AddedItemComponent addSequenceLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.sequenceLinkId == null) + this.sequenceLinkId = new ArrayList(); + this.sequenceLinkId.add(t); + return this; + } + + /** + * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) + */ + public boolean hasSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + return false; + for (IntegerType v : this.sequenceLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public List getNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + return this.noteNumberLinkId; + } + + public boolean hasNoteNumberLinkId() { + if (this.noteNumberLinkId == null) + return false; + for (IntegerType item : this.noteNumberLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + // syntactic sugar + public IntegerType addNoteNumberLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return t; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public AddedItemComponent addNoteNumberLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.noteNumberLinkId == null) + this.noteNumberLinkId = new ArrayList(); + this.noteNumberLinkId.add(t); + return this; + } + + /** + * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) + */ + public boolean hasNoteNumberLinkId(int value) { + if (this.noteNumberLinkId == null) + return false; + for (IntegerType v : this.noteNumberLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemAdjudicationComponent addAdjudication() { //3 + AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (AddedItemsDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (The second tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemsDetailComponent addDetail() { //3 + AddedItemsDetailComponent t = new AddedItemsDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("noteNumberLinkId", "integer", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public AddedItemComponent copy() { + AddedItemComponent dst = new AddedItemComponent(); + copyValues(dst); + if (sequenceLinkId != null) { + dst.sequenceLinkId = new ArrayList(); + for (IntegerType i : sequenceLinkId) + dst.sequenceLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (noteNumberLinkId != null) { + dst.noteNumberLinkId = new ArrayList(); + for (IntegerType i : noteNumberLinkId) + dst.noteNumberLinkId.add(i.copy()); + }; + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (AddedItemsDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) + && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) + && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class AddedItemAdjudicationComponent extends BackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name="code", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name="amount", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + public AddedItemAdjudicationComponent() { + super(); + } + + public AddedItemAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public AddedItemAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public AddedItemAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public AddedItemAdjudicationComponent copy() { + AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class AddedItemsDetailComponent extends BackboneElement { + /** + * A code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The fee charged for the professional service or product.. + */ + @Child(name="fee", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) + protected Money fee; + + /** + * The adjudications results. + */ + @Child(name="adjudication", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) + protected List adjudication; + + private static final long serialVersionUID = -2104242020L; + + public AddedItemsDetailComponent() { + super(); + } + + public AddedItemsDetailComponent(Coding service) { + super(); + this.service = service; + } + + /** + * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) + */ + public AddedItemsDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #fee} (The fee charged for the professional service or product..) + */ + public Money getFee() { + if (this.fee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); + else if (Configuration.doAutoCreate()) + this.fee = new Money(); + return this.fee; + } + + public boolean hasFee() { + return this.fee != null && !this.fee.isEmpty(); + } + + /** + * @param value {@link #fee} (The fee charged for the professional service or product..) + */ + public AddedItemsDetailComponent setFee(Money value) { + this.fee = value; + return this; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + public List getAdjudication() { + if (this.adjudication == null) + this.adjudication = new ArrayList(); + return this.adjudication; + } + + public boolean hasAdjudication() { + if (this.adjudication == null) + return false; + for (AddedItemDetailAdjudicationComponent item : this.adjudication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #adjudication} (The adjudications results.) + */ + // syntactic sugar + public AddedItemDetailAdjudicationComponent addAdjudication() { //3 + AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); + if (this.adjudication == null) + this.adjudication = new ArrayList(); + this.adjudication.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); + childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); + } + + public AddedItemsDetailComponent copy() { + AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); + copyValues(dst); + dst.service = service == null ? null : service.copy(); + dst.fee = fee == null ? null : fee.copy(); + if (adjudication != null) { + dst.adjudication = new ArrayList(); + for (AddedItemDetailAdjudicationComponent i : adjudication) + dst.adjudication.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) + && (adjudication == null || adjudication.isEmpty()); + } + + } + + @Block() + public static class AddedItemDetailAdjudicationComponent extends BackboneElement { + /** + * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + */ + @Child(name="code", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) + protected Coding code; + + /** + * Monitory amount associated with the code. + */ + @Child(name="amount", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="Monitary amount", formalDefinition="Monitory amount associated with the code." ) + protected Money amount; + + /** + * A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + @Child(name="value", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monitary value for example a percentage. Mutually exclusive to the amount element above." ) + protected DecimalType value; + + private static final long serialVersionUID = -949880587L; + + public AddedItemDetailAdjudicationComponent() { + super(); + } + + public AddedItemDetailAdjudicationComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) + */ + public AddedItemDetailAdjudicationComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #amount} (Monitory amount associated with the code.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Monitory amount associated with the code.) + */ + public AddedItemDetailAdjudicationComponent setAmount(Money value) { + this.amount = value; + return this; + } + + /** + * @return {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (A non-monitary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value A non-monitary value for example a percentage. Mutually exclusive to the amount element above. + */ + public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); + childrenList.add(new Property("value", "decimal", "A non-monitary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public AddedItemDetailAdjudicationComponent copy() { + AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.amount = amount == null ? null : amount.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (amount == null || amount.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ErrorsComponent extends BackboneElement { + /** + * The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + */ + @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere." ) + protected IntegerType sequenceLinkId; + + /** + * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + @Child(name="detailSequenceLinkId", type={IntegerType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) + protected IntegerType detailSequenceLinkId; + + /** + * The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + @Child(name="subdetailSequenceLinkId", type={IntegerType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition." ) + protected IntegerType subdetailSequenceLinkId; + + /** + * An error code,froma specified code system, which details why the claim could not be adjudicated. + */ + @Child(name="code", type={Coding.class}, order=4, min=1, max=1) + @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,froma specified code system, which details why the claim could not be adjudicated." ) + protected Coding code; + + private static final long serialVersionUID = 878850209L; + + public ErrorsComponent() { + super(); + } + + public ErrorsComponent(Coding code) { + super(); + this.code = code; + } + + /** + * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + */ + public ErrorsComponent setSequenceLinkId(int value) { + if (value == -1) + this.sequenceLinkId = null; + else { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + } + return this; + } + + /** + * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value + */ + public IntegerType getDetailSequenceLinkIdElement() { + if (this.detailSequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.detailSequenceLinkId = new IntegerType(); + return this.detailSequenceLinkId; + } + + public boolean hasDetailSequenceLinkIdElement() { + return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); + } + + public boolean hasDetailSequenceLinkId() { + return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setDetailSequenceLinkIdElement(IntegerType value) { + this.detailSequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public int getDetailSequenceLinkId() { + return this.detailSequenceLinkId == null ? null : this.detailSequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public ErrorsComponent setDetailSequenceLinkId(int value) { + if (value == -1) + this.detailSequenceLinkId = null; + else { + if (this.detailSequenceLinkId == null) + this.detailSequenceLinkId = new IntegerType(); + this.detailSequenceLinkId.setValue(value); + } + return this; + } + + /** + * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value + */ + public IntegerType getSubdetailSequenceLinkIdElement() { + if (this.subdetailSequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.subdetailSequenceLinkId = new IntegerType(); + return this.subdetailSequenceLinkId; + } + + public boolean hasSubdetailSequenceLinkIdElement() { + return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); + } + + public boolean hasSubdetailSequenceLinkId() { + return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value + */ + public ErrorsComponent setSubdetailSequenceLinkIdElement(IntegerType value) { + this.subdetailSequenceLinkId = value; + return this; + } + + /** + * @return The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public int getSubdetailSequenceLinkId() { + return this.subdetailSequenceLinkId == null ? null : this.subdetailSequenceLinkId.getValue(); + } + + /** + * @param value The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + */ + public ErrorsComponent setSubdetailSequenceLinkId(int value) { + if (value == -1) + this.subdetailSequenceLinkId = null; + else { + if (this.subdetailSequenceLinkId == null) + this.subdetailSequenceLinkId = new IntegerType(); + this.subdetailSequenceLinkId.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ErrorsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (An error code,froma specified code system, which details why the claim could not be adjudicated.) + */ + public ErrorsComponent setCode(Coding value) { + this.code = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + childrenList.add(new Property("detailSequenceLinkId", "integer", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); + childrenList.add(new Property("subdetailSequenceLinkId", "integer", "The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); + childrenList.add(new Property("code", "Coding", "An error code,froma specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public ErrorsComponent copy() { + ErrorsComponent dst = new ErrorsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy(); + dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty()) + && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + } + + @Block() + public static class NotesComponent extends BackboneElement { + /** + * An integer associated with each note which may be referred to from each service line item. + */ + @Child(name="number", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) + protected IntegerType number; + + /** + * The note purpose: Print/Display. + */ + @Child(name="type", type={Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name="text", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Note explanitory text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = -1837694409L; + + public NotesComponent() { + super(); + } + + /** + * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public IntegerType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new IntegerType(); + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public NotesComponent setNumberElement(IntegerType value) { + this.number = value; + return this; + } + + /** + * @return An integer associated with each note which may be referred to from each service line item. + */ + public int getNumber() { + return this.number == null ? null : this.number.getValue(); + } + + /** + * @param value An integer associated with each note which may be referred to from each service line item. + */ + public NotesComponent setNumber(int value) { + if (value == -1) + this.number = null; + else { + if (this.number == null) + this.number = new IntegerType(); + this.number.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "integer", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) + && (text == null || text.isEmpty()); + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Response number", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @Child(name="request", type={OralHealthClaim.class}, order=0, min=0, max=1) + @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request resource referrence.) + */ + protected OralHealthClaim requestTarget; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name="organization", type={Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="requestProvider", type={Practitioner.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="requestOrganization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name="outcome", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name="disposition", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="payeeType", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding payeeType; + + /** + * The first tier service adjudications for submitted services. + */ + @Child(name="item", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) + protected List item; + + /** + * The first tier service adjudications for payor added services. + */ + @Child(name="additem", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) + protected List additem; + + /** + * Mutually exclusive with Services Provided (Item). + */ + @Child(name="error", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) + protected List error; + + /** + * The total cost of the services reported. + */ + @Child(name="totalCost", type={Money.class}, order=13, min=0, max=1) + @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) + protected Money totalCost; + + /** + * The amount of deductable applied which was not allocated to any particular service line. + */ + @Child(name="unallocDeductable", type={Money.class}, order=14, min=0, max=1) + @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) + protected Money unallocDeductable; + + /** + * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). + */ + @Child(name="totalBenefit", type={Money.class}, order=15, min=0, max=1) + @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) + protected Money totalBenefit; + + /** + * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. + */ + @Child(name="paymentAdjustment", type={Money.class}, order=16, min=0, max=1) + @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) + protected Money paymentAdjustment; + + /** + * Reason for the payment adjustment. + */ + @Child(name="paymentAdjustmentReason", type={Coding.class}, order=17, min=0, max=1) + @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) + protected Coding paymentAdjustmentReason; + + /** + * Estimated payment data. + */ + @Child(name="paymentDate", type={DateType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) + protected DateType paymentDate; + + /** + * Payable less any payment adjustment. + */ + @Child(name="paymentAmount", type={Money.class}, order=19, min=0, max=1) + @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) + protected Money paymentAmount; + + /** + * Payment identifer. + */ + @Child(name="paymentRef", type={Identifier.class}, order=20, min=0, max=1) + @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) + protected Identifier paymentRef; + + /** + * Status of funds reservation (For provider, for Patient, None). + */ + @Child(name="reserved", type={Coding.class}, order=21, min=0, max=1) + @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) + protected Coding reserved; + + /** + * The form to be used for printing the content. + */ + @Child(name="form", type={Coding.class}, order=22, min=0, max=1) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Note text. + */ + @Child(name="note", type={}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) + protected List note; + + private static final long serialVersionUID = -1199888229L; + + public ClaimResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public ClaimResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 OralHealthClaim getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new OralHealthClaim(); + 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 ClaimResponse setRequestTarget(OralHealthClaim value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 ClaimResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public ClaimResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public ClaimResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Insurer who produced this adjudicated response.) + */ + public ClaimResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 ClaimResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ClaimResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 ClaimResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public ClaimResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public ClaimResponse setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ClaimResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ClaimResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getPayeeType() { + if (this.payeeType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.payeeType"); + else if (Configuration.doAutoCreate()) + this.payeeType = new Coding(); + return this.payeeType; + } + + public boolean hasPayeeType() { + return this.payeeType != null && !this.payeeType.isEmpty(); + } + + /** + * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) + */ + public ClaimResponse setPayeeType(Coding value) { + this.payeeType = value; + return this; + } + + /** + * @return {@link #item} (The first tier service adjudications for submitted services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (The first tier service adjudications for submitted services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additem} (The first tier service adjudications for payor added services.) + */ + public List getAdditem() { + if (this.additem == null) + this.additem = new ArrayList(); + return this.additem; + } + + public boolean hasAdditem() { + if (this.additem == null) + return false; + for (AddedItemComponent item : this.additem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additem} (The first tier service adjudications for payor added services.) + */ + // syntactic sugar + public AddedItemComponent addAdditem() { //3 + AddedItemComponent t = new AddedItemComponent(); + if (this.additem == null) + this.additem = new ArrayList(); + this.additem.add(t); + return t; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (ErrorsComponent item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Mutually exclusive with Services Provided (Item).) + */ + // syntactic sugar + public ErrorsComponent addError() { //3 + ErrorsComponent t = new ErrorsComponent(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + /** + * @return {@link #totalCost} (The total cost of the services reported.) + */ + public Money getTotalCost() { + if (this.totalCost == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.totalCost"); + else if (Configuration.doAutoCreate()) + this.totalCost = new Money(); + return this.totalCost; + } + + public boolean hasTotalCost() { + return this.totalCost != null && !this.totalCost.isEmpty(); + } + + /** + * @param value {@link #totalCost} (The total cost of the services reported.) + */ + public ClaimResponse setTotalCost(Money value) { + this.totalCost = value; + return this; + } + + /** + * @return {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) + */ + public Money getUnallocDeductable() { + if (this.unallocDeductable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable"); + else if (Configuration.doAutoCreate()) + this.unallocDeductable = new Money(); + return this.unallocDeductable; + } + + public boolean hasUnallocDeductable() { + return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); + } + + /** + * @param value {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) + */ + public ClaimResponse setUnallocDeductable(Money value) { + this.unallocDeductable = value; + return this; + } + + /** + * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) + */ + public Money getTotalBenefit() { + if (this.totalBenefit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.totalBenefit"); + else if (Configuration.doAutoCreate()) + this.totalBenefit = new Money(); + return this.totalBenefit; + } + + public boolean hasTotalBenefit() { + return this.totalBenefit != null && !this.totalBenefit.isEmpty(); + } + + /** + * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) + */ + public ClaimResponse setTotalBenefit(Money value) { + this.totalBenefit = value; + return this; + } + + /** + * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public Money getPaymentAdjustment() { + if (this.paymentAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustment = new Money(); + return this.paymentAdjustment; + } + + public boolean hasPaymentAdjustment() { + return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) + */ + public ClaimResponse setPaymentAdjustment(Money value) { + this.paymentAdjustment = value; + return this; + } + + /** + * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public Coding getPaymentAdjustmentReason() { + if (this.paymentAdjustmentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason"); + else if (Configuration.doAutoCreate()) + this.paymentAdjustmentReason = new Coding(); + return this.paymentAdjustmentReason; + } + + public boolean hasPaymentAdjustmentReason() { + return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); + } + + /** + * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) + */ + public ClaimResponse setPaymentAdjustmentReason(Coding value) { + this.paymentAdjustmentReason = value; + return this; + } + + /** + * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public DateType getPaymentDateElement() { + if (this.paymentDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentDate"); + else if (Configuration.doAutoCreate()) + this.paymentDate = new DateType(); + return this.paymentDate; + } + + public boolean hasPaymentDateElement() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + public boolean hasPaymentDate() { + return this.paymentDate != null && !this.paymentDate.isEmpty(); + } + + /** + * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value + */ + public ClaimResponse setPaymentDateElement(DateType value) { + this.paymentDate = value; + return this; + } + + /** + * @return Estimated payment data. + */ + public Date getPaymentDate() { + return this.paymentDate == null ? null : this.paymentDate.getValue(); + } + + /** + * @param value Estimated payment data. + */ + public ClaimResponse setPaymentDate(Date value) { + if (value == null) + this.paymentDate = null; + else { + if (this.paymentDate == null) + this.paymentDate = new DateType(); + this.paymentDate.setValue(value); + } + return this; + } + + /** + * @return {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public Money getPaymentAmount() { + if (this.paymentAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentAmount"); + else if (Configuration.doAutoCreate()) + this.paymentAmount = new Money(); + return this.paymentAmount; + } + + public boolean hasPaymentAmount() { + return this.paymentAmount != null && !this.paymentAmount.isEmpty(); + } + + /** + * @param value {@link #paymentAmount} (Payable less any payment adjustment.) + */ + public ClaimResponse setPaymentAmount(Money value) { + this.paymentAmount = value; + return this; + } + + /** + * @return {@link #paymentRef} (Payment identifer.) + */ + public Identifier getPaymentRef() { + if (this.paymentRef == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.paymentRef"); + else if (Configuration.doAutoCreate()) + this.paymentRef = new Identifier(); + return this.paymentRef; + } + + public boolean hasPaymentRef() { + return this.paymentRef != null && !this.paymentRef.isEmpty(); + } + + /** + * @param value {@link #paymentRef} (Payment identifer.) + */ + public ClaimResponse setPaymentRef(Identifier value) { + this.paymentRef = value; + return this; + } + + /** + * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public Coding getReserved() { + if (this.reserved == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.reserved"); + else if (Configuration.doAutoCreate()) + this.reserved = new Coding(); + return this.reserved; + } + + public boolean hasReserved() { + return this.reserved != null && !this.reserved.isEmpty(); + } + + /** + * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) + */ + public ClaimResponse setReserved(Coding value) { + this.reserved = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClaimResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public ClaimResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #note} (Note text.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Note text.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + protected void listChildren(List 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(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("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)); + 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("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); + childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, additem)); + childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); + childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); + childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); + childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); + childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); + childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); + childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); + childrenList.add(new Property("paymentRef", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); + childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public ClaimResponse copy() { + ClaimResponse dst = new ClaimResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.payeeType = payeeType == null ? null : payeeType.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additem != null) { + dst.additem = new ArrayList(); + for (AddedItemComponent i : additem) + dst.additem.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (ErrorsComponent i : error) + dst.error.add(i.copy()); + }; + dst.totalCost = totalCost == null ? null : totalCost.copy(); + dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); + dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); + dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); + dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); + dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); + dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); + dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); + dst.reserved = reserved == null ? null : reserved.copy(); + dst.form = form == null ? null : form.copy(); + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + protected ClaimResponse typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.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()) + && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ClaimResponse; + } + + @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java index f852ec26add..50c011977e5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java @@ -20,1402 +20,1402 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. - */ -@ResourceDef(name="ClinicalAssessment", profile="http://hl7.org/fhir/Profile/ClinicalAssessment") -public class ClinicalAssessment extends DomainResource { - - @Block() - public static class ClinicalAssessmentInvestigationsComponent extends BackboneElement { - /** - * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." ) - protected CodeableConcept code; - - /** - * A record of a specific investigation that was undertaken. - */ - @Child(name="item", type={Observation.class, QuestionnaireAnswers.class, FamilyHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." ) - protected List item; - /** - * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.) - */ - protected List itemTarget; - - - private static final long serialVersionUID = -301363326L; - - public ClinicalAssessmentInvestigationsComponent() { - super(); - } - - public ClinicalAssessmentInvestigationsComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessmentInvestigationsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) - */ - public ClinicalAssessmentInvestigationsComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #item} (A record of a specific investigation that was undertaken.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (Reference item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (A record of a specific investigation that was undertaken.) - */ - // syntactic sugar - public Reference addItem() { //3 - Reference t = new Reference(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #item} (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. A record of a specific investigation that was undertaken.) - */ - public List getItemTarget() { - if (this.itemTarget == null) - this.itemTarget = new ArrayList(); - return this.itemTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("item", "Reference(Observation|QuestionnaireAnswers|FamilyHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public ClinicalAssessmentInvestigationsComponent copy() { - ClinicalAssessmentInvestigationsComponent dst = new ClinicalAssessmentInvestigationsComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (Reference i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) - ; - } - - } - - @Block() - public static class ClinicalAssessmentDiagnosisComponent extends BackboneElement { - /** - * Specific text of code for diagnosis. - */ - @Child(name="item", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Specific text or code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) - protected CodeableConcept item; - - /** - * Which investigations support diagnosis. - */ - @Child(name="cause", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Which investigations support diagnosis", formalDefinition="Which investigations support diagnosis." ) - protected StringType cause; - - private static final long serialVersionUID = -888590978L; - - public ClinicalAssessmentDiagnosisComponent() { - super(); - } - - public ClinicalAssessmentDiagnosisComponent(CodeableConcept item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Specific text of code for diagnosis.) - */ - public CodeableConcept getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessmentDiagnosisComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new CodeableConcept(); - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Specific text of code for diagnosis.) - */ - public ClinicalAssessmentDiagnosisComponent setItem(CodeableConcept value) { - this.item = value; - return this; - } - - /** - * @return {@link #cause} (Which investigations support diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value - */ - public StringType getCauseElement() { - if (this.cause == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessmentDiagnosisComponent.cause"); - else if (Configuration.doAutoCreate()) - this.cause = new StringType(); - return this.cause; - } - - public boolean hasCauseElement() { - return this.cause != null && !this.cause.isEmpty(); - } - - public boolean hasCause() { - return this.cause != null && !this.cause.isEmpty(); - } - - /** - * @param value {@link #cause} (Which investigations support diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value - */ - public ClinicalAssessmentDiagnosisComponent setCauseElement(StringType value) { - this.cause = value; - return this; - } - - /** - * @return Which investigations support diagnosis. - */ - public String getCause() { - return this.cause == null ? null : this.cause.getValue(); - } - - /** - * @param value Which investigations support diagnosis. - */ - public ClinicalAssessmentDiagnosisComponent setCause(String value) { - if (Utilities.noString(value)) - this.cause = null; - else { - if (this.cause == null) - this.cause = new StringType(); - this.cause.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("cause", "string", "Which investigations support diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); - } - - public ClinicalAssessmentDiagnosisComponent copy() { - ClinicalAssessmentDiagnosisComponent dst = new ClinicalAssessmentDiagnosisComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.cause = cause == null ? null : cause.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) - ; - } - - } - - @Block() - public static class ClinicalAssessmentRuledOutComponent extends BackboneElement { - /** - * Specific text of code for diagnosis. - */ - @Child(name="item", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) - protected CodeableConcept item; - - /** - * Grounds for elimination. - */ - @Child(name="reason", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) - protected StringType reason; - - private static final long serialVersionUID = -1001661243L; - - public ClinicalAssessmentRuledOutComponent() { - super(); - } - - public ClinicalAssessmentRuledOutComponent(CodeableConcept item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Specific text of code for diagnosis.) - */ - public CodeableConcept getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessmentRuledOutComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new CodeableConcept(); - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Specific text of code for diagnosis.) - */ - public ClinicalAssessmentRuledOutComponent setItem(CodeableConcept value) { - this.item = value; - return this; - } - - /** - * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public StringType getReasonElement() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessmentRuledOutComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new StringType(); - return this.reason; - } - - public boolean hasReasonElement() { - return this.reason != null && !this.reason.isEmpty(); - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public ClinicalAssessmentRuledOutComponent setReasonElement(StringType value) { - this.reason = value; - return this; - } - - /** - * @return Grounds for elimination. - */ - public String getReason() { - return this.reason == null ? null : this.reason.getValue(); - } - - /** - * @param value Grounds for elimination. - */ - public ClinicalAssessmentRuledOutComponent setReason(String value) { - if (Utilities.noString(value)) - this.reason = null; - else { - if (this.reason == null) - this.reason = new StringType(); - this.reason.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason)); - } - - public ClinicalAssessmentRuledOutComponent copy() { - ClinicalAssessmentRuledOutComponent dst = new ClinicalAssessmentRuledOutComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.reason = reason == null ? null : reason.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) - ; - } - - } - - /** - * The patient being asssesed. - */ - @Child(name="patient", type={Patient.class}, order=-1, min=1, max=1) - @Description(shortDefinition="The patient being asssesed", formalDefinition="The patient being asssesed." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient being asssesed.) - */ - protected Patient patientTarget; - - /** - * The clinicial performing the assessment. - */ - @Child(name="assessor", type={Practitioner.class}, order=0, min=1, max=1) - @Description(shortDefinition="The clinicial performing the assessment", formalDefinition="The clinicial performing the assessment." ) - protected Reference assessor; - - /** - * The actual object that is the target of the reference (The clinicial performing the assessment.) - */ - protected Practitioner assessorTarget; - - /** - * The point in time at which the assessment was concluded (not when it was recorded). - */ - @Child(name="date", type={DateTimeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." ) - protected DateTimeType date; - - /** - * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - @Child(name="description", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." ) - protected StringType description; - - /** - * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. - */ - @Child(name="previous", type={ClinicalAssessment.class}, order=3, min=0, max=1) - @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." ) - protected Reference previous; - - /** - * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - protected ClinicalAssessment previousTarget; - - /** - * This a list of the general problems/conditions for a patient. - */ - @Child(name="problem", type={Condition.class, AllergyIntolerance.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." ) - protected List problem; - /** - * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.) - */ - protected List problemTarget; - - - /** - * A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment. - */ - @Child(name="careplan", type={CarePlan.class}, order=5, min=0, max=1) - @Description(shortDefinition="A specific careplan that prompted this assessment", formalDefinition="A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment." ) - protected Reference careplan; - - /** - * The actual object that is the target of the reference (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) - */ - protected CarePlan careplanTarget; - - /** - * A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment. - */ - @Child(name="referral", type={ReferralRequest.class}, order=6, min=0, max=1) - @Description(shortDefinition="A specific referral that lead to this assessment", formalDefinition="A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) - */ - protected ReferralRequest referralTarget; - - /** - * One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. - */ - @Child(name="investigations", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc)", formalDefinition="One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." ) - protected List investigations; - - /** - * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - @Child(name="protocol", type={UriType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." ) - protected UriType protocol; - - /** - * A text summary of the investigations and the diagnosis. - */ - @Child(name="summary", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) - protected StringType summary; - - /** - * An specific diagnosis that was considered likely or relevant to ongoing treatment. - */ - @Child(name="diagnosis", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Possible or likely diagnosis", formalDefinition="An specific diagnosis that was considered likely or relevant to ongoing treatment." ) - protected List diagnosis; - - /** - * Diagnoses/conditions resolved since the last assessment. - */ - @Child(name="resolved", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosies/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." ) - protected List resolved; - - /** - * Diagnosis considered not possible. - */ - @Child(name="ruledOut", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." ) - protected List ruledOut; - - /** - * Estimate of likely outcome. - */ - @Child(name="prognosis", type={StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." ) - protected StringType prognosis; - - /** - * Plan of action after assessment. - */ - @Child(name="plan", type={CarePlan.class}, order=14, min=0, max=1) - @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) - protected Reference plan; - - /** - * The actual object that is the target of the reference (Plan of action after assessment.) - */ - protected CarePlan planTarget; - - /** - * Actions taken during assessment. - */ - @Child(name="action", type={ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, NutritionOrder.class, Supply.class, Appointment.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) - protected List action; - /** - * The actual objects that are the target of the reference (Actions taken during assessment.) - */ - protected List actionTarget; - - - private static final long serialVersionUID = 1041335013L; - - public ClinicalAssessment() { - super(); - } - - public ClinicalAssessment(Reference patient, Reference assessor, DateTimeType date) { - super(); - this.patient = patient; - this.assessor = assessor; - this.date = date; - } - - /** - * @return {@link #patient} (The patient being asssesed.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.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} (The patient being asssesed.) - */ - public ClinicalAssessment 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. (The patient being asssesed.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.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. (The patient being asssesed.) - */ - public ClinicalAssessment setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #assessor} (The clinicial performing the assessment.) - */ - public Reference getAssessor() { - if (this.assessor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.assessor"); - else if (Configuration.doAutoCreate()) - this.assessor = new Reference(); - return this.assessor; - } - - public boolean hasAssessor() { - return this.assessor != null && !this.assessor.isEmpty(); - } - - /** - * @param value {@link #assessor} (The clinicial performing the assessment.) - */ - public ClinicalAssessment setAssessor(Reference value) { - this.assessor = value; - return this; - } - - /** - * @return {@link #assessor} 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 clinicial performing the assessment.) - */ - public Practitioner getAssessorTarget() { - if (this.assessorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.assessor"); - else if (Configuration.doAutoCreate()) - this.assessorTarget = new Practitioner(); - return this.assessorTarget; - } - - /** - * @param value {@link #assessor} 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 clinicial performing the assessment.) - */ - public ClinicalAssessment setAssessorTarget(Practitioner value) { - this.assessorTarget = value; - return this; - } - - /** - * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ClinicalAssessment setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The point in time at which the assessment was concluded (not when it was recorded). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The point in time at which the assessment was concluded (not when it was recorded). - */ - public ClinicalAssessment setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). 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 ClinicalAssessment.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} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ClinicalAssessment setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - public ClinicalAssessment setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public Reference getPrevious() { - if (this.previous == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.previous"); - else if (Configuration.doAutoCreate()) - this.previous = new Reference(); - return this.previous; - } - - public boolean hasPrevious() { - return this.previous != null && !this.previous.isEmpty(); - } - - /** - * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalAssessment setPrevious(Reference value) { - this.previous = value; - return this; - } - - /** - * @return {@link #previous} 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 reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalAssessment getPreviousTarget() { - if (this.previousTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.previous"); - else if (Configuration.doAutoCreate()) - this.previousTarget = new ClinicalAssessment(); - return this.previousTarget; - } - - /** - * @param value {@link #previous} 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 reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalAssessment setPreviousTarget(ClinicalAssessment value) { - this.previousTarget = value; - return this; - } - - /** - * @return {@link #problem} (This a list of the general problems/conditions for a patient.) - */ - public List getProblem() { - if (this.problem == null) - this.problem = new ArrayList(); - return this.problem; - } - - public boolean hasProblem() { - if (this.problem == null) - return false; - for (Reference item : this.problem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #problem} (This a list of the general problems/conditions for a patient.) - */ - // syntactic sugar - public Reference addProblem() { //3 - Reference t = new Reference(); - if (this.problem == null) - this.problem = new ArrayList(); - this.problem.add(t); - return t; - } - - /** - * @return {@link #problem} (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. This a list of the general problems/conditions for a patient.) - */ - public List getProblemTarget() { - if (this.problemTarget == null) - this.problemTarget = new ArrayList(); - return this.problemTarget; - } - - /** - * @return {@link #careplan} (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) - */ - public Reference getCareplan() { - if (this.careplan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.careplan"); - else if (Configuration.doAutoCreate()) - this.careplan = new Reference(); - return this.careplan; - } - - public boolean hasCareplan() { - return this.careplan != null && !this.careplan.isEmpty(); - } - - /** - * @param value {@link #careplan} (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) - */ - public ClinicalAssessment setCareplan(Reference value) { - this.careplan = value; - return this; - } - - /** - * @return {@link #careplan} 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 reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) - */ - public CarePlan getCareplanTarget() { - if (this.careplanTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.careplan"); - else if (Configuration.doAutoCreate()) - this.careplanTarget = new CarePlan(); - return this.careplanTarget; - } - - /** - * @param value {@link #careplan} 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 reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) - */ - public ClinicalAssessment setCareplanTarget(CarePlan value) { - this.careplanTarget = value; - return this; - } - - /** - * @return {@link #referral} (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) - */ - public ClinicalAssessment setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} 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 reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); - return this.referralTarget; - } - - /** - * @param value {@link #referral} 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 reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) - */ - public ClinicalAssessment setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) - */ - public List getInvestigations() { - if (this.investigations == null) - this.investigations = new ArrayList(); - return this.investigations; - } - - public boolean hasInvestigations() { - if (this.investigations == null) - return false; - for (ClinicalAssessmentInvestigationsComponent item : this.investigations) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) - */ - // syntactic sugar - public ClinicalAssessmentInvestigationsComponent addInvestigations() { //3 - ClinicalAssessmentInvestigationsComponent t = new ClinicalAssessmentInvestigationsComponent(); - if (this.investigations == null) - this.investigations = new ArrayList(); - this.investigations.add(t); - return t; - } - - /** - * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value - */ - public UriType getProtocolElement() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new UriType(); - return this.protocol; - } - - public boolean hasProtocolElement() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value - */ - public ClinicalAssessment setProtocolElement(UriType value) { - this.protocol = value; - return this; - } - - /** - * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - public String getProtocol() { - return this.protocol == null ? null : this.protocol.getValue(); - } - - /** - * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - public ClinicalAssessment setProtocol(String value) { - if (Utilities.noString(value)) - this.protocol = null; - else { - if (this.protocol == null) - this.protocol = new UriType(); - this.protocol.setValue(value); - } - return this; - } - - /** - * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value - */ - public StringType getSummaryElement() { - if (this.summary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.summary"); - else if (Configuration.doAutoCreate()) - this.summary = new StringType(); - return this.summary; - } - - public boolean hasSummaryElement() { - return this.summary != null && !this.summary.isEmpty(); - } - - public boolean hasSummary() { - return this.summary != null && !this.summary.isEmpty(); - } - - /** - * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value - */ - public ClinicalAssessment setSummaryElement(StringType value) { - this.summary = value; - return this; - } - - /** - * @return A text summary of the investigations and the diagnosis. - */ - public String getSummary() { - return this.summary == null ? null : this.summary.getValue(); - } - - /** - * @param value A text summary of the investigations and the diagnosis. - */ - public ClinicalAssessment setSummary(String value) { - if (Utilities.noString(value)) - this.summary = null; - else { - if (this.summary == null) - this.summary = new StringType(); - this.summary.setValue(value); - } - return this; - } - - /** - * @return {@link #diagnosis} (An specific diagnosis that was considered likely or relevant to ongoing treatment.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (ClinicalAssessmentDiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (An specific diagnosis that was considered likely or relevant to ongoing treatment.) - */ - // syntactic sugar - public ClinicalAssessmentDiagnosisComponent addDiagnosis() { //3 - ClinicalAssessmentDiagnosisComponent t = new ClinicalAssessmentDiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - /** - * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) - */ - public List getResolved() { - if (this.resolved == null) - this.resolved = new ArrayList(); - return this.resolved; - } - - public boolean hasResolved() { - if (this.resolved == null) - return false; - for (CodeableConcept item : this.resolved) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) - */ - // syntactic sugar - public CodeableConcept addResolved() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.resolved == null) - this.resolved = new ArrayList(); - this.resolved.add(t); - return t; - } - - /** - * @return {@link #ruledOut} (Diagnosis considered not possible.) - */ - public List getRuledOut() { - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - return this.ruledOut; - } - - public boolean hasRuledOut() { - if (this.ruledOut == null) - return false; - for (ClinicalAssessmentRuledOutComponent item : this.ruledOut) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ruledOut} (Diagnosis considered not possible.) - */ - // syntactic sugar - public ClinicalAssessmentRuledOutComponent addRuledOut() { //3 - ClinicalAssessmentRuledOutComponent t = new ClinicalAssessmentRuledOutComponent(); - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - this.ruledOut.add(t); - return t; - } - - /** - * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value - */ - public StringType getPrognosisElement() { - if (this.prognosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.prognosis"); - else if (Configuration.doAutoCreate()) - this.prognosis = new StringType(); - return this.prognosis; - } - - public boolean hasPrognosisElement() { - return this.prognosis != null && !this.prognosis.isEmpty(); - } - - public boolean hasPrognosis() { - return this.prognosis != null && !this.prognosis.isEmpty(); - } - - /** - * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value - */ - public ClinicalAssessment setPrognosisElement(StringType value) { - this.prognosis = value; - return this; - } - - /** - * @return Estimate of likely outcome. - */ - public String getPrognosis() { - return this.prognosis == null ? null : this.prognosis.getValue(); - } - - /** - * @param value Estimate of likely outcome. - */ - public ClinicalAssessment setPrognosis(String value) { - if (Utilities.noString(value)) - this.prognosis = null; - else { - if (this.prognosis == null) - this.prognosis = new StringType(); - this.prognosis.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (Plan of action after assessment.) - */ - public Reference getPlan() { - if (this.plan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.plan"); - else if (Configuration.doAutoCreate()) - this.plan = new Reference(); - return this.plan; - } - - public boolean hasPlan() { - return this.plan != null && !this.plan.isEmpty(); - } - - /** - * @param value {@link #plan} (Plan of action after assessment.) - */ - public ClinicalAssessment setPlan(Reference value) { - this.plan = value; - return this; - } - - /** - * @return {@link #plan} 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. (Plan of action after assessment.) - */ - public CarePlan getPlanTarget() { - if (this.planTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalAssessment.plan"); - else if (Configuration.doAutoCreate()) - this.planTarget = new CarePlan(); - return this.planTarget; - } - - /** - * @param value {@link #plan} 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. (Plan of action after assessment.) - */ - public ClinicalAssessment setPlanTarget(CarePlan value) { - this.planTarget = value; - return this; - } - - /** - * @return {@link #action} (Actions taken during assessment.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (Reference item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Actions taken during assessment.) - */ - // syntactic sugar - public Reference addAction() { //3 - Reference t = new Reference(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - /** - * @return {@link #action} (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. Actions taken during assessment.) - */ - public List getActionTarget() { - if (this.actionTarget == null) - this.actionTarget = new ArrayList(); - return this.actionTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient being asssesed.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinicial performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); - childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("previous", "Reference(ClinicalAssessment)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous)); - childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem)); - childrenList.add(new Property("careplan", "Reference(CarePlan)", "A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.", 0, java.lang.Integer.MAX_VALUE, careplan)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations)); - childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary)); - childrenList.add(new Property("diagnosis", "", "An specific diagnosis that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved)); - childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut)); - childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis)); - childrenList.add(new Property("plan", "Reference(CarePlan)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); - childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationPrescription|DiagnosticOrder|NutritionOrder|Supply|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - public ClinicalAssessment copy() { - ClinicalAssessment dst = new ClinicalAssessment(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.assessor = assessor == null ? null : assessor.copy(); - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - dst.previous = previous == null ? null : previous.copy(); - if (problem != null) { - dst.problem = new ArrayList(); - for (Reference i : problem) - dst.problem.add(i.copy()); - }; - dst.careplan = careplan == null ? null : careplan.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (investigations != null) { - dst.investigations = new ArrayList(); - for (ClinicalAssessmentInvestigationsComponent i : investigations) - dst.investigations.add(i.copy()); - }; - dst.protocol = protocol == null ? null : protocol.copy(); - dst.summary = summary == null ? null : summary.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (ClinicalAssessmentDiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (resolved != null) { - dst.resolved = new ArrayList(); - for (CodeableConcept i : resolved) - dst.resolved.add(i.copy()); - }; - if (ruledOut != null) { - dst.ruledOut = new ArrayList(); - for (ClinicalAssessmentRuledOutComponent i : ruledOut) - dst.ruledOut.add(i.copy()); - }; - dst.prognosis = prognosis == null ? null : prognosis.copy(); - dst.plan = plan == null ? null : plan.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (Reference i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - protected ClinicalAssessment typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) - && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) && (previous == null || previous.isEmpty()) - && (problem == null || problem.isEmpty()) && (careplan == null || careplan.isEmpty()) && (referral == null || referral.isEmpty()) - && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) - && (summary == null || summary.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) && (resolved == null || resolved.isEmpty()) - && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty()) - && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ClinicalAssessment; - } - - @SearchParamDefinition(name="previous", path="ClinicalAssessment.previous", description="Reference to last assessment", type="reference" ) - public static final String SP_PREVIOUS = "previous"; - @SearchParamDefinition(name="referral", path="ClinicalAssessment.referral", description="A specific referral that lead to this assessment", type="reference" ) - public static final String SP_REFERRAL = "referral"; - @SearchParamDefinition(name="diagnosis", path="ClinicalAssessment.diagnosis.item", description="Specific text or code for diagnosis", type="token" ) - public static final String SP_DIAGNOSIS = "diagnosis"; - @SearchParamDefinition(name="problem", path="ClinicalAssessment.problem", description="General assessment of patient state", type="reference" ) - public static final String SP_PROBLEM = "problem"; - @SearchParamDefinition(name="date", path="ClinicalAssessment.date", description="When the assessment occurred", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="careplan", path="ClinicalAssessment.careplan", description="A specific careplan that prompted this assessment", type="reference" ) - public static final String SP_CAREPLAN = "careplan"; - @SearchParamDefinition(name="ruledout", path="ClinicalAssessment.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) - public static final String SP_RULEDOUT = "ruledout"; - @SearchParamDefinition(name="assessor", path="ClinicalAssessment.assessor", description="The clinicial performing the assessment", type="reference" ) - public static final String SP_ASSESSOR = "assessor"; - @SearchParamDefinition(name="patient", path="ClinicalAssessment.patient", description="The patient being asssesed", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="resolved", path="ClinicalAssessment.resolved", description="Diagnosies/conditions resolved since previous assessment", type="token" ) - public static final String SP_RESOLVED = "resolved"; - @SearchParamDefinition(name="plan", path="ClinicalAssessment.plan", description="Plan of action after assessment", type="reference" ) - public static final String SP_PLAN = "plan"; - @SearchParamDefinition(name="action", path="ClinicalAssessment.action", description="Actions taken during assessment", type="reference" ) - public static final String SP_ACTION = "action"; - @SearchParamDefinition(name="investigation", path="ClinicalAssessment.investigations.item", description="Record of a specific investigation", type="reference" ) - public static final String SP_INVESTIGATION = "investigation"; - -} - + +/* + 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; +/** + * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. + */ +@ResourceDef(name="ClinicalAssessment", profile="http://hl7.org/fhir/Profile/ClinicalAssessment") +public class ClinicalAssessment extends DomainResource { + + @Block() + public static class ClinicalAssessmentInvestigationsComponent extends BackboneElement { + /** + * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." ) + protected CodeableConcept code; + + /** + * A record of a specific investigation that was undertaken. + */ + @Child(name="item", type={Observation.class, QuestionnaireAnswers.class, FamilyHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." ) + protected List item; + /** + * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.) + */ + protected List itemTarget; + + + private static final long serialVersionUID = -301363326L; + + public ClinicalAssessmentInvestigationsComponent() { + super(); + } + + public ClinicalAssessmentInvestigationsComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentInvestigationsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) + */ + public ClinicalAssessmentInvestigationsComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #item} (A record of a specific investigation that was undertaken.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (Reference item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (A record of a specific investigation that was undertaken.) + */ + // syntactic sugar + public Reference addItem() { //3 + Reference t = new Reference(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #item} (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. A record of a specific investigation that was undertaken.) + */ + public List getItemTarget() { + if (this.itemTarget == null) + this.itemTarget = new ArrayList(); + return this.itemTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("item", "Reference(Observation|QuestionnaireAnswers|FamilyHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public ClinicalAssessmentInvestigationsComponent copy() { + ClinicalAssessmentInvestigationsComponent dst = new ClinicalAssessmentInvestigationsComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (Reference i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + } + + @Block() + public static class ClinicalAssessmentDiagnosisComponent extends BackboneElement { + /** + * Specific text of code for diagnosis. + */ + @Child(name="item", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Specific text or code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) + protected CodeableConcept item; + + /** + * Which investigations support diagnosis. + */ + @Child(name="cause", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Which investigations support diagnosis", formalDefinition="Which investigations support diagnosis." ) + protected StringType cause; + + private static final long serialVersionUID = -888590978L; + + public ClinicalAssessmentDiagnosisComponent() { + super(); + } + + public ClinicalAssessmentDiagnosisComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentDiagnosisComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for diagnosis.) + */ + public ClinicalAssessmentDiagnosisComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #cause} (Which investigations support diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public StringType getCauseElement() { + if (this.cause == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentDiagnosisComponent.cause"); + else if (Configuration.doAutoCreate()) + this.cause = new StringType(); + return this.cause; + } + + public boolean hasCauseElement() { + return this.cause != null && !this.cause.isEmpty(); + } + + public boolean hasCause() { + return this.cause != null && !this.cause.isEmpty(); + } + + /** + * @param value {@link #cause} (Which investigations support diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public ClinicalAssessmentDiagnosisComponent setCauseElement(StringType value) { + this.cause = value; + return this; + } + + /** + * @return Which investigations support diagnosis. + */ + public String getCause() { + return this.cause == null ? null : this.cause.getValue(); + } + + /** + * @param value Which investigations support diagnosis. + */ + public ClinicalAssessmentDiagnosisComponent setCause(String value) { + if (Utilities.noString(value)) + this.cause = null; + else { + if (this.cause == null) + this.cause = new StringType(); + this.cause.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("cause", "string", "Which investigations support diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); + } + + public ClinicalAssessmentDiagnosisComponent copy() { + ClinicalAssessmentDiagnosisComponent dst = new ClinicalAssessmentDiagnosisComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.cause = cause == null ? null : cause.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) + ; + } + + } + + @Block() + public static class ClinicalAssessmentRuledOutComponent extends BackboneElement { + /** + * Specific text of code for diagnosis. + */ + @Child(name="item", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) + protected CodeableConcept item; + + /** + * Grounds for elimination. + */ + @Child(name="reason", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) + protected StringType reason; + + private static final long serialVersionUID = -1001661243L; + + public ClinicalAssessmentRuledOutComponent() { + super(); + } + + public ClinicalAssessmentRuledOutComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentRuledOutComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for diagnosis.) + */ + public ClinicalAssessmentRuledOutComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public StringType getReasonElement() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentRuledOutComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); + return this.reason; + } + + public boolean hasReasonElement() { + return this.reason != null && !this.reason.isEmpty(); + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public ClinicalAssessmentRuledOutComponent setReasonElement(StringType value) { + this.reason = value; + return this; + } + + /** + * @return Grounds for elimination. + */ + public String getReason() { + return this.reason == null ? null : this.reason.getValue(); + } + + /** + * @param value Grounds for elimination. + */ + public ClinicalAssessmentRuledOutComponent setReason(String value) { + if (Utilities.noString(value)) + this.reason = null; + else { + if (this.reason == null) + this.reason = new StringType(); + this.reason.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason)); + } + + public ClinicalAssessmentRuledOutComponent copy() { + ClinicalAssessmentRuledOutComponent dst = new ClinicalAssessmentRuledOutComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + } + + /** + * The patient being asssesed. + */ + @Child(name="patient", type={Patient.class}, order=-1, min=1, max=1) + @Description(shortDefinition="The patient being asssesed", formalDefinition="The patient being asssesed." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient being asssesed.) + */ + protected Patient patientTarget; + + /** + * The clinicial performing the assessment. + */ + @Child(name="assessor", type={Practitioner.class}, order=0, min=1, max=1) + @Description(shortDefinition="The clinicial performing the assessment", formalDefinition="The clinicial performing the assessment." ) + protected Reference assessor; + + /** + * The actual object that is the target of the reference (The clinicial performing the assessment.) + */ + protected Practitioner assessorTarget; + + /** + * The point in time at which the assessment was concluded (not when it was recorded). + */ + @Child(name="date", type={DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." ) + protected DateTimeType date; + + /** + * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." ) + protected StringType description; + + /** + * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. + */ + @Child(name="previous", type={ClinicalAssessment.class}, order=3, min=0, max=1) + @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." ) + protected Reference previous; + + /** + * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + protected ClinicalAssessment previousTarget; + + /** + * This a list of the general problems/conditions for a patient. + */ + @Child(name="problem", type={Condition.class, AllergyIntolerance.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." ) + protected List problem; + /** + * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.) + */ + protected List problemTarget; + + + /** + * A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment. + */ + @Child(name="careplan", type={CarePlan.class}, order=5, min=0, max=1) + @Description(shortDefinition="A specific careplan that prompted this assessment", formalDefinition="A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment." ) + protected Reference careplan; + + /** + * The actual object that is the target of the reference (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + protected CarePlan careplanTarget; + + /** + * A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment. + */ + @Child(name="referral", type={ReferralRequest.class}, order=6, min=0, max=1) + @Description(shortDefinition="A specific referral that lead to this assessment", formalDefinition="A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + protected ReferralRequest referralTarget; + + /** + * One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. + */ + @Child(name="investigations", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc)", formalDefinition="One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." ) + protected List investigations; + + /** + * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + @Child(name="protocol", type={UriType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." ) + protected UriType protocol; + + /** + * A text summary of the investigations and the diagnosis. + */ + @Child(name="summary", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) + protected StringType summary; + + /** + * An specific diagnosis that was considered likely or relevant to ongoing treatment. + */ + @Child(name="diagnosis", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Possible or likely diagnosis", formalDefinition="An specific diagnosis that was considered likely or relevant to ongoing treatment." ) + protected List diagnosis; + + /** + * Diagnoses/conditions resolved since the last assessment. + */ + @Child(name="resolved", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosies/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." ) + protected List resolved; + + /** + * Diagnosis considered not possible. + */ + @Child(name="ruledOut", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." ) + protected List ruledOut; + + /** + * Estimate of likely outcome. + */ + @Child(name="prognosis", type={StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." ) + protected StringType prognosis; + + /** + * Plan of action after assessment. + */ + @Child(name="plan", type={CarePlan.class}, order=14, min=0, max=1) + @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) + protected Reference plan; + + /** + * The actual object that is the target of the reference (Plan of action after assessment.) + */ + protected CarePlan planTarget; + + /** + * Actions taken during assessment. + */ + @Child(name="action", type={ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, NutritionOrder.class, Supply.class, Appointment.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) + protected List action; + /** + * The actual objects that are the target of the reference (Actions taken during assessment.) + */ + protected List actionTarget; + + + private static final long serialVersionUID = 1041335013L; + + public ClinicalAssessment() { + super(); + } + + public ClinicalAssessment(Reference patient, Reference assessor, DateTimeType date) { + super(); + this.patient = patient; + this.assessor = assessor; + this.date = date; + } + + /** + * @return {@link #patient} (The patient being asssesed.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.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} (The patient being asssesed.) + */ + public ClinicalAssessment 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. (The patient being asssesed.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.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. (The patient being asssesed.) + */ + public ClinicalAssessment setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #assessor} (The clinicial performing the assessment.) + */ + public Reference getAssessor() { + if (this.assessor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.assessor"); + else if (Configuration.doAutoCreate()) + this.assessor = new Reference(); + return this.assessor; + } + + public boolean hasAssessor() { + return this.assessor != null && !this.assessor.isEmpty(); + } + + /** + * @param value {@link #assessor} (The clinicial performing the assessment.) + */ + public ClinicalAssessment setAssessor(Reference value) { + this.assessor = value; + return this; + } + + /** + * @return {@link #assessor} 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 clinicial performing the assessment.) + */ + public Practitioner getAssessorTarget() { + if (this.assessorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.assessor"); + else if (Configuration.doAutoCreate()) + this.assessorTarget = new Practitioner(); + return this.assessorTarget; + } + + /** + * @param value {@link #assessor} 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 clinicial performing the assessment.) + */ + public ClinicalAssessment setAssessorTarget(Practitioner value) { + this.assessorTarget = value; + return this; + } + + /** + * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ClinicalAssessment setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The point in time at which the assessment was concluded (not when it was recorded). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The point in time at which the assessment was concluded (not when it was recorded). + */ + public ClinicalAssessment setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). 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 ClinicalAssessment.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} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ClinicalAssessment setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + public ClinicalAssessment setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public Reference getPrevious() { + if (this.previous == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.previous"); + else if (Configuration.doAutoCreate()) + this.previous = new Reference(); + return this.previous; + } + + public boolean hasPrevious() { + return this.previous != null && !this.previous.isEmpty(); + } + + /** + * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalAssessment setPrevious(Reference value) { + this.previous = value; + return this; + } + + /** + * @return {@link #previous} 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 reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalAssessment getPreviousTarget() { + if (this.previousTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.previous"); + else if (Configuration.doAutoCreate()) + this.previousTarget = new ClinicalAssessment(); + return this.previousTarget; + } + + /** + * @param value {@link #previous} 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 reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalAssessment setPreviousTarget(ClinicalAssessment value) { + this.previousTarget = value; + return this; + } + + /** + * @return {@link #problem} (This a list of the general problems/conditions for a patient.) + */ + public List getProblem() { + if (this.problem == null) + this.problem = new ArrayList(); + return this.problem; + } + + public boolean hasProblem() { + if (this.problem == null) + return false; + for (Reference item : this.problem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #problem} (This a list of the general problems/conditions for a patient.) + */ + // syntactic sugar + public Reference addProblem() { //3 + Reference t = new Reference(); + if (this.problem == null) + this.problem = new ArrayList(); + this.problem.add(t); + return t; + } + + /** + * @return {@link #problem} (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. This a list of the general problems/conditions for a patient.) + */ + public List getProblemTarget() { + if (this.problemTarget == null) + this.problemTarget = new ArrayList(); + return this.problemTarget; + } + + /** + * @return {@link #careplan} (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public Reference getCareplan() { + if (this.careplan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.careplan"); + else if (Configuration.doAutoCreate()) + this.careplan = new Reference(); + return this.careplan; + } + + public boolean hasCareplan() { + return this.careplan != null && !this.careplan.isEmpty(); + } + + /** + * @param value {@link #careplan} (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public ClinicalAssessment setCareplan(Reference value) { + this.careplan = value; + return this; + } + + /** + * @return {@link #careplan} 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 reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public CarePlan getCareplanTarget() { + if (this.careplanTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.careplan"); + else if (Configuration.doAutoCreate()) + this.careplanTarget = new CarePlan(); + return this.careplanTarget; + } + + /** + * @param value {@link #careplan} 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 reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public ClinicalAssessment setCareplanTarget(CarePlan value) { + this.careplanTarget = value; + return this; + } + + /** + * @return {@link #referral} (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public ClinicalAssessment setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} 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 reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} 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 reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public ClinicalAssessment setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) + */ + public List getInvestigations() { + if (this.investigations == null) + this.investigations = new ArrayList(); + return this.investigations; + } + + public boolean hasInvestigations() { + if (this.investigations == null) + return false; + for (ClinicalAssessmentInvestigationsComponent item : this.investigations) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) + */ + // syntactic sugar + public ClinicalAssessmentInvestigationsComponent addInvestigations() { //3 + ClinicalAssessmentInvestigationsComponent t = new ClinicalAssessmentInvestigationsComponent(); + if (this.investigations == null) + this.investigations = new ArrayList(); + this.investigations.add(t); + return t; + } + + /** + * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value + */ + public UriType getProtocolElement() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new UriType(); + return this.protocol; + } + + public boolean hasProtocolElement() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value + */ + public ClinicalAssessment setProtocolElement(UriType value) { + this.protocol = value; + return this; + } + + /** + * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + public String getProtocol() { + return this.protocol == null ? null : this.protocol.getValue(); + } + + /** + * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + public ClinicalAssessment setProtocol(String value) { + if (Utilities.noString(value)) + this.protocol = null; + else { + if (this.protocol == null) + this.protocol = new UriType(); + this.protocol.setValue(value); + } + return this; + } + + /** + * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value + */ + public StringType getSummaryElement() { + if (this.summary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new StringType(); + return this.summary; + } + + public boolean hasSummaryElement() { + return this.summary != null && !this.summary.isEmpty(); + } + + public boolean hasSummary() { + return this.summary != null && !this.summary.isEmpty(); + } + + /** + * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value + */ + public ClinicalAssessment setSummaryElement(StringType value) { + this.summary = value; + return this; + } + + /** + * @return A text summary of the investigations and the diagnosis. + */ + public String getSummary() { + return this.summary == null ? null : this.summary.getValue(); + } + + /** + * @param value A text summary of the investigations and the diagnosis. + */ + public ClinicalAssessment setSummary(String value) { + if (Utilities.noString(value)) + this.summary = null; + else { + if (this.summary == null) + this.summary = new StringType(); + this.summary.setValue(value); + } + return this; + } + + /** + * @return {@link #diagnosis} (An specific diagnosis that was considered likely or relevant to ongoing treatment.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (ClinicalAssessmentDiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (An specific diagnosis that was considered likely or relevant to ongoing treatment.) + */ + // syntactic sugar + public ClinicalAssessmentDiagnosisComponent addDiagnosis() { //3 + ClinicalAssessmentDiagnosisComponent t = new ClinicalAssessmentDiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) + */ + public List getResolved() { + if (this.resolved == null) + this.resolved = new ArrayList(); + return this.resolved; + } + + public boolean hasResolved() { + if (this.resolved == null) + return false; + for (CodeableConcept item : this.resolved) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) + */ + // syntactic sugar + public CodeableConcept addResolved() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.resolved == null) + this.resolved = new ArrayList(); + this.resolved.add(t); + return t; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + public List getRuledOut() { + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + return this.ruledOut; + } + + public boolean hasRuledOut() { + if (this.ruledOut == null) + return false; + for (ClinicalAssessmentRuledOutComponent item : this.ruledOut) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + // syntactic sugar + public ClinicalAssessmentRuledOutComponent addRuledOut() { //3 + ClinicalAssessmentRuledOutComponent t = new ClinicalAssessmentRuledOutComponent(); + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + this.ruledOut.add(t); + return t; + } + + /** + * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value + */ + public StringType getPrognosisElement() { + if (this.prognosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.prognosis"); + else if (Configuration.doAutoCreate()) + this.prognosis = new StringType(); + return this.prognosis; + } + + public boolean hasPrognosisElement() { + return this.prognosis != null && !this.prognosis.isEmpty(); + } + + public boolean hasPrognosis() { + return this.prognosis != null && !this.prognosis.isEmpty(); + } + + /** + * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value + */ + public ClinicalAssessment setPrognosisElement(StringType value) { + this.prognosis = value; + return this; + } + + /** + * @return Estimate of likely outcome. + */ + public String getPrognosis() { + return this.prognosis == null ? null : this.prognosis.getValue(); + } + + /** + * @param value Estimate of likely outcome. + */ + public ClinicalAssessment setPrognosis(String value) { + if (Utilities.noString(value)) + this.prognosis = null; + else { + if (this.prognosis == null) + this.prognosis = new StringType(); + this.prognosis.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Plan of action after assessment.) + */ + public Reference getPlan() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new Reference(); + return this.plan; + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (Plan of action after assessment.) + */ + public ClinicalAssessment setPlan(Reference value) { + this.plan = value; + return this; + } + + /** + * @return {@link #plan} 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. (Plan of action after assessment.) + */ + public CarePlan getPlanTarget() { + if (this.planTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.plan"); + else if (Configuration.doAutoCreate()) + this.planTarget = new CarePlan(); + return this.planTarget; + } + + /** + * @param value {@link #plan} 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. (Plan of action after assessment.) + */ + public ClinicalAssessment setPlanTarget(CarePlan value) { + this.planTarget = value; + return this; + } + + /** + * @return {@link #action} (Actions taken during assessment.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (Reference item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Actions taken during assessment.) + */ + // syntactic sugar + public Reference addAction() { //3 + Reference t = new Reference(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + /** + * @return {@link #action} (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. Actions taken during assessment.) + */ + public List getActionTarget() { + if (this.actionTarget == null) + this.actionTarget = new ArrayList(); + return this.actionTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient being asssesed.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinicial performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); + childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("previous", "Reference(ClinicalAssessment)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous)); + childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem)); + childrenList.add(new Property("careplan", "Reference(CarePlan)", "A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.", 0, java.lang.Integer.MAX_VALUE, careplan)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations)); + childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary)); + childrenList.add(new Property("diagnosis", "", "An specific diagnosis that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved)); + childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut)); + childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis)); + childrenList.add(new Property("plan", "Reference(CarePlan)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationPrescription|DiagnosticOrder|NutritionOrder|Supply|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + public ClinicalAssessment copy() { + ClinicalAssessment dst = new ClinicalAssessment(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.assessor = assessor == null ? null : assessor.copy(); + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + dst.previous = previous == null ? null : previous.copy(); + if (problem != null) { + dst.problem = new ArrayList(); + for (Reference i : problem) + dst.problem.add(i.copy()); + }; + dst.careplan = careplan == null ? null : careplan.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (investigations != null) { + dst.investigations = new ArrayList(); + for (ClinicalAssessmentInvestigationsComponent i : investigations) + dst.investigations.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + dst.summary = summary == null ? null : summary.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (ClinicalAssessmentDiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (resolved != null) { + dst.resolved = new ArrayList(); + for (CodeableConcept i : resolved) + dst.resolved.add(i.copy()); + }; + if (ruledOut != null) { + dst.ruledOut = new ArrayList(); + for (ClinicalAssessmentRuledOutComponent i : ruledOut) + dst.ruledOut.add(i.copy()); + }; + dst.prognosis = prognosis == null ? null : prognosis.copy(); + dst.plan = plan == null ? null : plan.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (Reference i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected ClinicalAssessment typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) + && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) && (previous == null || previous.isEmpty()) + && (problem == null || problem.isEmpty()) && (careplan == null || careplan.isEmpty()) && (referral == null || referral.isEmpty()) + && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (summary == null || summary.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) && (resolved == null || resolved.isEmpty()) + && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty()) + && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ClinicalAssessment; + } + + @SearchParamDefinition(name="previous", path="ClinicalAssessment.previous", description="Reference to last assessment", type="reference" ) + public static final String SP_PREVIOUS = "previous"; + @SearchParamDefinition(name="referral", path="ClinicalAssessment.referral", description="A specific referral that lead to this assessment", type="reference" ) + public static final String SP_REFERRAL = "referral"; + @SearchParamDefinition(name="diagnosis", path="ClinicalAssessment.diagnosis.item", description="Specific text or code for diagnosis", type="token" ) + public static final String SP_DIAGNOSIS = "diagnosis"; + @SearchParamDefinition(name="problem", path="ClinicalAssessment.problem", description="General assessment of patient state", type="reference" ) + public static final String SP_PROBLEM = "problem"; + @SearchParamDefinition(name="date", path="ClinicalAssessment.date", description="When the assessment occurred", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="careplan", path="ClinicalAssessment.careplan", description="A specific careplan that prompted this assessment", type="reference" ) + public static final String SP_CAREPLAN = "careplan"; + @SearchParamDefinition(name="ruledout", path="ClinicalAssessment.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) + public static final String SP_RULEDOUT = "ruledout"; + @SearchParamDefinition(name="assessor", path="ClinicalAssessment.assessor", description="The clinicial performing the assessment", type="reference" ) + public static final String SP_ASSESSOR = "assessor"; + @SearchParamDefinition(name="patient", path="ClinicalAssessment.patient", description="The patient being asssesed", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="resolved", path="ClinicalAssessment.resolved", description="Diagnosies/conditions resolved since previous assessment", type="token" ) + public static final String SP_RESOLVED = "resolved"; + @SearchParamDefinition(name="plan", path="ClinicalAssessment.plan", description="Plan of action after assessment", type="reference" ) + public static final String SP_PLAN = "plan"; + @SearchParamDefinition(name="action", path="ClinicalAssessment.action", description="Actions taken during assessment", type="reference" ) + public static final String SP_ACTION = "action"; + @SearchParamDefinition(name="investigation", path="ClinicalAssessment.investigations.item", description="Record of a specific investigation", type="reference" ) + public static final String SP_INVESTIGATION = "investigation"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java index f2afd3ce6e7..bf8f1d074fa 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.instance.model; /* @@ -48,54 +48,54 @@ package org.hl7.fhir.instance.model; * #L% */ - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -import static org.apache.commons.lang3.StringUtils.defaultString; - -/** - * Primitive type "code" in FHIR, when not bound to an enumerated list of codes - */ -@DatatypeDef(name = "code") -public class CodeType extends PrimitiveType implements Comparable { - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public CodeType() { - super(); - } - - /** - * Constructor which accepts a string code - */ - public CodeType(String theCode) { - setValue(theCode); - } - - @Override - public int compareTo(CodeType theCode) { - if (theCode == null) { - return 1; - } - return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); - } - - @Override - protected String parse(String theValue) { - return theValue.trim(); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public CodeType copy() { - return new CodeType(getValue()); - } - -} + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +import static org.apache.commons.lang3.StringUtils.defaultString; + +/** + * Primitive type "code" in FHIR, when not bound to an enumerated list of codes + */ +@DatatypeDef(name = "code") +public class CodeType extends PrimitiveType implements Comparable { + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public CodeType() { + super(); + } + + /** + * Constructor which accepts a string code + */ + public CodeType(String theCode) { + setValue(theCode); + } + + @Override + public int compareTo(CodeType theCode) { + if (theCode == null) { + return 1; + } + return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); + } + + @Override + protected String parse(String theValue) { + return theValue.trim(); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public CodeType copy() { + return new CodeType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java index d30ae29e8ca..69a4e5c44a7 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java @@ -20,176 +20,176 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ -@DatatypeDef(name="CodeableConcept") -public class CodeableConcept extends Type implements ICompositeType{ - - /** - * A reference to a code defined by a terminology system. - */ - @Child(name="coding", type={Coding.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." ) - protected List coding; - - /** - * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - @Child(name="text", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." ) - protected StringType text; - - private static final long serialVersionUID = 760353246L; - - public CodeableConcept() { - super(); - } - - /** - * @return {@link #coding} (A reference to a code defined by a terminology system.) - */ - public List getCoding() { - if (this.coding == null) - this.coding = new ArrayList(); - return this.coding; - } - - public boolean hasCoding() { - if (this.coding == null) - return false; - for (Coding item : this.coding) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coding} (A reference to a code defined by a terminology system.) - */ - // syntactic sugar - public Coding addCoding() { //3 - Coding t = new Coding(); - if (this.coding == null) - this.coding = new ArrayList(); - this.coding.add(t); - return t; - } - - /** - * @return {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeableConcept.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public CodeableConcept setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - public CodeableConcept setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("coding", "Coding", "A reference to a code defined by a terminology system.", 0, java.lang.Integer.MAX_VALUE, coding)); - childrenList.add(new Property("text", "string", "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public CodeableConcept copy() { - CodeableConcept dst = new CodeableConcept(); - copyValues(dst); - if (coding != null) { - dst.coding = new ArrayList(); - for (Coding i : coding) - dst.coding.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - return dst; - } - - protected CodeableConcept typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ +@DatatypeDef(name="CodeableConcept") +public class CodeableConcept extends Type implements ICompositeType{ + + /** + * A reference to a code defined by a terminology system. + */ + @Child(name="coding", type={Coding.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." ) + protected List coding; + + /** + * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + @Child(name="text", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." ) + protected StringType text; + + private static final long serialVersionUID = 760353246L; + + public CodeableConcept() { + super(); + } + + /** + * @return {@link #coding} (A reference to a code defined by a terminology system.) + */ + public List getCoding() { + if (this.coding == null) + this.coding = new ArrayList(); + return this.coding; + } + + public boolean hasCoding() { + if (this.coding == null) + return false; + for (Coding item : this.coding) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coding} (A reference to a code defined by a terminology system.) + */ + // syntactic sugar + public Coding addCoding() { //3 + Coding t = new Coding(); + if (this.coding == null) + this.coding = new ArrayList(); + this.coding.add(t); + return t; + } + + /** + * @return {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CodeableConcept.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public CodeableConcept setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + */ + public CodeableConcept setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("coding", "Coding", "A reference to a code defined by a terminology system.", 0, java.lang.Integer.MAX_VALUE, coding)); + childrenList.add(new Property("text", "string", "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public CodeableConcept copy() { + CodeableConcept dst = new CodeableConcept(); + copyValues(dst); + if (coding != null) { + dst.coding = new ArrayList(); + for (Coding i : coding) + dst.coding.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + return dst; + } + + protected CodeableConcept typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java index 42459dd505d..e6a479a5390 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java @@ -20,424 +20,424 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A reference to a code defined by a terminology system. - */ -@DatatypeDef(name="Coding") -public class Coding extends Type implements ICompositeType{ - - /** - * The identification of the code system that defines the meaning of the symbol in the code. - */ - @Child(name="system", type={UriType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." ) - protected UriType system; - - /** - * The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." ) - protected StringType version; - - /** - * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). - */ - @Child(name="code", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." ) - protected CodeType code; - - /** - * A representation of the meaning of the code in the system, following the rules of the system. - */ - @Child(name="display", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Representation defined by the system", formalDefinition="A representation of the meaning of the code in the system, following the rules of the system." ) - protected StringType display; - - /** - * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). - */ - @Child(name="primary", type={BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="If this code was chosen directly by the user", formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." ) - protected BooleanType primary; - - /** - * The set of possible coded values this coding was chosen from or constrained by. - */ - @Child(name="valueSet", type={ValueSet.class}, order=4, min=0, max=1) - @Description(shortDefinition="Set this coding was chosen from", formalDefinition="The set of possible coded values this coding was chosen from or constrained by." ) - protected Reference valueSet; - - /** - * The actual object that is the target of the reference (The set of possible coded values this coding was chosen from or constrained by.) - */ - protected ValueSet valueSetTarget; - - private static final long serialVersionUID = -1529268796L; - - public Coding() { - super(); - } - - /** - * @return {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Coding setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The identification of the code system that defines the meaning of the symbol in the code. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The identification of the code system that defines the meaning of the symbol in the code. - */ - public Coding setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Coding setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. - */ - public Coding setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Coding setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). - */ - public Coding setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public Coding setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return A representation of the meaning of the code in the system, following the rules of the system. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value A representation of the meaning of the code in the system, following the rules of the system. - */ - public Coding setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #primary} (Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getPrimary" gives direct access to the value - */ - public BooleanType getPrimaryElement() { - if (this.primary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.primary"); - else if (Configuration.doAutoCreate()) - this.primary = new BooleanType(); - return this.primary; - } - - public boolean hasPrimaryElement() { - return this.primary != null && !this.primary.isEmpty(); - } - - public boolean hasPrimary() { - return this.primary != null && !this.primary.isEmpty(); - } - - /** - * @param value {@link #primary} (Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getPrimary" gives direct access to the value - */ - public Coding setPrimaryElement(BooleanType value) { - this.primary = value; - return this; - } - - /** - * @return Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). - */ - public boolean getPrimary() { - return this.primary == null ? false : this.primary.getValue(); - } - - /** - * @param value Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). - */ - public Coding setPrimary(boolean value) { - if (value == false) - this.primary = null; - else { - if (this.primary == null) - this.primary = new BooleanType(); - this.primary.setValue(value); - } - return this; - } - - /** - * @return {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.) - */ - public Reference getValueSet() { - if (this.valueSet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.valueSet"); - else if (Configuration.doAutoCreate()) - this.valueSet = new Reference(); - return this.valueSet; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.) - */ - public Coding setValueSet(Reference value) { - this.valueSet = value; - return this; - } - - /** - * @return {@link #valueSet} 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 set of possible coded values this coding was chosen from or constrained by.) - */ - public ValueSet getValueSetTarget() { - if (this.valueSetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.valueSet"); - else if (Configuration.doAutoCreate()) - this.valueSetTarget = new ValueSet(); - return this.valueSetTarget; - } - - /** - * @param value {@link #valueSet} 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 set of possible coded values this coding was chosen from or constrained by.) - */ - public Coding setValueSetTarget(ValueSet value) { - this.valueSetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "The identification of the code system that defines the meaning of the symbol in the code.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "A representation of the meaning of the code in the system, following the rules of the system.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("primary", "boolean", "Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).", 0, java.lang.Integer.MAX_VALUE, primary)); - childrenList.add(new Property("valueSet", "Reference(ValueSet)", "The set of possible coded values this coding was chosen from or constrained by.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - } - - public Coding copy() { - Coding dst = new Coding(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - dst.primary = primary == null ? null : primary.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - return dst; - } - - protected Coding typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) && (primary == null || primary.isEmpty()) - && (valueSet == null || valueSet.isEmpty()); - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A reference to a code defined by a terminology system. + */ +@DatatypeDef(name="Coding") +public class Coding extends Type implements ICompositeType{ + + /** + * The identification of the code system that defines the meaning of the symbol in the code. + */ + @Child(name="system", type={UriType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." ) + protected UriType system; + + /** + * The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Version of the system - if relevant", formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." ) + protected StringType version; + + /** + * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + @Child(name="code", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Symbol in syntax defined by the system", formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." ) + protected CodeType code; + + /** + * A representation of the meaning of the code in the system, following the rules of the system. + */ + @Child(name="display", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Representation defined by the system", formalDefinition="A representation of the meaning of the code in the system, following the rules of the system." ) + protected StringType display; + + /** + * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + */ + @Child(name="primary", type={BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="If this code was chosen directly by the user", formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." ) + protected BooleanType primary; + + /** + * The set of possible coded values this coding was chosen from or constrained by. + */ + @Child(name="valueSet", type={ValueSet.class}, order=4, min=0, max=1) + @Description(shortDefinition="Set this coding was chosen from", formalDefinition="The set of possible coded values this coding was chosen from or constrained by." ) + protected Reference valueSet; + + /** + * The actual object that is the target of the reference (The set of possible coded values this coding was chosen from or constrained by.) + */ + protected ValueSet valueSetTarget; + + private static final long serialVersionUID = -1529268796L; + + public Coding() { + super(); + } + + /** + * @return {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Coding setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The identification of the code system that defines the meaning of the symbol in the code. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The identification of the code system that defines the meaning of the symbol in the code. + */ + public Coding setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Coding setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + */ + public Coding setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Coding setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + */ + public Coding setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public Coding setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return A representation of the meaning of the code in the system, following the rules of the system. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value A representation of the meaning of the code in the system, following the rules of the system. + */ + public Coding setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #primary} (Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getPrimary" gives direct access to the value + */ + public BooleanType getPrimaryElement() { + if (this.primary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.primary"); + else if (Configuration.doAutoCreate()) + this.primary = new BooleanType(); + return this.primary; + } + + public boolean hasPrimaryElement() { + return this.primary != null && !this.primary.isEmpty(); + } + + public boolean hasPrimary() { + return this.primary != null && !this.primary.isEmpty(); + } + + /** + * @param value {@link #primary} (Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getPrimary" gives direct access to the value + */ + public Coding setPrimaryElement(BooleanType value) { + this.primary = value; + return this; + } + + /** + * @return Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + */ + public boolean getPrimary() { + return this.primary == null ? false : this.primary.getValue(); + } + + /** + * @param value Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + */ + public Coding setPrimary(boolean value) { + if (value == false) + this.primary = null; + else { + if (this.primary == null) + this.primary = new BooleanType(); + this.primary.setValue(value); + } + return this; + } + + /** + * @return {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.) + */ + public Reference getValueSet() { + if (this.valueSet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.valueSet"); + else if (Configuration.doAutoCreate()) + this.valueSet = new Reference(); + return this.valueSet; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (The set of possible coded values this coding was chosen from or constrained by.) + */ + public Coding setValueSet(Reference value) { + this.valueSet = value; + return this; + } + + /** + * @return {@link #valueSet} 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 set of possible coded values this coding was chosen from or constrained by.) + */ + public ValueSet getValueSetTarget() { + if (this.valueSetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coding.valueSet"); + else if (Configuration.doAutoCreate()) + this.valueSetTarget = new ValueSet(); + return this.valueSetTarget; + } + + /** + * @param value {@link #valueSet} 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 set of possible coded values this coding was chosen from or constrained by.) + */ + public Coding setValueSetTarget(ValueSet value) { + this.valueSetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "The identification of the code system that defines the meaning of the symbol in the code.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "A representation of the meaning of the code in the system, following the rules of the system.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("primary", "boolean", "Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays).", 0, java.lang.Integer.MAX_VALUE, primary)); + childrenList.add(new Property("valueSet", "Reference(ValueSet)", "The set of possible coded values this coding was chosen from or constrained by.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + } + + public Coding copy() { + Coding dst = new Coding(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + dst.primary = primary == null ? null : primary.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + return dst; + } + + protected Coding typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) && (primary == null || primary.isEmpty()) + && (valueSet == null || valueSet.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java index 74b4c7481e5..95b87b2d916 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java @@ -20,919 +20,919 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 { - 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 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; - - /** - * 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 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 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 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 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 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 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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(); - 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 getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - 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(); - 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 getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.) - */ - public List getMessagePart() { - if (this.messagePart == null) - this.messagePart = new ArrayList(); - 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(); - this.messagePart.add(t); - return t; - } - - /** - * @return {@link #medium} (The communication medium, e.g., email, fax.) - */ - public List getMedium() { - if (this.medium == null) - this.medium = new ArrayList(); - 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(); - 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 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(); - 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 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.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 getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - 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(); - 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 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(); - 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(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - if (messagePart != null) { - dst.messagePart = new ArrayList(); - for (CommunicationMessagePartComponent i : messagePart) - dst.messagePart.add(i.copy()); - }; - if (medium != null) { - dst.medium = new ArrayList(); - 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(); - 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"; - -} - + +/* + 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 { + 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 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; + + /** + * 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 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 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 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 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 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 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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(); + 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 getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + 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(); + 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 getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + public List getMessagePart() { + if (this.messagePart == null) + this.messagePart = new ArrayList(); + 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(); + this.messagePart.add(t); + return t; + } + + /** + * @return {@link #medium} (The communication medium, e.g., email, fax.) + */ + public List getMedium() { + if (this.medium == null) + this.medium = new ArrayList(); + 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(); + 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 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(); + 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 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.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 getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + 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(); + 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 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(); + 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(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + if (messagePart != null) { + dst.messagePart = new ArrayList(); + for (CommunicationMessagePartComponent i : messagePart) + dst.messagePart.add(i.copy()); + }; + if (medium != null) { + dst.medium = new ArrayList(); + 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(); + 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"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java index 1a43c927e81..f09f4c8eddd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java @@ -20,1216 +20,1216 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. - */ -@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") -public class CommunicationRequest extends DomainResource { - - public enum CommunicationRequestStatus implements FhirEnum { - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the order, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work is complete, and the outcomes are being reviewed for approval. - */ - REVIEW, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("review".equals(codeString)) - return REVIEW; - 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 CommunicationRequestStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case REVIEW: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - } - - public static class CommunicationRequestStatusEnumFactory implements EnumFactory { - public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return CommunicationRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return CommunicationRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return CommunicationRequestStatus.ACCEPTED; - if ("in progress".equals(codeString)) - return CommunicationRequestStatus.INPROGRESS; - if ("review".equals(codeString)) - return CommunicationRequestStatus.REVIEW; - if ("completed".equals(codeString)) - return CommunicationRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return CommunicationRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return CommunicationRequestStatus.REJECTED; - if ("failed".equals(codeString)) - return CommunicationRequestStatus.FAILED; - throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); - } - public String toCode(CommunicationRequestStatus code) throws IllegalArgumentException { - if (code == CommunicationRequestStatus.REQUESTED) - return "requested"; - if (code == CommunicationRequestStatus.RECEIVED) - return "received"; - if (code == CommunicationRequestStatus.ACCEPTED) - return "accepted"; - if (code == CommunicationRequestStatus.INPROGRESS) - return "in progress"; - if (code == CommunicationRequestStatus.REVIEW) - return "review"; - if (code == CommunicationRequestStatus.COMPLETED) - return "completed"; - if (code == CommunicationRequestStatus.SUSPENDED) - return "suspended"; - if (code == CommunicationRequestStatus.REJECTED) - return "rejected"; - if (code == CommunicationRequestStatus.FAILED) - return "failed"; - return "?"; - } - } - - public enum CommunicationRequestMode implements FhirEnum { - /** - * planned. - */ - PLANNED, - /** - * proposed. - */ - PROPOSED, - /** - * ordered. - */ - ORDERED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PLANNED; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("ordered".equals(codeString)) - return ORDERED; - throw new IllegalArgumentException("Unknown CommunicationRequestMode 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 CommunicationRequestModeEnumFactory implements EnumFactory { - public CommunicationRequestMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return CommunicationRequestMode.PLANNED; - if ("proposed".equals(codeString)) - return CommunicationRequestMode.PROPOSED; - if ("ordered".equals(codeString)) - return CommunicationRequestMode.ORDERED; - throw new IllegalArgumentException("Unknown CommunicationRequestMode code '"+codeString+"'"); - } - public String toCode(CommunicationRequestMode code) throws IllegalArgumentException { - if (code == CommunicationRequestMode.PLANNED) - return "planned"; - if (code == CommunicationRequestMode.PROPOSED) - return "proposed"; - if (code == CommunicationRequestMode.ORDERED) - return "ordered"; - return "?"; - } - } - - @Block() - public static class CommunicationRequestMessagePartComponent 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 CommunicationRequestMessagePartComponent() { - super(); - } - - public CommunicationRequestMessagePartComponent(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 CommunicationRequestMessagePartComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List 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 CommunicationRequestMessagePartComponent copy() { - CommunicationRequestMessagePartComponent dst = new CommunicationRequestMessagePartComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - } - - /** - * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system." ) - protected List 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 intended 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 intended target of the communication." ) - protected List 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 intended target of the communication.) - */ - protected List 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 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 medium; - - /** - * The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application. - */ - @Child(name="requester", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=1) - @Description(shortDefinition="Requester of communication", formalDefinition="The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - protected Resource requesterTarget; - - /** - * The status of the proposal or order. - */ - @Child(name="status", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the proposal or order." ) - protected Enumeration status; - - /** - * Whether the communication is proposed, ordered, or planned. - */ - @Child(name="mode", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="planned | proposed | ordered", formalDefinition="Whether the communication is proposed, ordered, or planned." ) - protected Enumeration mode; - - /** - * The encounter within which the communication request was created. - */ - @Child(name="encounter", type={Encounter.class}, order=8, min=0, max=1) - @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication request was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the communication request was created.) - */ - protected Encounter encounterTarget; - - /** - * The time when this communication is to occur. - */ - @Child(name="scheduledTime", type={DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="When scheduled", formalDefinition="The time when this communication is to occur." ) - protected DateTimeType scheduledTime; - - /** - * The reason or justification for the communication request. - */ - @Child(name="indication", type={CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication request." ) - protected List indication; - - /** - * The time when the request was made. - */ - @Child(name="orderedOn", type={DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="When ordered or proposed", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The patient who is the focus of this communication request. - */ - @Child(name="subject", type={Patient.class}, order=12, min=1, max=1) - @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication request." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who is the focus of this communication request.) - */ - protected Patient subjectTarget; - - /** - * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. - */ - @Child(name="priority", type={CodeableConcept.class}, order=13, min=0, max=1) - @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine." ) - protected CodeableConcept priority; - - private static final long serialVersionUID = -515307355L; - - public CommunicationRequest() { - super(); - } - - public CommunicationRequest(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 CommunicationRequest.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 CommunicationRequest 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 CommunicationRequest.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 CommunicationRequest 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 CommunicationRequest 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 intended target of the communication.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - 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 intended target of the communication.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - 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 intended target of the communication.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.) - */ - public List getMessagePart() { - if (this.messagePart == null) - this.messagePart = new ArrayList(); - return this.messagePart; - } - - public boolean hasMessagePart() { - if (this.messagePart == null) - return false; - for (CommunicationRequestMessagePartComponent 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 CommunicationRequestMessagePartComponent addMessagePart() { //3 - CommunicationRequestMessagePartComponent t = new CommunicationRequestMessagePartComponent(); - if (this.messagePart == null) - this.messagePart = new ArrayList(); - this.messagePart.add(t); - return t; - } - - /** - * @return {@link #medium} (The communication medium, e.g., email, fax.) - */ - public List getMedium() { - if (this.medium == null) - this.medium = new ArrayList(); - 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(); - this.medium.add(t); - return t; - } - - /** - * @return {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public CommunicationRequest setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} 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 responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} 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 responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) - */ - public CommunicationRequest setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CommunicationRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the proposal or order. - */ - public CommunicationRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the proposal or order. - */ - public CommunicationRequest setStatus(CommunicationRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(CommunicationRequestStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (Whether the communication is proposed, ordered, or planned.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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} (Whether the communication is proposed, ordered, or planned.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public CommunicationRequest setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Whether the communication is proposed, ordered, or planned. - */ - public CommunicationRequestMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Whether the communication is proposed, ordered, or planned. - */ - public CommunicationRequest setMode(CommunicationRequestMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(CommunicationRequestMode.ENUM_FACTORY); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the communication request was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.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 request was created.) - */ - public CommunicationRequest 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 request was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.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 request was created.) - */ - public CommunicationRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value - */ - public DateTimeType getScheduledTimeElement() { - if (this.scheduledTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.scheduledTime"); - else if (Configuration.doAutoCreate()) - this.scheduledTime = new DateTimeType(); - return this.scheduledTime; - } - - public boolean hasScheduledTimeElement() { - return this.scheduledTime != null && !this.scheduledTime.isEmpty(); - } - - public boolean hasScheduledTime() { - return this.scheduledTime != null && !this.scheduledTime.isEmpty(); - } - - /** - * @param value {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value - */ - public CommunicationRequest setScheduledTimeElement(DateTimeType value) { - this.scheduledTime = value; - return this; - } - - /** - * @return The time when this communication is to occur. - */ - public Date getScheduledTime() { - return this.scheduledTime == null ? null : this.scheduledTime.getValue(); - } - - /** - * @param value The time when this communication is to occur. - */ - public CommunicationRequest setScheduledTime(Date value) { - if (value == null) - this.scheduledTime = null; - else { - if (this.scheduledTime == null) - this.scheduledTime = new DateTimeType(); - this.scheduledTime.setValue(value); - } - return this; - } - - /** - * @return {@link #indication} (The reason or justification for the communication request.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - 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 request.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public CommunicationRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public CommunicationRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who is the focus of this communication request.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.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 request.) - */ - public CommunicationRequest 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 request.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.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 request.) - */ - public CommunicationRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) - */ - public CommunicationRequest setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.", 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 intended 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("requester", "Reference(Practitioner|Patient|RelatedPerson)", "The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("status", "code", "The status of the proposal or order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("mode", "code", "Whether the communication is proposed, ordered, or planned.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("scheduledTime", "dateTime", "The time when this communication is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduledTime)); - childrenList.add(new Property("indication", "CodeableConcept", "The reason or justification for the communication request.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication request.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("priority", "CodeableConcept", "Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - public CommunicationRequest copy() { - CommunicationRequest dst = new CommunicationRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - 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(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - if (messagePart != null) { - dst.messagePart = new ArrayList(); - for (CommunicationRequestMessagePartComponent i : messagePart) - dst.messagePart.add(i.copy()); - }; - if (medium != null) { - dst.medium = new ArrayList(); - for (CodeableConcept i : medium) - dst.medium.add(i.copy()); - }; - dst.requester = requester == null ? null : requester.copy(); - dst.status = status == null ? null : status.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.scheduledTime = scheduledTime == null ? null : scheduledTime.copy(); - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected CommunicationRequest 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()) && (requester == null || requester.isEmpty()) && (status == null || status.isEmpty()) - && (mode == null || mode.isEmpty()) && (encounter == null || encounter.isEmpty()) && (scheduledTime == null || scheduledTime.isEmpty()) - && (indication == null || indication.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) - && (subject == null || subject.isEmpty()) && (priority == null || priority.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CommunicationRequest; - } - - @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="Requester of communication", type="reference" ) - public static final String SP_REQUESTER = "requester"; - @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="Encounter leading to message", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="Message recipient", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="Communication medium", type="token" ) - public static final String SP_MEDIUM = "medium"; - @SearchParamDefinition(name="mode", path="CommunicationRequest.mode", description="planned | proposed | ordered", type="token" ) - public static final String SP_MODE = "mode"; - @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="Message sender", type="reference" ) - public static final String SP_SENDER = "sender"; - @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="Message category", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="time", path="CommunicationRequest.scheduledTime", description="When scheduled", type="date" ) - 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="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"; - -} - + +/* + 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; +/** + * A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + */ +@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") +public class CommunicationRequest extends DomainResource { + + public enum CommunicationRequestStatus implements FhirEnum { + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the order, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work is complete, and the outcomes are being reviewed for approval. + */ + REVIEW, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("review".equals(codeString)) + return REVIEW; + 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 CommunicationRequestStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case REVIEW: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + } + + public static class CommunicationRequestStatusEnumFactory implements EnumFactory { + public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return CommunicationRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return CommunicationRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return CommunicationRequestStatus.ACCEPTED; + if ("in progress".equals(codeString)) + return CommunicationRequestStatus.INPROGRESS; + if ("review".equals(codeString)) + return CommunicationRequestStatus.REVIEW; + if ("completed".equals(codeString)) + return CommunicationRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return CommunicationRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return CommunicationRequestStatus.REJECTED; + if ("failed".equals(codeString)) + return CommunicationRequestStatus.FAILED; + throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); + } + public String toCode(CommunicationRequestStatus code) throws IllegalArgumentException { + if (code == CommunicationRequestStatus.REQUESTED) + return "requested"; + if (code == CommunicationRequestStatus.RECEIVED) + return "received"; + if (code == CommunicationRequestStatus.ACCEPTED) + return "accepted"; + if (code == CommunicationRequestStatus.INPROGRESS) + return "in progress"; + if (code == CommunicationRequestStatus.REVIEW) + return "review"; + if (code == CommunicationRequestStatus.COMPLETED) + return "completed"; + if (code == CommunicationRequestStatus.SUSPENDED) + return "suspended"; + if (code == CommunicationRequestStatus.REJECTED) + return "rejected"; + if (code == CommunicationRequestStatus.FAILED) + return "failed"; + return "?"; + } + } + + public enum CommunicationRequestMode implements FhirEnum { + /** + * planned. + */ + PLANNED, + /** + * proposed. + */ + PROPOSED, + /** + * ordered. + */ + ORDERED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PLANNED; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("ordered".equals(codeString)) + return ORDERED; + throw new IllegalArgumentException("Unknown CommunicationRequestMode 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 CommunicationRequestModeEnumFactory implements EnumFactory { + public CommunicationRequestMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return CommunicationRequestMode.PLANNED; + if ("proposed".equals(codeString)) + return CommunicationRequestMode.PROPOSED; + if ("ordered".equals(codeString)) + return CommunicationRequestMode.ORDERED; + throw new IllegalArgumentException("Unknown CommunicationRequestMode code '"+codeString+"'"); + } + public String toCode(CommunicationRequestMode code) throws IllegalArgumentException { + if (code == CommunicationRequestMode.PLANNED) + return "planned"; + if (code == CommunicationRequestMode.PROPOSED) + return "proposed"; + if (code == CommunicationRequestMode.ORDERED) + return "ordered"; + return "?"; + } + } + + @Block() + public static class CommunicationRequestMessagePartComponent 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 CommunicationRequestMessagePartComponent() { + super(); + } + + public CommunicationRequestMessagePartComponent(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 CommunicationRequestMessagePartComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List 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 CommunicationRequestMessagePartComponent copy() { + CommunicationRequestMessagePartComponent dst = new CommunicationRequestMessagePartComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + /** + * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique identifier", formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system." ) + protected List 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 intended 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 intended target of the communication." ) + protected List 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 intended target of the communication.) + */ + protected List 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 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 medium; + + /** + * The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application. + */ + @Child(name="requester", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=1) + @Description(shortDefinition="Requester of communication", formalDefinition="The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + protected Resource requesterTarget; + + /** + * The status of the proposal or order. + */ + @Child(name="status", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the proposal or order." ) + protected Enumeration status; + + /** + * Whether the communication is proposed, ordered, or planned. + */ + @Child(name="mode", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="planned | proposed | ordered", formalDefinition="Whether the communication is proposed, ordered, or planned." ) + protected Enumeration mode; + + /** + * The encounter within which the communication request was created. + */ + @Child(name="encounter", type={Encounter.class}, order=8, min=0, max=1) + @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication request was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the communication request was created.) + */ + protected Encounter encounterTarget; + + /** + * The time when this communication is to occur. + */ + @Child(name="scheduledTime", type={DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="When scheduled", formalDefinition="The time when this communication is to occur." ) + protected DateTimeType scheduledTime; + + /** + * The reason or justification for the communication request. + */ + @Child(name="indication", type={CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication request." ) + protected List indication; + + /** + * The time when the request was made. + */ + @Child(name="orderedOn", type={DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="When ordered or proposed", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The patient who is the focus of this communication request. + */ + @Child(name="subject", type={Patient.class}, order=12, min=1, max=1) + @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication request." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who is the focus of this communication request.) + */ + protected Patient subjectTarget; + + /** + * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. + */ + @Child(name="priority", type={CodeableConcept.class}, order=13, min=0, max=1) + @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine." ) + protected CodeableConcept priority; + + private static final long serialVersionUID = -515307355L; + + public CommunicationRequest() { + super(); + } + + public CommunicationRequest(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 CommunicationRequest.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 CommunicationRequest 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 CommunicationRequest.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 CommunicationRequest 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 CommunicationRequest 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 intended target of the communication.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + 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 intended target of the communication.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + 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 intended target of the communication.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + public List getMessagePart() { + if (this.messagePart == null) + this.messagePart = new ArrayList(); + return this.messagePart; + } + + public boolean hasMessagePart() { + if (this.messagePart == null) + return false; + for (CommunicationRequestMessagePartComponent 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 CommunicationRequestMessagePartComponent addMessagePart() { //3 + CommunicationRequestMessagePartComponent t = new CommunicationRequestMessagePartComponent(); + if (this.messagePart == null) + this.messagePart = new ArrayList(); + this.messagePart.add(t); + return t; + } + + /** + * @return {@link #medium} (The communication medium, e.g., email, fax.) + */ + public List getMedium() { + if (this.medium == null) + this.medium = new ArrayList(); + 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(); + this.medium.add(t); + return t; + } + + /** + * @return {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public CommunicationRequest setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} 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 responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public Resource getRequesterTarget() { + return this.requesterTarget; + } + + /** + * @param value {@link #requester} 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 responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.) + */ + public CommunicationRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CommunicationRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the proposal or order. + */ + public CommunicationRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the proposal or order. + */ + public CommunicationRequest setStatus(CommunicationRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(CommunicationRequestStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (Whether the communication is proposed, ordered, or planned.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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} (Whether the communication is proposed, ordered, or planned.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public CommunicationRequest setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Whether the communication is proposed, ordered, or planned. + */ + public CommunicationRequestMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Whether the communication is proposed, ordered, or planned. + */ + public CommunicationRequest setMode(CommunicationRequestMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(CommunicationRequestMode.ENUM_FACTORY); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the communication request was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.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 request was created.) + */ + public CommunicationRequest 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 request was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.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 request was created.) + */ + public CommunicationRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value + */ + public DateTimeType getScheduledTimeElement() { + if (this.scheduledTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.scheduledTime"); + else if (Configuration.doAutoCreate()) + this.scheduledTime = new DateTimeType(); + return this.scheduledTime; + } + + public boolean hasScheduledTimeElement() { + return this.scheduledTime != null && !this.scheduledTime.isEmpty(); + } + + public boolean hasScheduledTime() { + return this.scheduledTime != null && !this.scheduledTime.isEmpty(); + } + + /** + * @param value {@link #scheduledTime} (The time when this communication is to occur.). This is the underlying object with id, value and extensions. The accessor "getScheduledTime" gives direct access to the value + */ + public CommunicationRequest setScheduledTimeElement(DateTimeType value) { + this.scheduledTime = value; + return this; + } + + /** + * @return The time when this communication is to occur. + */ + public Date getScheduledTime() { + return this.scheduledTime == null ? null : this.scheduledTime.getValue(); + } + + /** + * @param value The time when this communication is to occur. + */ + public CommunicationRequest setScheduledTime(Date value) { + if (value == null) + this.scheduledTime = null; + else { + if (this.scheduledTime == null) + this.scheduledTime = new DateTimeType(); + this.scheduledTime.setValue(value); + } + return this; + } + + /** + * @return {@link #indication} (The reason or justification for the communication request.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + 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 request.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public CommunicationRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public CommunicationRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who is the focus of this communication request.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.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 request.) + */ + public CommunicationRequest 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 request.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.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 request.) + */ + public CommunicationRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CommunicationRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) + */ + public CommunicationRequest setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system.", 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 intended 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("requester", "Reference(Practitioner|Patient|RelatedPerson)", "The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application.", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("status", "code", "The status of the proposal or order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("mode", "code", "Whether the communication is proposed, ordered, or planned.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("scheduledTime", "dateTime", "The time when this communication is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduledTime)); + childrenList.add(new Property("indication", "CodeableConcept", "The reason or justification for the communication request.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication request.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("priority", "CodeableConcept", "Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + public CommunicationRequest copy() { + CommunicationRequest dst = new CommunicationRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + 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(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + if (messagePart != null) { + dst.messagePart = new ArrayList(); + for (CommunicationRequestMessagePartComponent i : messagePart) + dst.messagePart.add(i.copy()); + }; + if (medium != null) { + dst.medium = new ArrayList(); + for (CodeableConcept i : medium) + dst.medium.add(i.copy()); + }; + dst.requester = requester == null ? null : requester.copy(); + dst.status = status == null ? null : status.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.scheduledTime = scheduledTime == null ? null : scheduledTime.copy(); + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected CommunicationRequest 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()) && (requester == null || requester.isEmpty()) && (status == null || status.isEmpty()) + && (mode == null || mode.isEmpty()) && (encounter == null || encounter.isEmpty()) && (scheduledTime == null || scheduledTime.isEmpty()) + && (indication == null || indication.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) + && (subject == null || subject.isEmpty()) && (priority == null || priority.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CommunicationRequest; + } + + @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="Requester of communication", type="reference" ) + public static final String SP_REQUESTER = "requester"; + @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="Encounter leading to message", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="Message recipient", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="Communication medium", type="token" ) + public static final String SP_MEDIUM = "medium"; + @SearchParamDefinition(name="mode", path="CommunicationRequest.mode", description="planned | proposed | ordered", type="token" ) + public static final String SP_MODE = "mode"; + @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="Message sender", type="reference" ) + public static final String SP_SENDER = "sender"; + @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="Message category", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="time", path="CommunicationRequest.scheduledTime", description="When scheduled", type="date" ) + 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="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"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Comparison.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Comparison.java index 858648f7550..cf2073b815d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Comparison.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Comparison.java @@ -20,110 +20,110 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.util.List; - -import org.hl7.fhir.utilities.Utilities; - -/** - * See http://www.healthintersections.com.au/?p=1941 - * - * @author Grahame - * - */ -public class Comparison { - - public class MatchProfile { - - } - - public static boolean matches(String c1, String c2, MatchProfile profile) { - if (Utilities.noString(c1) || Utilities.noString(c2)) - return false; - c1 = Utilities.normalize(c1); - c2 = Utilities.normalize(c2); - return c1.equals(c2); - } - - public static > boolean matches(Enumeration e1, Enumeration e2, MatchProfile profile) { - if (e1 == null || e2 == null) - return false; - return e1.getValue().equals(e2.getValue()); - } - - public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws Exception { - if (profile != null) - throw new Exception("Not Implemented Yet"); - - if (c1.getCoding().isEmpty() && c2.getCoding().isEmpty()) { - return matches(c1.getText(), c2.getText(), null); - } else { - // in the absence of specific guidance, we just require that all codes match - boolean ok = true; - for (Coding c : c1.getCoding()) { - ok = ok && inList(c2.getCoding(), c, null); - } - for (Coding c : c2.getCoding()) { - ok = ok && inList(c1.getCoding(), c, null); - } - return ok; - } - } - - public static void merge(CodeableConcept dst, CodeableConcept src) { - if (dst.getTextElement() == null && src.getTextElement() != null) - dst.setTextElement(src.getTextElement()); - } - - - public static boolean inList(List list, Coding c, MatchProfile profile) throws Exception { - for (Coding item : list) { - if (matches(item, c, profile)) - return true; - } - return false; - } - - public static boolean matches(Coding c1, Coding c2, MatchProfile profile) throws Exception { - if (profile != null) - throw new Exception("Not Implemented Yet"); - - // in the absence of a profile, we ignore version - return matches(c1.getSystem(), c2.getSystem(), null) && matches(c1.getCode(), c2.getCode(), null); - } - - public static boolean matches(Identifier i1, Identifier i2, MatchProfile profile) throws Exception { - if (profile != null) - throw new Exception("Not Implemented Yet"); - - // in the absence of a profile, we ignore version - return matches(i1.getSystem(), i2.getSystem(), null) && matches(i1.getValue(), i2.getValue(), null); - } - - public static void merge(Identifier dst, Identifier src) { - if (dst.getUseElement() == null && src.getUseElement() != null) - dst.setUseElement(src.getUseElement()); - if (dst.getLabelElement() == null && src.getLabelElement() != null) - dst.setLabelElement(src.getLabelElement()); - if (dst.getPeriod() == null && src.getPeriod() != null) - dst.setPeriod(src.getPeriod()); - if (dst.getAssigner() == null && src.getAssigner() != null) - dst.setAssigner(src.getAssigner()); - } - - public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) throws Exception { - if (profile != null) - throw new Exception("Not Implemented Yet"); - - // in the absence of a profile, we insist on system - return matches(c1.getSystemElement(), c2.getSystemElement(), null) && matches(c1.getValue(), c2.getValue(), null); - } - - public static void merge(ContactPoint dst, ContactPoint src) { - if (dst.getUseElement() == null && src.getUseElement() != null) - dst.setUseElement(src.getUseElement()); - if (dst.getPeriod() == null && src.getPeriod() != null) - dst.setPeriod(src.getPeriod()); - } - -} + +import java.util.List; + +import org.hl7.fhir.utilities.Utilities; + +/** + * See http://www.healthintersections.com.au/?p=1941 + * + * @author Grahame + * + */ +public class Comparison { + + public class MatchProfile { + + } + + public static boolean matches(String c1, String c2, MatchProfile profile) { + if (Utilities.noString(c1) || Utilities.noString(c2)) + return false; + c1 = Utilities.normalize(c1); + c2 = Utilities.normalize(c2); + return c1.equals(c2); + } + + public static > boolean matches(Enumeration e1, Enumeration e2, MatchProfile profile) { + if (e1 == null || e2 == null) + return false; + return e1.getValue().equals(e2.getValue()); + } + + public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws Exception { + if (profile != null) + throw new Exception("Not Implemented Yet"); + + if (c1.getCoding().isEmpty() && c2.getCoding().isEmpty()) { + return matches(c1.getText(), c2.getText(), null); + } else { + // in the absence of specific guidance, we just require that all codes match + boolean ok = true; + for (Coding c : c1.getCoding()) { + ok = ok && inList(c2.getCoding(), c, null); + } + for (Coding c : c2.getCoding()) { + ok = ok && inList(c1.getCoding(), c, null); + } + return ok; + } + } + + public static void merge(CodeableConcept dst, CodeableConcept src) { + if (dst.getTextElement() == null && src.getTextElement() != null) + dst.setTextElement(src.getTextElement()); + } + + + public static boolean inList(List list, Coding c, MatchProfile profile) throws Exception { + for (Coding item : list) { + if (matches(item, c, profile)) + return true; + } + return false; + } + + public static boolean matches(Coding c1, Coding c2, MatchProfile profile) throws Exception { + if (profile != null) + throw new Exception("Not Implemented Yet"); + + // in the absence of a profile, we ignore version + return matches(c1.getSystem(), c2.getSystem(), null) && matches(c1.getCode(), c2.getCode(), null); + } + + public static boolean matches(Identifier i1, Identifier i2, MatchProfile profile) throws Exception { + if (profile != null) + throw new Exception("Not Implemented Yet"); + + // in the absence of a profile, we ignore version + return matches(i1.getSystem(), i2.getSystem(), null) && matches(i1.getValue(), i2.getValue(), null); + } + + public static void merge(Identifier dst, Identifier src) { + if (dst.getUseElement() == null && src.getUseElement() != null) + dst.setUseElement(src.getUseElement()); + if (dst.getLabelElement() == null && src.getLabelElement() != null) + dst.setLabelElement(src.getLabelElement()); + if (dst.getPeriod() == null && src.getPeriod() != null) + dst.setPeriod(src.getPeriod()); + if (dst.getAssigner() == null && src.getAssigner() != null) + dst.setAssigner(src.getAssigner()); + } + + public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) throws Exception { + if (profile != null) + throw new Exception("Not Implemented Yet"); + + // in the absence of a profile, we insist on system + return matches(c1.getSystemElement(), c2.getSystemElement(), null) && matches(c1.getValue(), c2.getValue(), null); + } + + public static void merge(ContactPoint dst, ContactPoint src) { + if (dst.getUseElement() == null && src.getUseElement() != null) + dst.setUseElement(src.getUseElement()); + if (dst.getPeriod() == null && src.getPeriod() != null) + dst.setPeriod(src.getPeriod()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java index b7f50af8fca..ba210ffb42d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java @@ -20,1573 +20,1573 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. - */ -@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") -public class Composition extends DomainResource { - - 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. - */ - PRELIMINARY, - /** - * The composition or document is complete and verified by an appropriate person, and no further work is planned. - */ - FINAL, - /** - * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content. - */ - APPENDED, - /** - * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. - */ - AMENDED, - /** - * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PRELIMINARY; - if ("final".equals(codeString)) - return FINAL; - if ("appended".equals(codeString)) - return APPENDED; - if ("amended".equals(codeString)) - return AMENDED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case APPENDED: return "appended"; - case AMENDED: return "amended"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRELIMINARY: return ""; - case FINAL: return ""; - case APPENDED: return ""; - case AMENDED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified."; - case FINAL: return "The composition or document is complete and verified by an appropriate person, and no further work is planned."; - case APPENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content."; - case AMENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person."; - case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case APPENDED: return "appended"; - case AMENDED: return "amended"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - } - - public static class CompositionStatusEnumFactory implements EnumFactory { - public CompositionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("preliminary".equals(codeString)) - return CompositionStatus.PRELIMINARY; - if ("final".equals(codeString)) - return CompositionStatus.FINAL; - if ("appended".equals(codeString)) - return CompositionStatus.APPENDED; - if ("amended".equals(codeString)) - return CompositionStatus.AMENDED; - if ("entered in error".equals(codeString)) - return CompositionStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); - } - public String toCode(CompositionStatus code) throws IllegalArgumentException { - if (code == CompositionStatus.PRELIMINARY) - return "preliminary"; - if (code == CompositionStatus.FINAL) - return "final"; - if (code == CompositionStatus.APPENDED) - return "appended"; - if (code == CompositionStatus.AMENDED) - return "amended"; - if (code == CompositionStatus.ENTEREDINERROR) - return "entered in error"; - return "?"; - } - } - - public enum CompositionAttestationMode implements FhirEnum { - /** - * The person authenticated the content in their personal capacity. - */ - PERSONAL, - /** - * The person authenticated the content in their professional capacity. - */ - PROFESSIONAL, - /** - * The person authenticated the content and accepted legal responsibility for its content. - */ - LEGAL, - /** - * The organization authenticated the content as consistent with their policies and procedures. - */ - OFFICIAL, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PERSONAL; - if ("professional".equals(codeString)) - return PROFESSIONAL; - if ("legal".equals(codeString)) - return LEGAL; - if ("official".equals(codeString)) - return OFFICIAL; - throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PERSONAL: return "personal"; - case PROFESSIONAL: return "professional"; - case LEGAL: return "legal"; - case OFFICIAL: return "official"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PERSONAL: return ""; - case PROFESSIONAL: return ""; - case LEGAL: return ""; - case OFFICIAL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PERSONAL: return "The person authenticated the content in their personal capacity."; - case PROFESSIONAL: return "The person authenticated the content in their professional capacity."; - case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content."; - case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PERSONAL: return "personal"; - case PROFESSIONAL: return "professional"; - case LEGAL: return "legal"; - case OFFICIAL: return "official"; - default: return "?"; - } - } - } - - public static class CompositionAttestationModeEnumFactory implements EnumFactory { - public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("personal".equals(codeString)) - return CompositionAttestationMode.PERSONAL; - if ("professional".equals(codeString)) - return CompositionAttestationMode.PROFESSIONAL; - if ("legal".equals(codeString)) - return CompositionAttestationMode.LEGAL; - if ("official".equals(codeString)) - return CompositionAttestationMode.OFFICIAL; - throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - public String toCode(CompositionAttestationMode code) throws IllegalArgumentException { - if (code == CompositionAttestationMode.PERSONAL) - return "personal"; - if (code == CompositionAttestationMode.PROFESSIONAL) - return "professional"; - if (code == CompositionAttestationMode.LEGAL) - return "legal"; - if (code == CompositionAttestationMode.OFFICIAL) - return "official"; - return "?"; - } - } - - @Block() - public static class CompositionAttesterComponent extends BackboneElement { - /** - * The type of attestation the authenticator offers. - */ - @Child(name="mode", type={CodeType.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." ) - protected List> mode; - - /** - * When composition was attested by the party. - */ - @Child(name="time", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When composition attested", formalDefinition="When composition was attested by the party." ) - protected DateTimeType time; - - /** - * Who attested the composition in the specified way. - */ - @Child(name="party", type={Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." ) - protected Reference party; - - /** - * The actual object that is the target of the reference (Who attested the composition in the specified way.) - */ - protected Resource partyTarget; - - private static final long serialVersionUID = -436604745L; - - public CompositionAttesterComponent() { - super(); - } - - /** - * @return {@link #mode} (The type of attestation the authenticator offers.) - */ - public List> getMode() { - if (this.mode == null) - this.mode = new ArrayList>(); - return this.mode; - } - - public boolean hasMode() { - if (this.mode == null) - return false; - for (Enumeration item : this.mode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mode} (The type of attestation the authenticator offers.) - */ - // syntactic sugar - public Enumeration addModeElement() {//2 - Enumeration t = new Enumeration(); - if (this.mode == null) - this.mode = new ArrayList>(); - this.mode.add(t); - return t; - } - - /** - * @param value {@link #mode} (The type of attestation the authenticator offers.) - */ - public CompositionAttesterComponent addMode(CompositionAttestationMode value) { //1 - Enumeration t = new Enumeration(); - t.setValue(value); - if (this.mode == null) - this.mode = new ArrayList>(); - this.mode.add(t); - return this; - } - - /** - * @param value {@link #mode} (The type of attestation the authenticator offers.) - */ - public boolean hasMode(CompositionAttestationMode value) { - if (this.mode == null) - return false; - for (Enumeration v : this.mode) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DateTimeType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionAttesterComponent.time"); - else if (Configuration.doAutoCreate()) - this.time = new DateTimeType(); - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public CompositionAttesterComponent setTimeElement(DateTimeType value) { - this.time = value; - return this; - } - - /** - * @return When composition was attested by the party. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value When composition was attested by the party. - */ - public CompositionAttesterComponent setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new DateTimeType(); - this.time.setValue(value); - } - return this; - } - - /** - * @return {@link #party} (Who attested the composition in the specified way.) - */ - public Reference getParty() { - if (this.party == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionAttesterComponent.party"); - else if (Configuration.doAutoCreate()) - this.party = new Reference(); - return this.party; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Who attested the composition in the specified way.) - */ - public CompositionAttesterComponent setParty(Reference value) { - this.party = value; - return this; - } - - /** - * @return {@link #party} 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. (Who attested the composition in the specified way.) - */ - public Resource getPartyTarget() { - return this.partyTarget; - } - - /** - * @param value {@link #party} 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. (Who attested the composition in the specified way.) - */ - public CompositionAttesterComponent setPartyTarget(Resource value) { - this.partyTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("time", "dateTime", "When composition was attested by the party.", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, java.lang.Integer.MAX_VALUE, party)); - } - - public CompositionAttesterComponent copy() { - CompositionAttesterComponent dst = new CompositionAttesterComponent(); - copyValues(dst); - if (mode != null) { - dst.mode = new ArrayList>(); - for (Enumeration i : mode) - dst.mode.add(i.copy()); - }; - dst.time = time == null ? null : time.copy(); - dst.party = party == null ? null : party.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (time == null || time.isEmpty()) - && (party == null || party.isEmpty()); - } - - } - - @Block() - public static class CompositionEventComponent extends BackboneElement { - /** - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Code(s) that apply to the event being documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) - protected List code; - - /** - * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. - */ - @Child(name="period", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="The period covered by the documentation", formalDefinition="The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time." ) - protected Period period; - - /** - * Full details for the event(s) the composition/documentation consents. - */ - @Child(name="detail", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Full details for the event(s) the composition consents", formalDefinition="Full details for the event(s) the composition/documentation consents." ) - protected List detail; - /** - * The actual objects that are the target of the reference (Full details for the event(s) the composition/documentation consents.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = -1581379774L; - - public CompositionEventComponent() { - super(); - } - - /** - * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (CodeableConcept item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - // syntactic sugar - public CodeableConcept addCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - /** - * @return {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionEventComponent.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} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) - */ - public CompositionEventComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - /** - * @return {@link #detail} (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. Full details for the event(s) the composition/documentation consents.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("period", "Period", "The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("detail", "Reference(Any)", "Full details for the event(s) the composition/documentation consents.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public CompositionEventComponent copy() { - CompositionEventComponent dst = new CompositionEventComponent(); - copyValues(dst); - if (code != null) { - dst.code = new ArrayList(); - for (CodeableConcept i : code) - dst.code.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (period == null || period.isEmpty()) - && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class SectionComponent extends BackboneElement { - /** - * The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - @Child(name="title", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents." ) - protected StringType title; - - /** - * A code identifying the kind of content contained within the section. This must be consistent with the section title. - */ - @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This must be consistent with the section title." ) - protected CodeableConcept code; - - /** - * A nested sub-section within this section. - */ - @Child(name="section", type={SectionComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." ) - protected List section; - - /** - * The content (narrative and data) associated with the section. - */ - @Child(name="content", type={}, order=4, min=0, max=1) - @Description(shortDefinition="The Content of the section", formalDefinition="The content (narrative and data) associated with the section." ) - protected Reference content; - - /** - * The actual object that is the target of the reference (The content (narrative and data) associated with the section.) - */ - protected Resource contentTarget; - - private static final long serialVersionUID = -666692570L; - - public SectionComponent() { - super(); - } - - /** - * @return {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public SectionComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - public SectionComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) - */ - public SectionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #section} (A nested sub-section within this section.) - */ - public List getSection() { - if (this.section == null) - this.section = new ArrayList(); - return this.section; - } - - public boolean hasSection() { - if (this.section == null) - return false; - for (SectionComponent item : this.section) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #section} (A nested sub-section within this section.) - */ - // syntactic sugar - public SectionComponent addSection() { //3 - SectionComponent t = new SectionComponent(); - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return t; - } - - /** - * @return {@link #content} (The content (narrative and data) associated with the section.) - */ - public Reference getContent() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.content"); - else if (Configuration.doAutoCreate()) - this.content = new Reference(); - return this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The content (narrative and data) associated with the section.) - */ - public SectionComponent setContent(Reference value) { - this.content = value; - return this; - } - - /** - * @return {@link #content} 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 content (narrative and data) associated with the section.) - */ - public Resource getContentTarget() { - return this.contentTarget; - } - - /** - * @param value {@link #content} 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 content (narrative and data) associated with the section.) - */ - public SectionComponent setContentTarget(Resource value) { - this.contentTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("title", "string", "The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("code", "CodeableConcept", "A code identifying the kind of content contained within the section. This must be consistent with the section title.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section)); - childrenList.add(new Property("content", "Reference(Any)", "The content (narrative and data) associated with the section.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public SectionComponent copy() { - SectionComponent dst = new SectionComponent(); - copyValues(dst); - dst.title = title == null ? null : title.copy(); - dst.code = code == null ? null : code.copy(); - if (section != null) { - dst.section = new ArrayList(); - for (SectionComponent i : section) - dst.section.add(i.copy()); - }; - dst.content = content == null ? null : content.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) - && (section == null || section.isEmpty()) && (content == null || content.isEmpty()); - } - - } - - /** - * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Logical identifier of composition (version-independent)", formalDefinition="Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time." ) - protected Identifier identifier; - - /** - * The composition editing time, when the composition was last logically changed by the author. - */ - @Child(name="date", type={DateTimeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." ) - protected DateTimeType date; - - /** - * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Kind of composition (LOINC if possible)", formalDefinition="Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition." ) - protected CodeableConcept type; - - /** - * A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type. - */ - @Child(name="class_", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Categorization of Composition", formalDefinition="A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type." ) - protected CodeableConcept class_; - - /** - * Official human-readable label for the composition. - */ - @Child(name="title", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." ) - protected StringType title; - - /** - * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - @Child(name="status", type={CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="preliminary | final | appended | amended | entered in error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." ) - protected Enumeration status; - - /** - * The code specifying the level of confidentiality of the Composition. - */ - @Child(name="confidentiality", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." ) - protected Coding confidentiality; - - /** - * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). - */ - @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class, Location.class}, order=6, min=1, max=1) - @Description(shortDefinition="Who and/or what the composition is about", formalDefinition="Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - protected Resource subjectTarget; - - /** - * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.). - */ - @Child(name="author", type={Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=7, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who and/or what authored the composition", formalDefinition="Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.)." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - protected List authorTarget; - - - /** - * A participant who has attested to the accuracy of the composition/document. - */ - @Child(name="attester", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." ) - protected List attester; - - /** - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. - */ - @Child(name="custodian", type={Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Org which maintains the composition", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information." ) - protected Reference custodian; - - /** - * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - protected Organization custodianTarget; - - /** - * The clinical service, such as a colonoscopy or an appendectomy, being documented. - */ - @Child(name="event", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." ) - protected List event; - - /** - * Describes the clinical encounter or type of care this documentation is associated with. - */ - @Child(name="encounter", type={Encounter.class}, order=11, min=0, max=1) - @Description(shortDefinition="Context of the conposition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.) - */ - protected Encounter encounterTarget; - - /** - * The root of the sections that make up the composition. - */ - @Child(name="section", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." ) - protected List section; - - private static final long serialVersionUID = 2112290467L; - - public Composition() { - super(); - } - - public Composition(DateTimeType date, CodeableConcept type, Enumeration status, Coding confidentiality, Reference subject) { - super(); - this.date = date; - this.type = type; - this.status = status; - this.confidentiality = confidentiality; - this.subject = subject; - } - - /** - * @return {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) - */ - public Composition setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Composition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The composition editing time, when the composition was last logically changed by the author. - */ - 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(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) - */ - public Composition setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) - */ - public CodeableConcept getClass_() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new CodeableConcept(); - return this.class_; - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) - */ - public Composition setClass_(CodeableConcept value) { - this.class_ = value; - return this; - } - - /** - * @return {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Composition setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return Official human-readable label for the composition. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value Official human-readable label for the composition. - */ - public Composition setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Composition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - public CompositionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - public Composition setStatus(CompositionStatus value) { - if (this.status == null) - this.status = new Enumeration(CompositionStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.) - */ - public Coding getConfidentiality() { - if (this.confidentiality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.confidentiality"); - else if (Configuration.doAutoCreate()) - this.confidentiality = new Coding(); - return this.confidentiality; - } - - public boolean hasConfidentiality() { - return this.confidentiality != null && !this.confidentiality.isEmpty(); - } - - /** - * @param value {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.) - */ - public Composition setConfidentiality(Coding value) { - this.confidentiality = value; - return this; - } - - /** - * @return {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.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} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Composition 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. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Resource getSubjectTarget() { - 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. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) - */ - public Composition setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - /** - * @return {@link #author} (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 who is responsible for the information in the composition. (Not necessarily who typed it in.).) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) - */ - public List getAttester() { - if (this.attester == null) - this.attester = new ArrayList(); - return this.attester; - } - - public boolean hasAttester() { - if (this.attester == null) - return false; - for (CompositionAttesterComponent item : this.attester) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) - */ - // syntactic sugar - public CompositionAttesterComponent addAttester() { //3 - CompositionAttesterComponent t = new CompositionAttesterComponent(); - if (this.attester == null) - this.attester = new ArrayList(); - this.attester.add(t); - return t; - } - - /** - * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Reference getCustodian() { - if (this.custodian == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.custodian"); - else if (Configuration.doAutoCreate()) - this.custodian = new Reference(); - return this.custodian; - } - - public boolean hasCustodian() { - return this.custodian != null && !this.custodian.isEmpty(); - } - - /** - * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Composition setCustodian(Reference value) { - this.custodian = value; - return this; - } - - /** - * @return {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Organization getCustodianTarget() { - if (this.custodianTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.custodian"); - else if (Configuration.doAutoCreate()) - this.custodianTarget = new Organization(); - return this.custodianTarget; - } - - /** - * @param value {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Composition setCustodianTarget(Organization value) { - this.custodianTarget = value; - return this; - } - - /** - * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (CompositionEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) - */ - // syntactic sugar - public CompositionEventComponent addEvent() { //3 - CompositionEventComponent t = new CompositionEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - /** - * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.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} (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Composition 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. (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.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. (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Composition setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #section} (The root of the sections that make up the composition.) - */ - public List getSection() { - if (this.section == null) - this.section = new ArrayList(); - return this.section; - } - - public boolean hasSection() { - if (this.section == null) - return false; - for (SectionComponent item : this.section) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #section} (The root of the sections that make up the composition.) - */ - // syntactic sugar - public SectionComponent addSection() { //3 - SectionComponent t = new SectionComponent(); - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("title", "string", "Official human-readable label for the composition.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("status", "code", "The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("confidentiality", "Coding", "The code specifying the level of confidentiality of the Composition.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Location)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester)); - childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.", 0, java.lang.Integer.MAX_VALUE, custodian)); - childrenList.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section)); - } - - public Composition copy() { - Composition dst = new Composition(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.date = date == null ? null : date.copy(); - dst.type = type == null ? null : type.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - dst.title = title == null ? null : title.copy(); - dst.status = status == null ? null : status.copy(); - dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - if (attester != null) { - dst.attester = new ArrayList(); - for (CompositionAttesterComponent i : attester) - dst.attester.add(i.copy()); - }; - dst.custodian = custodian == null ? null : custodian.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (CompositionEventComponent i : event) - dst.event.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - if (section != null) { - dst.section = new ArrayList(); - for (SectionComponent i : section) - dst.section.add(i.copy()); - }; - return dst; - } - - protected Composition typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) && (title == null || title.isEmpty()) - && (status == null || status.isEmpty()) && (confidentiality == null || confidentiality.isEmpty()) - && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (attester == null || attester.isEmpty()) - && (custodian == null || custodian.isEmpty()) && (event == null || event.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (section == null || section.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Composition; - } - - @SearchParamDefinition(name="section-code", path="Composition.section.code", description="Classification of section (recommended)", type="token" ) - public static final String SP_SECTIONCODE = "section-code"; - @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | appended | amended | entered in error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) - 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="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" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="patient", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference" ) - public static final String SP_ATTESTER = "attester"; - @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" ) - public static final String SP_CONTEXT = "context"; - @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Logical identifier of composition (version-independent)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + */ +@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") +public class Composition extends DomainResource { + + 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. + */ + PRELIMINARY, + /** + * The composition or document is complete and verified by an appropriate person, and no further work is planned. + */ + FINAL, + /** + * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content. + */ + APPENDED, + /** + * The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. + */ + AMENDED, + /** + * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PRELIMINARY; + if ("final".equals(codeString)) + return FINAL; + if ("appended".equals(codeString)) + return APPENDED; + if ("amended".equals(codeString)) + return AMENDED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case APPENDED: return "appended"; + case AMENDED: return "amended"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRELIMINARY: return ""; + case FINAL: return ""; + case APPENDED: return ""; + case AMENDED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified."; + case FINAL: return "The composition or document is complete and verified by an appropriate person, and no further work is planned."; + case APPENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content."; + case AMENDED: return "The composition or document has been modified subsequent to being released as 'final', and is complete and verified by an authorized person."; + case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case APPENDED: return "appended"; + case AMENDED: return "amended"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + } + + public static class CompositionStatusEnumFactory implements EnumFactory { + public CompositionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("preliminary".equals(codeString)) + return CompositionStatus.PRELIMINARY; + if ("final".equals(codeString)) + return CompositionStatus.FINAL; + if ("appended".equals(codeString)) + return CompositionStatus.APPENDED; + if ("amended".equals(codeString)) + return CompositionStatus.AMENDED; + if ("entered in error".equals(codeString)) + return CompositionStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); + } + public String toCode(CompositionStatus code) throws IllegalArgumentException { + if (code == CompositionStatus.PRELIMINARY) + return "preliminary"; + if (code == CompositionStatus.FINAL) + return "final"; + if (code == CompositionStatus.APPENDED) + return "appended"; + if (code == CompositionStatus.AMENDED) + return "amended"; + if (code == CompositionStatus.ENTEREDINERROR) + return "entered in error"; + return "?"; + } + } + + public enum CompositionAttestationMode implements FhirEnum { + /** + * The person authenticated the content in their personal capacity. + */ + PERSONAL, + /** + * The person authenticated the content in their professional capacity. + */ + PROFESSIONAL, + /** + * The person authenticated the content and accepted legal responsibility for its content. + */ + LEGAL, + /** + * The organization authenticated the content as consistent with their policies and procedures. + */ + OFFICIAL, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PERSONAL; + if ("professional".equals(codeString)) + return PROFESSIONAL; + if ("legal".equals(codeString)) + return LEGAL; + if ("official".equals(codeString)) + return OFFICIAL; + throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PERSONAL: return "personal"; + case PROFESSIONAL: return "professional"; + case LEGAL: return "legal"; + case OFFICIAL: return "official"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PERSONAL: return ""; + case PROFESSIONAL: return ""; + case LEGAL: return ""; + case OFFICIAL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PERSONAL: return "The person authenticated the content in their personal capacity."; + case PROFESSIONAL: return "The person authenticated the content in their professional capacity."; + case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content."; + case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PERSONAL: return "personal"; + case PROFESSIONAL: return "professional"; + case LEGAL: return "legal"; + case OFFICIAL: return "official"; + default: return "?"; + } + } + } + + public static class CompositionAttestationModeEnumFactory implements EnumFactory { + public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("personal".equals(codeString)) + return CompositionAttestationMode.PERSONAL; + if ("professional".equals(codeString)) + return CompositionAttestationMode.PROFESSIONAL; + if ("legal".equals(codeString)) + return CompositionAttestationMode.LEGAL; + if ("official".equals(codeString)) + return CompositionAttestationMode.OFFICIAL; + throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); + } + public String toCode(CompositionAttestationMode code) throws IllegalArgumentException { + if (code == CompositionAttestationMode.PERSONAL) + return "personal"; + if (code == CompositionAttestationMode.PROFESSIONAL) + return "professional"; + if (code == CompositionAttestationMode.LEGAL) + return "legal"; + if (code == CompositionAttestationMode.OFFICIAL) + return "official"; + return "?"; + } + } + + @Block() + public static class CompositionAttesterComponent extends BackboneElement { + /** + * The type of attestation the authenticator offers. + */ + @Child(name="mode", type={CodeType.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." ) + protected List> mode; + + /** + * When composition was attested by the party. + */ + @Child(name="time", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When composition attested", formalDefinition="When composition was attested by the party." ) + protected DateTimeType time; + + /** + * Who attested the composition in the specified way. + */ + @Child(name="party", type={Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." ) + protected Reference party; + + /** + * The actual object that is the target of the reference (Who attested the composition in the specified way.) + */ + protected Resource partyTarget; + + private static final long serialVersionUID = -436604745L; + + public CompositionAttesterComponent() { + super(); + } + + /** + * @return {@link #mode} (The type of attestation the authenticator offers.) + */ + public List> getMode() { + if (this.mode == null) + this.mode = new ArrayList>(); + return this.mode; + } + + public boolean hasMode() { + if (this.mode == null) + return false; + for (Enumeration item : this.mode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mode} (The type of attestation the authenticator offers.) + */ + // syntactic sugar + public Enumeration addModeElement() {//2 + Enumeration t = new Enumeration(); + if (this.mode == null) + this.mode = new ArrayList>(); + this.mode.add(t); + return t; + } + + /** + * @param value {@link #mode} (The type of attestation the authenticator offers.) + */ + public CompositionAttesterComponent addMode(CompositionAttestationMode value) { //1 + Enumeration t = new Enumeration(); + t.setValue(value); + if (this.mode == null) + this.mode = new ArrayList>(); + this.mode.add(t); + return this; + } + + /** + * @param value {@link #mode} (The type of attestation the authenticator offers.) + */ + public boolean hasMode(CompositionAttestationMode value) { + if (this.mode == null) + return false; + for (Enumeration v : this.mode) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DateTimeType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionAttesterComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new DateTimeType(); + return this.time; + } + + public boolean hasTimeElement() { + return this.time != null && !this.time.isEmpty(); + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public CompositionAttesterComponent setTimeElement(DateTimeType value) { + this.time = value; + return this; + } + + /** + * @return When composition was attested by the party. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value When composition was attested by the party. + */ + public CompositionAttesterComponent setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new DateTimeType(); + this.time.setValue(value); + } + return this; + } + + /** + * @return {@link #party} (Who attested the composition in the specified way.) + */ + public Reference getParty() { + if (this.party == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionAttesterComponent.party"); + else if (Configuration.doAutoCreate()) + this.party = new Reference(); + return this.party; + } + + public boolean hasParty() { + return this.party != null && !this.party.isEmpty(); + } + + /** + * @param value {@link #party} (Who attested the composition in the specified way.) + */ + public CompositionAttesterComponent setParty(Reference value) { + this.party = value; + return this; + } + + /** + * @return {@link #party} 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. (Who attested the composition in the specified way.) + */ + public Resource getPartyTarget() { + return this.partyTarget; + } + + /** + * @param value {@link #party} 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. (Who attested the composition in the specified way.) + */ + public CompositionAttesterComponent setPartyTarget(Resource value) { + this.partyTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("time", "dateTime", "When composition was attested by the party.", 0, java.lang.Integer.MAX_VALUE, time)); + childrenList.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, java.lang.Integer.MAX_VALUE, party)); + } + + public CompositionAttesterComponent copy() { + CompositionAttesterComponent dst = new CompositionAttesterComponent(); + copyValues(dst); + if (mode != null) { + dst.mode = new ArrayList>(); + for (Enumeration i : mode) + dst.mode.add(i.copy()); + }; + dst.time = time == null ? null : time.copy(); + dst.party = party == null ? null : party.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (time == null || time.isEmpty()) + && (party == null || party.isEmpty()); + } + + } + + @Block() + public static class CompositionEventComponent extends BackboneElement { + /** + * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Code(s) that apply to the event being documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) + protected List code; + + /** + * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. + */ + @Child(name="period", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="The period covered by the documentation", formalDefinition="The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time." ) + protected Period period; + + /** + * Full details for the event(s) the composition/documentation consents. + */ + @Child(name="detail", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Full details for the event(s) the composition consents", formalDefinition="Full details for the event(s) the composition/documentation consents." ) + protected List detail; + /** + * The actual objects that are the target of the reference (Full details for the event(s) the composition/documentation consents.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = -1581379774L; + + public CompositionEventComponent() { + super(); + } + + /** + * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (CodeableConcept item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + // syntactic sugar + public CodeableConcept addCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + /** + * @return {@link #period} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CompositionEventComponent.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} (The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.) + */ + public CompositionEventComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Full details for the event(s) the composition/documentation consents.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + /** + * @return {@link #detail} (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. Full details for the event(s) the composition/documentation consents.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("period", "Period", "The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("detail", "Reference(Any)", "Full details for the event(s) the composition/documentation consents.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public CompositionEventComponent copy() { + CompositionEventComponent dst = new CompositionEventComponent(); + copyValues(dst); + if (code != null) { + dst.code = new ArrayList(); + for (CodeableConcept i : code) + dst.code.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (period == null || period.isEmpty()) + && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class SectionComponent extends BackboneElement { + /** + * The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + @Child(name="title", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents." ) + protected StringType title; + + /** + * A code identifying the kind of content contained within the section. This must be consistent with the section title. + */ + @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This must be consistent with the section title." ) + protected CodeableConcept code; + + /** + * A nested sub-section within this section. + */ + @Child(name="section", type={SectionComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." ) + protected List section; + + /** + * The content (narrative and data) associated with the section. + */ + @Child(name="content", type={}, order=4, min=0, max=1) + @Description(shortDefinition="The Content of the section", formalDefinition="The content (narrative and data) associated with the section." ) + protected Reference content; + + /** + * The actual object that is the target of the reference (The content (narrative and data) associated with the section.) + */ + protected Resource contentTarget; + + private static final long serialVersionUID = -666692570L; + + public SectionComponent() { + super(); + } + + /** + * @return {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public SectionComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + */ + public SectionComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) + */ + public SectionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #section} (A nested sub-section within this section.) + */ + public List getSection() { + if (this.section == null) + this.section = new ArrayList(); + return this.section; + } + + public boolean hasSection() { + if (this.section == null) + return false; + for (SectionComponent item : this.section) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #section} (A nested sub-section within this section.) + */ + // syntactic sugar + public SectionComponent addSection() { //3 + SectionComponent t = new SectionComponent(); + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return t; + } + + /** + * @return {@link #content} (The content (narrative and data) associated with the section.) + */ + public Reference getContent() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SectionComponent.content"); + else if (Configuration.doAutoCreate()) + this.content = new Reference(); + return this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The content (narrative and data) associated with the section.) + */ + public SectionComponent setContent(Reference value) { + this.content = value; + return this; + } + + /** + * @return {@link #content} 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 content (narrative and data) associated with the section.) + */ + public Resource getContentTarget() { + return this.contentTarget; + } + + /** + * @param value {@link #content} 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 content (narrative and data) associated with the section.) + */ + public SectionComponent setContentTarget(Resource value) { + this.contentTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("title", "string", "The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("code", "CodeableConcept", "A code identifying the kind of content contained within the section. This must be consistent with the section title.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section)); + childrenList.add(new Property("content", "Reference(Any)", "The content (narrative and data) associated with the section.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public SectionComponent copy() { + SectionComponent dst = new SectionComponent(); + copyValues(dst); + dst.title = title == null ? null : title.copy(); + dst.code = code == null ? null : code.copy(); + if (section != null) { + dst.section = new ArrayList(); + for (SectionComponent i : section) + dst.section.add(i.copy()); + }; + dst.content = content == null ? null : content.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) + && (section == null || section.isEmpty()) && (content == null || content.isEmpty()); + } + + } + + /** + * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Logical identifier of composition (version-independent)", formalDefinition="Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time." ) + protected Identifier identifier; + + /** + * The composition editing time, when the composition was last logically changed by the author. + */ + @Child(name="date", type={DateTimeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." ) + protected DateTimeType date; + + /** + * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Kind of composition (LOINC if possible)", formalDefinition="Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition." ) + protected CodeableConcept type; + + /** + * A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type. + */ + @Child(name="class_", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Categorization of Composition", formalDefinition="A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type." ) + protected CodeableConcept class_; + + /** + * Official human-readable label for the composition. + */ + @Child(name="title", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." ) + protected StringType title; + + /** + * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + @Child(name="status", type={CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="preliminary | final | appended | amended | entered in error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." ) + protected Enumeration status; + + /** + * The code specifying the level of confidentiality of the Composition. + */ + @Child(name="confidentiality", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." ) + protected Coding confidentiality; + + /** + * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). + */ + @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class, Location.class}, order=6, min=1, max=1) + @Description(shortDefinition="Who and/or what the composition is about", formalDefinition="Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + protected Resource subjectTarget; + + /** + * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.). + */ + @Child(name="author", type={Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=7, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who and/or what authored the composition", formalDefinition="Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.)." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + protected List authorTarget; + + + /** + * A participant who has attested to the accuracy of the composition/document. + */ + @Child(name="attester", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." ) + protected List attester; + + /** + * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. + */ + @Child(name="custodian", type={Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Org which maintains the composition", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information." ) + protected Reference custodian; + + /** + * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + protected Organization custodianTarget; + + /** + * The clinical service, such as a colonoscopy or an appendectomy, being documented. + */ + @Child(name="event", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." ) + protected List event; + + /** + * Describes the clinical encounter or type of care this documentation is associated with. + */ + @Child(name="encounter", type={Encounter.class}, order=11, min=0, max=1) + @Description(shortDefinition="Context of the conposition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.) + */ + protected Encounter encounterTarget; + + /** + * The root of the sections that make up the composition. + */ + @Child(name="section", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." ) + protected List section; + + private static final long serialVersionUID = 2112290467L; + + public Composition() { + super(); + } + + public Composition(DateTimeType date, CodeableConcept type, Enumeration status, Coding confidentiality, Reference subject) { + super(); + this.date = date; + this.type = type; + this.status = status; + this.confidentiality = confidentiality; + this.subject = subject; + } + + /** + * @return {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) + */ + public Composition setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Composition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The composition editing time, when the composition was last logically changed by the author. + */ + 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(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.) + */ + public Composition setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) + */ + public CodeableConcept getClass_() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new CodeableConcept(); + return this.class_; + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.) + */ + public Composition setClass_(CodeableConcept value) { + this.class_ = value; + return this; + } + + /** + * @return {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public Composition setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return Official human-readable label for the composition. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value Official human-readable label for the composition. + */ + public Composition setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Composition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + public CompositionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + */ + public Composition setStatus(CompositionStatus value) { + if (this.status == null) + this.status = new Enumeration(CompositionStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.) + */ + public Coding getConfidentiality() { + if (this.confidentiality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.confidentiality"); + else if (Configuration.doAutoCreate()) + this.confidentiality = new Coding(); + return this.confidentiality; + } + + public boolean hasConfidentiality() { + return this.confidentiality != null && !this.confidentiality.isEmpty(); + } + + /** + * @param value {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.) + */ + public Composition setConfidentiality(Coding value) { + this.confidentiality = value; + return this; + } + + /** + * @return {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.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} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Composition 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. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Resource getSubjectTarget() { + 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. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).) + */ + public Composition setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + /** + * @return {@link #author} (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 who is responsible for the information in the composition. (Not necessarily who typed it in.).) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) + */ + public List getAttester() { + if (this.attester == null) + this.attester = new ArrayList(); + return this.attester; + } + + public boolean hasAttester() { + if (this.attester == null) + return false; + for (CompositionAttesterComponent item : this.attester) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) + */ + // syntactic sugar + public CompositionAttesterComponent addAttester() { //3 + CompositionAttesterComponent t = new CompositionAttesterComponent(); + if (this.attester == null) + this.attester = new ArrayList(); + this.attester.add(t); + return t; + } + + /** + * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Reference getCustodian() { + if (this.custodian == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.custodian"); + else if (Configuration.doAutoCreate()) + this.custodian = new Reference(); + return this.custodian; + } + + public boolean hasCustodian() { + return this.custodian != null && !this.custodian.isEmpty(); + } + + /** + * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Composition setCustodian(Reference value) { + this.custodian = value; + return this; + } + + /** + * @return {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Organization getCustodianTarget() { + if (this.custodianTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.custodian"); + else if (Configuration.doAutoCreate()) + this.custodianTarget = new Organization(); + return this.custodianTarget; + } + + /** + * @param value {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) + */ + public Composition setCustodianTarget(Organization value) { + this.custodianTarget = value; + return this; + } + + /** + * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (CompositionEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) + */ + // syntactic sugar + public CompositionEventComponent addEvent() { //3 + CompositionEventComponent t = new CompositionEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + /** + * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.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} (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Composition 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. (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Composition.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. (Describes the clinical encounter or type of care this documentation is associated with.) + */ + public Composition setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #section} (The root of the sections that make up the composition.) + */ + public List getSection() { + if (this.section == null) + this.section = new ArrayList(); + return this.section; + } + + public boolean hasSection() { + if (this.section == null) + return false; + for (SectionComponent item : this.section) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #section} (The root of the sections that make up the composition.) + */ + // syntactic sugar + public SectionComponent addSection() { //3 + SectionComponent t = new SectionComponent(); + if (this.section == null) + this.section = new ArrayList(); + this.section.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("title", "string", "Official human-readable label for the composition.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("status", "code", "The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("confidentiality", "Coding", "The code specifying the level of confidentiality of the Composition.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Location)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.).", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester)); + childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.", 0, java.lang.Integer.MAX_VALUE, custodian)); + childrenList.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section)); + } + + public Composition copy() { + Composition dst = new Composition(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.date = date == null ? null : date.copy(); + dst.type = type == null ? null : type.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + dst.title = title == null ? null : title.copy(); + dst.status = status == null ? null : status.copy(); + dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + if (attester != null) { + dst.attester = new ArrayList(); + for (CompositionAttesterComponent i : attester) + dst.attester.add(i.copy()); + }; + dst.custodian = custodian == null ? null : custodian.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (CompositionEventComponent i : event) + dst.event.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + if (section != null) { + dst.section = new ArrayList(); + for (SectionComponent i : section) + dst.section.add(i.copy()); + }; + return dst; + } + + protected Composition typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) && (title == null || title.isEmpty()) + && (status == null || status.isEmpty()) && (confidentiality == null || confidentiality.isEmpty()) + && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (attester == null || attester.isEmpty()) + && (custodian == null || custodian.isEmpty()) && (event == null || event.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (section == null || section.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Composition; + } + + @SearchParamDefinition(name="section-code", path="Composition.section.code", description="Classification of section (recommended)", type="token" ) + public static final String SP_SECTIONCODE = "section-code"; + @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | appended | amended | entered in error", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) + 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="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" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="patient", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference" ) + public static final String SP_ATTESTER = "attester"; + @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" ) + public static final String SP_CONFIDENTIALITY = "confidentiality"; + @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" ) + public static final String SP_CONTEXT = "context"; + @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Logical identifier of composition (version-independent)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java index ea98782102c..05ffb4809f5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java @@ -20,1800 +20,1800 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. - */ -@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") -public class ConceptMap extends DomainResource { - - public enum ValuesetStatus implements FhirEnum { - /** - * This valueset is still under development. - */ - DRAFT, - /** - * This valueset is ready for normal use. - */ - ACTIVE, - /** - * This valueset has been withdrawn or superceded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This valueset is still under development."; - case ACTIVE: return "This valueset is ready for normal use."; - case RETIRED: return "This valueset has been withdrawn or superceded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case ACTIVE: return "Active"; - case RETIRED: return "Retired"; - default: return "?"; - } - } - } - - public static class ValuesetStatusEnumFactory implements EnumFactory { - public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ValuesetStatus.DRAFT; - if ("active".equals(codeString)) - return ValuesetStatus.ACTIVE; - if ("retired".equals(codeString)) - return ValuesetStatus.RETIRED; - throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); - } - public String toCode(ValuesetStatus code) throws IllegalArgumentException { - if (code == ValuesetStatus.DRAFT) - return "draft"; - if (code == ValuesetStatus.ACTIVE) - return "active"; - if (code == ValuesetStatus.RETIRED) - return "retired"; - return "?"; - } - } - - 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. - */ - WIDER, - /** - * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). - */ - SUBSUMES, - /** - * 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. - */ - NARROWER, - /** - * The target mapping specialises the meaning of the source concept (e.g. the target is-a source). - */ - SPECIALISES, - /** - * 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, - /** - * There is no match for this concept in the destination concept system. - */ - UNMATCHED, - /** - * This is an explicit assertion that there is no mapping between the source and target concept. - */ - DISJOINT, - /** - * added to help the parsers - */ - NULL; - - public static final ConceptEquivalenceEnumFactory ENUM_FACTORY = new ConceptEquivalenceEnumFactory(); - - public static ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("equivalent".equals(codeString)) - return EQUIVALENT; - if ("equal".equals(codeString)) - return EQUAL; - if ("wider".equals(codeString)) - return WIDER; - if ("subsumes".equals(codeString)) - return SUBSUMES; - if ("narrower".equals(codeString)) - return NARROWER; - if ("specialises".equals(codeString)) - return SPECIALISES; - if ("inexact".equals(codeString)) - return INEXACT; - if ("unmatched".equals(codeString)) - return UNMATCHED; - if ("disjoint".equals(codeString)) - return DISJOINT; - throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case EQUIVALENT: return "equivalent"; - case EQUAL: return "equal"; - case WIDER: return "wider"; - case SUBSUMES: return "subsumes"; - case NARROWER: return "narrower"; - case SPECIALISES: return "specialises"; - case INEXACT: return "inexact"; - case UNMATCHED: return "unmatched"; - case DISJOINT: return "disjoint"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUIVALENT: return ""; - case EQUAL: return ""; - case WIDER: return ""; - case SUBSUMES: return ""; - case NARROWER: return ""; - case SPECIALISES: return ""; - case INEXACT: return ""; - case UNMATCHED: return ""; - case DISJOINT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - 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, 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 "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUIVALENT: return "equivalent"; - case EQUAL: return "equal"; - case WIDER: return "wider"; - case SUBSUMES: return "subsumes"; - case NARROWER: return "narrower"; - case SPECIALISES: return "specialises"; - case INEXACT: return "inexact"; - case UNMATCHED: return "unmatched"; - case DISJOINT: return "disjoint"; - default: return "?"; - } - } - } - - public static class ConceptEquivalenceEnumFactory implements EnumFactory { - public ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - 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)) - return ConceptEquivalence.SUBSUMES; - if ("narrower".equals(codeString)) - return ConceptEquivalence.NARROWER; - if ("specialises".equals(codeString)) - return ConceptEquivalence.SPECIALISES; - if ("inexact".equals(codeString)) - return ConceptEquivalence.INEXACT; - if ("unmatched".equals(codeString)) - return ConceptEquivalence.UNMATCHED; - if ("disjoint".equals(codeString)) - return ConceptEquivalence.DISJOINT; - throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); - } - 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) - return "subsumes"; - if (code == ConceptEquivalence.NARROWER) - return "narrower"; - if (code == ConceptEquivalence.SPECIALISES) - return "specialises"; - if (code == ConceptEquivalence.INEXACT) - return "inexact"; - if (code == ConceptEquivalence.UNMATCHED) - return "unmatched"; - if (code == ConceptEquivalence.DISJOINT) - return "disjoint"; - return "?"; - } - } - - @Block() - public static class ConceptMapElementComponent extends BackboneElement { - /** - * Code System (if the source is a value value set that crosses more than one code system). - */ - @Child(name="codeSystem", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code System (if value set crosses code systems)", formalDefinition="Code System (if the source is a value value set that crosses more than one code system)." ) - protected UriType codeSystem; - - /** - * Identity (code or path) or the element/item being mapped. - */ - @Child(name="code", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Identifies element being mapped", formalDefinition="Identity (code or path) or the element/item being mapped." ) - protected CodeType code; - - /** - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. - */ - @Child(name="dependsOn", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other elements required for this mapping (from context)", formalDefinition="A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value." ) - protected List dependsOn; - - /** - * A concept from the target value set that this concept maps to. - */ - @Child(name="map", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target of this map", formalDefinition="A concept from the target value set that this concept maps to." ) - protected List map; - - private static final long serialVersionUID = 2079040744L; - - public ConceptMapElementComponent() { - super(); - } - - /** - * @return {@link #codeSystem} (Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public UriType getCodeSystemElement() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementComponent.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new UriType(); - return this.codeSystem; - } - - public boolean hasCodeSystemElement() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public ConceptMapElementComponent setCodeSystemElement(UriType value) { - this.codeSystem = value; - return this; - } - - /** - * @return Code System (if the source is a value value set that crosses more than one code system). - */ - public String getCodeSystem() { - return this.codeSystem == null ? null : this.codeSystem.getValue(); - } - - /** - * @param value Code System (if the source is a value value set that crosses more than one code system). - */ - public ConceptMapElementComponent setCodeSystem(String value) { - if (Utilities.noString(value)) - this.codeSystem = null; - else { - if (this.codeSystem == null) - this.codeSystem = new UriType(); - this.codeSystem.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptMapElementComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item being mapped. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item being mapped. - */ - public ConceptMapElementComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) - */ - public List getDependsOn() { - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - return this.dependsOn; - } - - public boolean hasDependsOn() { - if (this.dependsOn == null) - return false; - for (OtherElementComponent item : this.dependsOn) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) - */ - // syntactic sugar - public OtherElementComponent addDependsOn() { //3 - OtherElementComponent t = new OtherElementComponent(); - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - this.dependsOn.add(t); - return t; - } - - /** - * @return {@link #map} (A concept from the target value set that this concept maps to.) - */ - public List getMap() { - if (this.map == null) - this.map = new ArrayList(); - return this.map; - } - - public boolean hasMap() { - if (this.map == null) - return false; - for (ConceptMapElementMapComponent item : this.map) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #map} (A concept from the target value set that this concept maps to.) - */ - // syntactic sugar - public ConceptMapElementMapComponent addMap() { //3 - ConceptMapElementMapComponent t = new ConceptMapElementMapComponent(); - if (this.map == null) - this.map = new ArrayList(); - this.map.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeSystem", "uri", "Code System (if the source is a value value set that crosses more than one code system).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item being mapped.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("dependsOn", "", "A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.", 0, java.lang.Integer.MAX_VALUE, dependsOn)); - childrenList.add(new Property("map", "", "A concept from the target value set that this concept maps to.", 0, java.lang.Integer.MAX_VALUE, map)); - } - - public ConceptMapElementComponent copy() { - ConceptMapElementComponent dst = new ConceptMapElementComponent(); - copyValues(dst); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.code = code == null ? null : code.copy(); - if (dependsOn != null) { - dst.dependsOn = new ArrayList(); - for (OtherElementComponent i : dependsOn) - dst.dependsOn.add(i.copy()); - }; - if (map != null) { - dst.map = new ArrayList(); - for (ConceptMapElementMapComponent i : map) - dst.map.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) - && (dependsOn == null || dependsOn.isEmpty()) && (map == null || map.isEmpty()); - } - - } - - @Block() - public static class OtherElementComponent extends BackboneElement { - /** - * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - @Child(name="element", type={UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Reference to element/field/valueset mapping depends on", formalDefinition="A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition." ) - protected UriType element; - - /** - * The code system of the dependency code (if the source/dependency is a value set that cross code systems). - */ - @Child(name="codeSystem", type={UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Code System (if necessary)", formalDefinition="The code system of the dependency code (if the source/dependency is a value set that cross code systems)." ) - protected UriType codeSystem; - - /** - * Identity (code or path) or the element/item that the map depends on / refers to. - */ - @Child(name="code", type={StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Value of the referenced element", formalDefinition="Identity (code or path) or the element/item that the map depends on / refers to." ) - protected StringType code; - - private static final long serialVersionUID = 1488522448L; - - public OtherElementComponent() { - super(); - } - - public OtherElementComponent(UriType element, UriType codeSystem, StringType code) { - super(); - this.element = element; - this.codeSystem = codeSystem; - this.code = code; - } - - /** - * @return {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public UriType getElementElement() { - if (this.element == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.element"); - else if (Configuration.doAutoCreate()) - this.element = new UriType(); - return this.element; - } - - public boolean hasElementElement() { - return this.element != null && !this.element.isEmpty(); - } - - public boolean hasElement() { - return this.element != null && !this.element.isEmpty(); - } - - /** - * @param value {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public OtherElementComponent setElementElement(UriType value) { - this.element = value; - return this; - } - - /** - * @return A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - public String getElement() { - return this.element == null ? null : this.element.getValue(); - } - - /** - * @param value A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - public OtherElementComponent setElement(String value) { - if (this.element == null) - this.element = new UriType(); - this.element.setValue(value); - return this; - } - - /** - * @return {@link #codeSystem} (The code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public UriType getCodeSystemElement() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new UriType(); - return this.codeSystem; - } - - public boolean hasCodeSystemElement() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (The code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public OtherElementComponent setCodeSystemElement(UriType value) { - this.codeSystem = value; - return this; - } - - /** - * @return The code system of the dependency code (if the source/dependency is a value set that cross code systems). - */ - public String getCodeSystem() { - return this.codeSystem == null ? null : this.codeSystem.getValue(); - } - - /** - * @param value The code system of the dependency code (if the source/dependency is a value set that cross code systems). - */ - public OtherElementComponent setCodeSystem(String value) { - if (this.codeSystem == null) - this.codeSystem = new UriType(); - this.codeSystem.setValue(value); - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public StringType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new StringType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OtherElementComponent setCodeElement(StringType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item that the map depends on / refers to. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item that the map depends on / refers to. - */ - public OtherElementComponent setCode(String value) { - if (this.code == null) - this.code = new StringType(); - this.code.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "uri", "A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.", 0, java.lang.Integer.MAX_VALUE, element)); - childrenList.add(new Property("codeSystem", "uri", "The code system of the dependency code (if the source/dependency is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("code", "string", "Identity (code or path) or the element/item that the map depends on / refers to.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public OtherElementComponent copy() { - OtherElementComponent dst = new OtherElementComponent(); - copyValues(dst); - dst.element = element == null ? null : element.copy(); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) - && (code == null || code.isEmpty()); - } - - } - - @Block() - public static class ConceptMapElementMapComponent extends BackboneElement { - /** - * The code system of the target code (if the target is a value set that cross code systems). - */ - @Child(name="codeSystem", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="System of the target (if necessary)", formalDefinition="The code system of the target code (if the target is a value set that cross code systems)." ) - protected UriType codeSystem; - - /** - * Identity (code or path) or the element/item that the map refers to. - */ - @Child(name="code", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Code that identifies the target element", formalDefinition="Identity (code or path) or the element/item that the map refers to." ) - protected CodeType code; - - /** - * 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="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 equivalence; - - /** - * A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - @Child(name="comments", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Description of status/issues in mapping", formalDefinition="A description of status/issues in mapping that conveys additional information not represented in the structured data." ) - protected StringType comments; - - /** - * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. - */ - @Child(name="product", type={OtherElementComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other concepts that this mapping also produces", formalDefinition="A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on." ) - protected List product; - - private static final long serialVersionUID = 606421694L; - - public ConceptMapElementMapComponent() { - super(); - } - - public ConceptMapElementMapComponent(Enumeration equivalence) { - super(); - this.equivalence = equivalence; - } - - /** - * @return {@link #codeSystem} (The code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public UriType getCodeSystemElement() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new UriType(); - return this.codeSystem; - } - - public boolean hasCodeSystemElement() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (The code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value - */ - public ConceptMapElementMapComponent setCodeSystemElement(UriType value) { - this.codeSystem = value; - return this; - } - - /** - * @return The code system of the target code (if the target is a value set that cross code systems). - */ - public String getCodeSystem() { - return this.codeSystem == null ? null : this.codeSystem.getValue(); - } - - /** - * @param value The code system of the target code (if the target is a value set that cross code systems). - */ - public ConceptMapElementMapComponent setCodeSystem(String value) { - if (Utilities.noString(value)) - this.codeSystem = null; - else { - if (this.codeSystem == null) - this.codeSystem = new UriType(); - this.codeSystem.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptMapElementMapComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item that the map refers to. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item that the map refers to. - */ - public ConceptMapElementMapComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #equivalence} (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.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value - */ - public Enumeration getEquivalenceElement() { - if (this.equivalence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.equivalence"); - else if (Configuration.doAutoCreate()) - this.equivalence = new Enumeration(); - return this.equivalence; - } - - public boolean hasEquivalenceElement() { - return this.equivalence != null && !this.equivalence.isEmpty(); - } - - public boolean hasEquivalence() { - return this.equivalence != null && !this.equivalence.isEmpty(); - } - - /** - * @param value {@link #equivalence} (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.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value - */ - public ConceptMapElementMapComponent setEquivalenceElement(Enumeration value) { - this.equivalence = value; - return this; - } - - /** - * @return 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. - */ - public ConceptEquivalence getEquivalence() { - return this.equivalence == null ? null : this.equivalence.getValue(); - } - - /** - * @param value 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. - */ - public ConceptMapElementMapComponent setEquivalence(ConceptEquivalence value) { - if (this.equivalence == null) - this.equivalence = new Enumeration(ConceptEquivalence.ENUM_FACTORY); - this.equivalence.setValue(value); - return this; - } - - /** - * @return {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapElementMapComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ConceptMapElementMapComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - public ConceptMapElementMapComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) - */ - public List getProduct() { - if (this.product == null) - this.product = new ArrayList(); - return this.product; - } - - public boolean hasProduct() { - if (this.product == null) - return false; - for (OtherElementComponent item : this.product) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) - */ - // syntactic sugar - public OtherElementComponent addProduct() { //3 - OtherElementComponent t = new OtherElementComponent(); - if (this.product == null) - this.product = new ArrayList(); - this.product.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeSystem", "uri", "The code system of the target code (if the target is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item that the map refers to.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("equivalence", "code", "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.", 0, java.lang.Integer.MAX_VALUE, equivalence)); - childrenList.add(new Property("comments", "string", "A description of status/issues in mapping that conveys additional information not represented in the structured data.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("product", "@ConceptMap.element.dependsOn", "A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.", 0, java.lang.Integer.MAX_VALUE, product)); - } - - public ConceptMapElementMapComponent copy() { - ConceptMapElementMapComponent dst = new ConceptMapElementMapComponent(); - copyValues(dst); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.code = code == null ? null : code.copy(); - dst.equivalence = equivalence == null ? null : equivalence.copy(); - dst.comments = comments == null ? null : comments.copy(); - if (product != null) { - dst.product = new ArrayList(); - for (OtherElementComponent i : product) - dst.product.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) - && (equivalence == null || equivalence.isEmpty()) && (comments == null || comments.isEmpty()) - && (product == null || product.isEmpty()); - } - - } - - /** - * The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - @Child(name="identifier", type={StringType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Logical id to reference this concept map", formalDefinition="The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) - protected StringType identifier; - - /** - * The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the concept map", formalDefinition="The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name describing the concept map. - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Informal name for this concept map", formalDefinition="A free text natural language name describing the concept map." ) - protected StringType name; - - /** - * The name of the individual or organization that published the concept map. - */ - @Child(name="publisher", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the concept map." ) - protected StringType publisher; - - /** - * Contacts of the publisher to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contacts of the publisher to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human language description of the concept map", formalDefinition="A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc." ) - protected StringType description; - - /** - * A copyright statement relating to the concept map and/or its contents. - */ - @Child(name="copyright", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="About the concept map or its content", formalDefinition="A copyright statement relating to the concept map and/or its contents." ) - protected StringType copyright; - - /** - * The status of the concept map. - */ - @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the concept map." ) - protected Enumeration status; - - /** - * This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name="experimental", type={BooleanType.class}, order=7, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that the concept map status was last changed. - */ - @Child(name="date", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the concept map status was last changed." ) - protected DateTimeType date; - - /** - * The source value set that specifies the concepts that are being mapped. - */ - @Child(name="source", type={UriType.class, ValueSet.class, Profile.class}, order=9, min=1, max=1) - @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) - protected Type source; - - /** - * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. - */ - @Child(name="target", type={UriType.class, ValueSet.class, Profile.class}, order=10, min=1, max=1) - @Description(shortDefinition="Provides context to the mappings", formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made." ) - protected Type target; - - /** - * Mappings for an individual concept in the source to one or more concepts in the target. - */ - @Child(name="element", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Mappings for a concept from the source set", formalDefinition="Mappings for an individual concept in the source to one or more concepts in the target." ) - protected List element; - - private static final long serialVersionUID = 1130142902L; - - public ConceptMap() { - super(); - } - - public ConceptMap(Enumeration status, Type source, Type target) { - super(); - this.status = status; - this.source = source; - this.target = target; - } - - /** - * @return {@link #identifier} (The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ConceptMap setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public ConceptMap setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConceptMap setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public ConceptMap setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConceptMap setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the concept map. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the concept map. - */ - public ConceptMap setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ConceptMap setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the concept map. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the concept map. - */ - public ConceptMap setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). 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 ConceptMap.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} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConceptMap setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - public ConceptMap setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ConceptMap setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the concept map and/or its contents. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the concept map and/or its contents. - */ - public ConceptMap setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ConceptMap setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the concept map. - */ - public ValuesetStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the concept map. - */ - public ConceptMap setStatus(ValuesetStatus value) { - if (this.status == null) - this.status = new Enumeration(ValuesetStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ConceptMap setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null ? false : this.experimental.getValue(); - } - - /** - * @param value This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ConceptMap setExperimental(boolean value) { - if (value == false) - this.experimental = null; - else { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ConceptMap setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the concept map status was last changed. - */ - 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(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public Type getSource() { - return this.source; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public UriType getSourceUriType() throws Exception { - if (!(this.source instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); - return (UriType) this.source; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public Reference getSourceReference() throws Exception { - if (!(this.source instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); - return (Reference) this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public ConceptMap setSource(Type value) { - this.source = value; - return this; - } - - /** - * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public UriType getTargetUriType() throws Exception { - if (!(this.target instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered"); - return (UriType) this.target; - } - - /** - * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public Reference getTargetReference() throws Exception { - if (!(this.target instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) - */ - public ConceptMap setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ConceptMapElementComponent item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) - */ - // syntactic sugar - public ConceptMapElementComponent addElement() { //3 - ConceptMapElementComponent t = new ConceptMapElementComponent(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "string", "The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the concept map.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contacts of the publisher to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the concept map and/or its contents.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("status", "code", "The status of the concept map.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that the concept map status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|Profile)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|Profile)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("element", "", "Mappings for an individual concept in the source to one or more concepts in the target.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public ConceptMap copy() { - ConceptMap dst = new ConceptMap(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.source = source == null ? null : source.copy(); - dst.target = target == null ? null : target.copy(); - if (element != null) { - dst.element = new ArrayList(); - for (ConceptMapElementComponent i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - protected ConceptMap typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (description == null || description.isEmpty()) && (copyright == null || copyright.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) - && (element == null || element.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ConceptMap; - } - - @SearchParamDefinition(name="product", path="ConceptMap.element.map.product.element", description="Reference to element/field/valueset mapping depends on", type="token" ) - public static final String SP_PRODUCT = "product"; - @SearchParamDefinition(name="dependson", path="ConceptMap.element.dependsOn.element", description="Reference to element/field/valueset mapping depends on", type="token" ) - public static final String SP_DEPENDSON = "dependson"; - @SearchParamDefinition(name="system", path="ConceptMap.element.map.codeSystem", description="The system for any destination concepts mapped by this map", type="token" ) - public static final String SP_SYSTEM = "system"; - @SearchParamDefinition(name="source", path="ConceptMap.source[x]", description="The system for any concepts mapped by this concept map", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="status", path="ConceptMap.status", description="Status of the concept map", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="ConceptMap.description", description="Text search in the description of the concept map", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="ConceptMap.name", description="Name of the concept map", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="target", path="ConceptMap.target[x]", description="Provides context to the mappings", type="reference" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="date", path="ConceptMap.date", description="The concept map publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="The identifier of the concept map", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="publisher", path="ConceptMap.publisher", description="Name of the publisher of the concept map", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="version", path="ConceptMap.version", description="The version identifier of the concept map", type="token" ) - public static final String SP_VERSION = "version"; - -} - + +/* + 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; +/** + * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + */ +@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") +public class ConceptMap extends DomainResource { + + public enum ValuesetStatus implements FhirEnum { + /** + * This valueset is still under development. + */ + DRAFT, + /** + * This valueset is ready for normal use. + */ + ACTIVE, + /** + * This valueset has been withdrawn or superceded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This valueset is still under development."; + case ACTIVE: return "This valueset is ready for normal use."; + case RETIRED: return "This valueset has been withdrawn or superceded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case ACTIVE: return "Active"; + case RETIRED: return "Retired"; + default: return "?"; + } + } + } + + public static class ValuesetStatusEnumFactory implements EnumFactory { + public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ValuesetStatus.DRAFT; + if ("active".equals(codeString)) + return ValuesetStatus.ACTIVE; + if ("retired".equals(codeString)) + return ValuesetStatus.RETIRED; + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); + } + public String toCode(ValuesetStatus code) throws IllegalArgumentException { + if (code == ValuesetStatus.DRAFT) + return "draft"; + if (code == ValuesetStatus.ACTIVE) + return "active"; + if (code == ValuesetStatus.RETIRED) + return "retired"; + return "?"; + } + } + + 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. + */ + WIDER, + /** + * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). + */ + SUBSUMES, + /** + * 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. + */ + NARROWER, + /** + * The target mapping specialises the meaning of the source concept (e.g. the target is-a source). + */ + SPECIALISES, + /** + * 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, + /** + * There is no match for this concept in the destination concept system. + */ + UNMATCHED, + /** + * This is an explicit assertion that there is no mapping between the source and target concept. + */ + DISJOINT, + /** + * added to help the parsers + */ + NULL; + + public static final ConceptEquivalenceEnumFactory ENUM_FACTORY = new ConceptEquivalenceEnumFactory(); + + public static ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("equivalent".equals(codeString)) + return EQUIVALENT; + if ("equal".equals(codeString)) + return EQUAL; + if ("wider".equals(codeString)) + return WIDER; + if ("subsumes".equals(codeString)) + return SUBSUMES; + if ("narrower".equals(codeString)) + return NARROWER; + if ("specialises".equals(codeString)) + return SPECIALISES; + if ("inexact".equals(codeString)) + return INEXACT; + if ("unmatched".equals(codeString)) + return UNMATCHED; + if ("disjoint".equals(codeString)) + return DISJOINT; + throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case EQUIVALENT: return "equivalent"; + case EQUAL: return "equal"; + case WIDER: return "wider"; + case SUBSUMES: return "subsumes"; + case NARROWER: return "narrower"; + case SPECIALISES: return "specialises"; + case INEXACT: return "inexact"; + case UNMATCHED: return "unmatched"; + case DISJOINT: return "disjoint"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUIVALENT: return ""; + case EQUAL: return ""; + case WIDER: return ""; + case SUBSUMES: return ""; + case NARROWER: return ""; + case SPECIALISES: return ""; + case INEXACT: return ""; + case UNMATCHED: return ""; + case DISJOINT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + 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, 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 "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUIVALENT: return "equivalent"; + case EQUAL: return "equal"; + case WIDER: return "wider"; + case SUBSUMES: return "subsumes"; + case NARROWER: return "narrower"; + case SPECIALISES: return "specialises"; + case INEXACT: return "inexact"; + case UNMATCHED: return "unmatched"; + case DISJOINT: return "disjoint"; + default: return "?"; + } + } + } + + public static class ConceptEquivalenceEnumFactory implements EnumFactory { + public ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + 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)) + return ConceptEquivalence.SUBSUMES; + if ("narrower".equals(codeString)) + return ConceptEquivalence.NARROWER; + if ("specialises".equals(codeString)) + return ConceptEquivalence.SPECIALISES; + if ("inexact".equals(codeString)) + return ConceptEquivalence.INEXACT; + if ("unmatched".equals(codeString)) + return ConceptEquivalence.UNMATCHED; + if ("disjoint".equals(codeString)) + return ConceptEquivalence.DISJOINT; + throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); + } + 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) + return "subsumes"; + if (code == ConceptEquivalence.NARROWER) + return "narrower"; + if (code == ConceptEquivalence.SPECIALISES) + return "specialises"; + if (code == ConceptEquivalence.INEXACT) + return "inexact"; + if (code == ConceptEquivalence.UNMATCHED) + return "unmatched"; + if (code == ConceptEquivalence.DISJOINT) + return "disjoint"; + return "?"; + } + } + + @Block() + public static class ConceptMapElementComponent extends BackboneElement { + /** + * Code System (if the source is a value value set that crosses more than one code system). + */ + @Child(name="codeSystem", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code System (if value set crosses code systems)", formalDefinition="Code System (if the source is a value value set that crosses more than one code system)." ) + protected UriType codeSystem; + + /** + * Identity (code or path) or the element/item being mapped. + */ + @Child(name="code", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Identifies element being mapped", formalDefinition="Identity (code or path) or the element/item being mapped." ) + protected CodeType code; + + /** + * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. + */ + @Child(name="dependsOn", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other elements required for this mapping (from context)", formalDefinition="A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value." ) + protected List dependsOn; + + /** + * A concept from the target value set that this concept maps to. + */ + @Child(name="map", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target of this map", formalDefinition="A concept from the target value set that this concept maps to." ) + protected List map; + + private static final long serialVersionUID = 2079040744L; + + public ConceptMapElementComponent() { + super(); + } + + /** + * @return {@link #codeSystem} (Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public UriType getCodeSystemElement() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementComponent.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new UriType(); + return this.codeSystem; + } + + public boolean hasCodeSystemElement() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (Code System (if the source is a value value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public ConceptMapElementComponent setCodeSystemElement(UriType value) { + this.codeSystem = value; + return this; + } + + /** + * @return Code System (if the source is a value value set that crosses more than one code system). + */ + public String getCodeSystem() { + return this.codeSystem == null ? null : this.codeSystem.getValue(); + } + + /** + * @param value Code System (if the source is a value value set that crosses more than one code system). + */ + public ConceptMapElementComponent setCodeSystem(String value) { + if (Utilities.noString(value)) + this.codeSystem = null; + else { + if (this.codeSystem == null) + this.codeSystem = new UriType(); + this.codeSystem.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptMapElementComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item being mapped. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item being mapped. + */ + public ConceptMapElementComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) + */ + public List getDependsOn() { + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + return this.dependsOn; + } + + public boolean hasDependsOn() { + if (this.dependsOn == null) + return false; + for (OtherElementComponent item : this.dependsOn) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) + */ + // syntactic sugar + public OtherElementComponent addDependsOn() { //3 + OtherElementComponent t = new OtherElementComponent(); + if (this.dependsOn == null) + this.dependsOn = new ArrayList(); + this.dependsOn.add(t); + return t; + } + + /** + * @return {@link #map} (A concept from the target value set that this concept maps to.) + */ + public List getMap() { + if (this.map == null) + this.map = new ArrayList(); + return this.map; + } + + public boolean hasMap() { + if (this.map == null) + return false; + for (ConceptMapElementMapComponent item : this.map) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #map} (A concept from the target value set that this concept maps to.) + */ + // syntactic sugar + public ConceptMapElementMapComponent addMap() { //3 + ConceptMapElementMapComponent t = new ConceptMapElementMapComponent(); + if (this.map == null) + this.map = new ArrayList(); + this.map.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeSystem", "uri", "Code System (if the source is a value value set that crosses more than one code system).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item being mapped.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("dependsOn", "", "A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.", 0, java.lang.Integer.MAX_VALUE, dependsOn)); + childrenList.add(new Property("map", "", "A concept from the target value set that this concept maps to.", 0, java.lang.Integer.MAX_VALUE, map)); + } + + public ConceptMapElementComponent copy() { + ConceptMapElementComponent dst = new ConceptMapElementComponent(); + copyValues(dst); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.code = code == null ? null : code.copy(); + if (dependsOn != null) { + dst.dependsOn = new ArrayList(); + for (OtherElementComponent i : dependsOn) + dst.dependsOn.add(i.copy()); + }; + if (map != null) { + dst.map = new ArrayList(); + for (ConceptMapElementMapComponent i : map) + dst.map.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) + && (dependsOn == null || dependsOn.isEmpty()) && (map == null || map.isEmpty()); + } + + } + + @Block() + public static class OtherElementComponent extends BackboneElement { + /** + * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + @Child(name="element", type={UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Reference to element/field/valueset mapping depends on", formalDefinition="A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition." ) + protected UriType element; + + /** + * The code system of the dependency code (if the source/dependency is a value set that cross code systems). + */ + @Child(name="codeSystem", type={UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Code System (if necessary)", formalDefinition="The code system of the dependency code (if the source/dependency is a value set that cross code systems)." ) + protected UriType codeSystem; + + /** + * Identity (code or path) or the element/item that the map depends on / refers to. + */ + @Child(name="code", type={StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Value of the referenced element", formalDefinition="Identity (code or path) or the element/item that the map depends on / refers to." ) + protected StringType code; + + private static final long serialVersionUID = 1488522448L; + + public OtherElementComponent() { + super(); + } + + public OtherElementComponent(UriType element, UriType codeSystem, StringType code) { + super(); + this.element = element; + this.codeSystem = codeSystem; + this.code = code; + } + + /** + * @return {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public UriType getElementElement() { + if (this.element == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.element"); + else if (Configuration.doAutoCreate()) + this.element = new UriType(); + return this.element; + } + + public boolean hasElementElement() { + return this.element != null && !this.element.isEmpty(); + } + + public boolean hasElement() { + return this.element != null && !this.element.isEmpty(); + } + + /** + * @param value {@link #element} (A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value + */ + public OtherElementComponent setElementElement(UriType value) { + this.element = value; + return this; + } + + /** + * @return A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + public String getElement() { + return this.element == null ? null : this.element.getValue(); + } + + /** + * @param value A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + */ + public OtherElementComponent setElement(String value) { + if (this.element == null) + this.element = new UriType(); + this.element.setValue(value); + return this; + } + + /** + * @return {@link #codeSystem} (The code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public UriType getCodeSystemElement() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new UriType(); + return this.codeSystem; + } + + public boolean hasCodeSystemElement() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (The code system of the dependency code (if the source/dependency is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public OtherElementComponent setCodeSystemElement(UriType value) { + this.codeSystem = value; + return this; + } + + /** + * @return The code system of the dependency code (if the source/dependency is a value set that cross code systems). + */ + public String getCodeSystem() { + return this.codeSystem == null ? null : this.codeSystem.getValue(); + } + + /** + * @param value The code system of the dependency code (if the source/dependency is a value set that cross code systems). + */ + public OtherElementComponent setCodeSystem(String value) { + if (this.codeSystem == null) + this.codeSystem = new UriType(); + this.codeSystem.setValue(value); + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public StringType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OtherElementComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new StringType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OtherElementComponent setCodeElement(StringType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item that the map depends on / refers to. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item that the map depends on / refers to. + */ + public OtherElementComponent setCode(String value) { + if (this.code == null) + this.code = new StringType(); + this.code.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "uri", "A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.", 0, java.lang.Integer.MAX_VALUE, element)); + childrenList.add(new Property("codeSystem", "uri", "The code system of the dependency code (if the source/dependency is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("code", "string", "Identity (code or path) or the element/item that the map depends on / refers to.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public OtherElementComponent copy() { + OtherElementComponent dst = new OtherElementComponent(); + copyValues(dst); + dst.element = element == null ? null : element.copy(); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) + && (code == null || code.isEmpty()); + } + + } + + @Block() + public static class ConceptMapElementMapComponent extends BackboneElement { + /** + * The code system of the target code (if the target is a value set that cross code systems). + */ + @Child(name="codeSystem", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="System of the target (if necessary)", formalDefinition="The code system of the target code (if the target is a value set that cross code systems)." ) + protected UriType codeSystem; + + /** + * Identity (code or path) or the element/item that the map refers to. + */ + @Child(name="code", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Code that identifies the target element", formalDefinition="Identity (code or path) or the element/item that the map refers to." ) + protected CodeType code; + + /** + * 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="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 equivalence; + + /** + * A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + @Child(name="comments", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description of status/issues in mapping", formalDefinition="A description of status/issues in mapping that conveys additional information not represented in the structured data." ) + protected StringType comments; + + /** + * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. + */ + @Child(name="product", type={OtherElementComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other concepts that this mapping also produces", formalDefinition="A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on." ) + protected List product; + + private static final long serialVersionUID = 606421694L; + + public ConceptMapElementMapComponent() { + super(); + } + + public ConceptMapElementMapComponent(Enumeration equivalence) { + super(); + this.equivalence = equivalence; + } + + /** + * @return {@link #codeSystem} (The code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public UriType getCodeSystemElement() { + if (this.codeSystem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.codeSystem"); + else if (Configuration.doAutoCreate()) + this.codeSystem = new UriType(); + return this.codeSystem; + } + + public boolean hasCodeSystemElement() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + public boolean hasCodeSystem() { + return this.codeSystem != null && !this.codeSystem.isEmpty(); + } + + /** + * @param value {@link #codeSystem} (The code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getCodeSystem" gives direct access to the value + */ + public ConceptMapElementMapComponent setCodeSystemElement(UriType value) { + this.codeSystem = value; + return this; + } + + /** + * @return The code system of the target code (if the target is a value set that cross code systems). + */ + public String getCodeSystem() { + return this.codeSystem == null ? null : this.codeSystem.getValue(); + } + + /** + * @param value The code system of the target code (if the target is a value set that cross code systems). + */ + public ConceptMapElementMapComponent setCodeSystem(String value) { + if (Utilities.noString(value)) + this.codeSystem = null; + else { + if (this.codeSystem == null) + this.codeSystem = new UriType(); + this.codeSystem.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptMapElementMapComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Identity (code or path) or the element/item that the map refers to. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Identity (code or path) or the element/item that the map refers to. + */ + public ConceptMapElementMapComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #equivalence} (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.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value + */ + public Enumeration getEquivalenceElement() { + if (this.equivalence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.equivalence"); + else if (Configuration.doAutoCreate()) + this.equivalence = new Enumeration(); + return this.equivalence; + } + + public boolean hasEquivalenceElement() { + return this.equivalence != null && !this.equivalence.isEmpty(); + } + + public boolean hasEquivalence() { + return this.equivalence != null && !this.equivalence.isEmpty(); + } + + /** + * @param value {@link #equivalence} (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.). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value + */ + public ConceptMapElementMapComponent setEquivalenceElement(Enumeration value) { + this.equivalence = value; + return this; + } + + /** + * @return 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. + */ + public ConceptEquivalence getEquivalence() { + return this.equivalence == null ? null : this.equivalence.getValue(); + } + + /** + * @param value 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. + */ + public ConceptMapElementMapComponent setEquivalence(ConceptEquivalence value) { + if (this.equivalence == null) + this.equivalence = new Enumeration(ConceptEquivalence.ENUM_FACTORY); + this.equivalence.setValue(value); + return this; + } + + /** + * @return {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMapElementMapComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ConceptMapElementMapComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value A description of status/issues in mapping that conveys additional information not represented in the structured data. + */ + public ConceptMapElementMapComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) + */ + public List getProduct() { + if (this.product == null) + this.product = new ArrayList(); + return this.product; + } + + public boolean hasProduct() { + if (this.product == null) + return false; + for (OtherElementComponent item : this.product) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.) + */ + // syntactic sugar + public OtherElementComponent addProduct() { //3 + OtherElementComponent t = new OtherElementComponent(); + if (this.product == null) + this.product = new ArrayList(); + this.product.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeSystem", "uri", "The code system of the target code (if the target is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); + childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item that the map refers to.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("equivalence", "code", "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.", 0, java.lang.Integer.MAX_VALUE, equivalence)); + childrenList.add(new Property("comments", "string", "A description of status/issues in mapping that conveys additional information not represented in the structured data.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("product", "@ConceptMap.element.dependsOn", "A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.", 0, java.lang.Integer.MAX_VALUE, product)); + } + + public ConceptMapElementMapComponent copy() { + ConceptMapElementMapComponent dst = new ConceptMapElementMapComponent(); + copyValues(dst); + dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); + dst.code = code == null ? null : code.copy(); + dst.equivalence = equivalence == null ? null : equivalence.copy(); + dst.comments = comments == null ? null : comments.copy(); + if (product != null) { + dst.product = new ArrayList(); + for (OtherElementComponent i : product) + dst.product.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()) && (code == null || code.isEmpty()) + && (equivalence == null || equivalence.isEmpty()) && (comments == null || comments.isEmpty()) + && (product == null || product.isEmpty()); + } + + } + + /** + * The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + @Child(name="identifier", type={StringType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Logical id to reference this concept map", formalDefinition="The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) + protected StringType identifier; + + /** + * The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the concept map", formalDefinition="The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name describing the concept map. + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Informal name for this concept map", formalDefinition="A free text natural language name describing the concept map." ) + protected StringType name; + + /** + * The name of the individual or organization that published the concept map. + */ + @Child(name="publisher", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the concept map." ) + protected StringType publisher; + + /** + * Contacts of the publisher to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contacts of the publisher to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human language description of the concept map", formalDefinition="A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc." ) + protected StringType description; + + /** + * A copyright statement relating to the concept map and/or its contents. + */ + @Child(name="copyright", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="About the concept map or its content", formalDefinition="A copyright statement relating to the concept map and/or its contents." ) + protected StringType copyright; + + /** + * The status of the concept map. + */ + @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the concept map." ) + protected Enumeration status; + + /** + * This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name="experimental", type={BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that the concept map status was last changed. + */ + @Child(name="date", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the concept map status was last changed." ) + protected DateTimeType date; + + /** + * The source value set that specifies the concepts that are being mapped. + */ + @Child(name="source", type={UriType.class, ValueSet.class, Profile.class}, order=9, min=1, max=1) + @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) + protected Type source; + + /** + * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. + */ + @Child(name="target", type={UriType.class, ValueSet.class, Profile.class}, order=10, min=1, max=1) + @Description(shortDefinition="Provides context to the mappings", formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made." ) + protected Type target; + + /** + * Mappings for an individual concept in the source to one or more concepts in the target. + */ + @Child(name="element", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Mappings for a concept from the source set", formalDefinition="Mappings for an individual concept in the source to one or more concepts in the target." ) + protected List element; + + private static final long serialVersionUID = 1130142902L; + + public ConceptMap() { + super(); + } + + public ConceptMap(Enumeration status, Type source, Type target) { + super(); + this.status = status; + this.source = source; + this.target = target; + } + + /** + * @return {@link #identifier} (The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ConceptMap setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public ConceptMap setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConceptMap setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public ConceptMap setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConceptMap setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the concept map. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the concept map. + */ + public ConceptMap setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ConceptMap setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the concept map. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the concept map. + */ + public ConceptMap setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). 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 ConceptMap.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} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConceptMap setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + */ + public ConceptMap setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ConceptMap setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the concept map and/or its contents. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the concept map and/or its contents. + */ + public ConceptMap setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ConceptMap setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the concept map. + */ + public ValuesetStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the concept map. + */ + public ConceptMap setStatus(ValuesetStatus value) { + if (this.status == null) + this.status = new Enumeration(ValuesetStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ConceptMap setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null ? false : this.experimental.getValue(); + } + + /** + * @param value This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ConceptMap setExperimental(boolean value) { + if (value == false) + this.experimental = null; + else { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptMap.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the concept map status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ConceptMap setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the concept map status was last changed. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public Type getSource() { + return this.source; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public UriType getSourceUriType() throws Exception { + if (!(this.source instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); + return (UriType) this.source; + } + + /** + * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public Reference getSourceReference() throws Exception { + if (!(this.source instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); + return (Reference) this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source value set that specifies the concepts that are being mapped.) + */ + public ConceptMap setSource(Type value) { + this.source = value; + return this; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public Type getTarget() { + return this.target; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public UriType getTargetUriType() throws Exception { + if (!(this.target instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered"); + return (UriType) this.target; + } + + /** + * @return {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public Reference getTargetReference() throws Exception { + if (!(this.target instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); + return (Reference) this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.) + */ + public ConceptMap setTarget(Type value) { + this.target = value; + return this; + } + + /** + * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ConceptMapElementComponent item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) + */ + // syntactic sugar + public ConceptMapElementComponent addElement() { //3 + ConceptMapElementComponent t = new ConceptMapElementComponent(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "string", "The identifier that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the concept map.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contacts of the publisher to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the concept map and/or its contents.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("status", "code", "The status of the concept map.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that the concept map status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|Profile)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|Profile)", "The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("element", "", "Mappings for an individual concept in the source to one or more concepts in the target.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public ConceptMap copy() { + ConceptMap dst = new ConceptMap(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + if (element != null) { + dst.element = new ArrayList(); + for (ConceptMapElementComponent i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + protected ConceptMap typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (description == null || description.isEmpty()) && (copyright == null || copyright.isEmpty()) + && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) + && (element == null || element.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ConceptMap; + } + + @SearchParamDefinition(name="product", path="ConceptMap.element.map.product.element", description="Reference to element/field/valueset mapping depends on", type="token" ) + public static final String SP_PRODUCT = "product"; + @SearchParamDefinition(name="dependson", path="ConceptMap.element.dependsOn.element", description="Reference to element/field/valueset mapping depends on", type="token" ) + public static final String SP_DEPENDSON = "dependson"; + @SearchParamDefinition(name="system", path="ConceptMap.element.map.codeSystem", description="The system for any destination concepts mapped by this map", type="token" ) + public static final String SP_SYSTEM = "system"; + @SearchParamDefinition(name="source", path="ConceptMap.source[x]", description="The system for any concepts mapped by this concept map", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="status", path="ConceptMap.status", description="Status of the concept map", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="description", path="ConceptMap.description", description="Text search in the description of the concept map", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="name", path="ConceptMap.name", description="Name of the concept map", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="target", path="ConceptMap.target[x]", description="Provides context to the mappings", type="reference" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="date", path="ConceptMap.date", description="The concept map publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="The identifier of the concept map", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="publisher", path="ConceptMap.publisher", description="Name of the publisher of the concept map", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="version", path="ConceptMap.version", description="The version identifier of the concept map", type="token" ) + public static final String SP_VERSION = "version"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java index 563f6d454d0..74c3c7dbdd8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java @@ -20,1621 +20,1621 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. - */ -@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") -public class Condition extends DomainResource { - - public enum ConditionStatus implements FhirEnum { - /** - * This is a tentative diagnosis - still a candidate that is under consideration. - */ - PROVISIONAL, - /** - * The patient is being treated on the basis that this is the condition, but it is still not confirmed. - */ - WORKING, - /** - * There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. - */ - CONFIRMED, - /** - * This condition has been ruled out by diagnostic and clinical evidence. - */ - REFUTED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PROVISIONAL; - if ("working".equals(codeString)) - return WORKING; - if ("confirmed".equals(codeString)) - return CONFIRMED; - if ("refuted".equals(codeString)) - return REFUTED; - throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PROVISIONAL: return "provisional"; - case WORKING: return "working"; - case CONFIRMED: return "confirmed"; - case REFUTED: return "refuted"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROVISIONAL: return ""; - case WORKING: return ""; - case CONFIRMED: return ""; - case REFUTED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROVISIONAL: return "This is a tentative diagnosis - still a candidate that is under consideration."; - case WORKING: return "The patient is being treated on the basis that this is the condition, but it is still not confirmed."; - case CONFIRMED: return "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition."; - case REFUTED: return "This condition has been ruled out by diagnostic and clinical evidence."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROVISIONAL: return "provisional"; - case WORKING: return "working"; - case CONFIRMED: return "confirmed"; - case REFUTED: return "refuted"; - default: return "?"; - } - } - } - - public static class ConditionStatusEnumFactory implements EnumFactory { - public ConditionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("provisional".equals(codeString)) - return ConditionStatus.PROVISIONAL; - if ("working".equals(codeString)) - return ConditionStatus.WORKING; - if ("confirmed".equals(codeString)) - return ConditionStatus.CONFIRMED; - if ("refuted".equals(codeString)) - return ConditionStatus.REFUTED; - throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); - } - public String toCode(ConditionStatus code) throws IllegalArgumentException { - if (code == ConditionStatus.PROVISIONAL) - return "provisional"; - if (code == ConditionStatus.WORKING) - return "working"; - if (code == ConditionStatus.CONFIRMED) - return "confirmed"; - if (code == ConditionStatus.REFUTED) - return "refuted"; - return "?"; - } - } - - @Block() - public static class ConditionStageComponent extends BackboneElement { - /** - * A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. - */ - @Child(name="summary", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Simple summary (disease specific)", formalDefinition="A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific." ) - protected CodeableConcept summary; - - /** - * Reference to a formal record of the evidence on which the staging assessment is based. - */ - @Child(name="assessment", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Formal record of assessment", formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based." ) - protected List assessment; - /** - * The actual objects that are the target of the reference (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - protected List assessmentTarget; - - - private static final long serialVersionUID = -1961530405L; - - public ConditionStageComponent() { - super(); - } - - /** - * @return {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) - */ - public CodeableConcept getSummary() { - if (this.summary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionStageComponent.summary"); - else if (Configuration.doAutoCreate()) - this.summary = new CodeableConcept(); - return this.summary; - } - - public boolean hasSummary() { - return this.summary != null && !this.summary.isEmpty(); - } - - /** - * @param value {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) - */ - public ConditionStageComponent setSummary(CodeableConcept value) { - this.summary = value; - return this; - } - - /** - * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - public List getAssessment() { - if (this.assessment == null) - this.assessment = new ArrayList(); - return this.assessment; - } - - public boolean hasAssessment() { - if (this.assessment == null) - return false; - for (Reference item : this.assessment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - // syntactic sugar - public Reference addAssessment() { //3 - Reference t = new Reference(); - if (this.assessment == null) - this.assessment = new ArrayList(); - this.assessment.add(t); - return t; - } - - /** - * @return {@link #assessment} (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. Reference to a formal record of the evidence on which the staging assessment is based.) - */ - public List getAssessmentTarget() { - if (this.assessmentTarget == null) - this.assessmentTarget = new ArrayList(); - return this.assessmentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("summary", "CodeableConcept", "A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific.", 0, java.lang.Integer.MAX_VALUE, summary)); - childrenList.add(new Property("assessment", "Reference(Any)", "Reference to a formal record of the evidence on which the staging assessment is based.", 0, java.lang.Integer.MAX_VALUE, assessment)); - } - - public ConditionStageComponent copy() { - ConditionStageComponent dst = new ConditionStageComponent(); - copyValues(dst); - dst.summary = summary == null ? null : summary.copy(); - if (assessment != null) { - dst.assessment = new ArrayList(); - for (Reference i : assessment) - dst.assessment.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (summary == null || summary.isEmpty()) && (assessment == null || assessment.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionEvidenceComponent extends BackboneElement { - /** - * A manifestation or symptom that led to the recording of this condition. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Manifestation/symptom", formalDefinition="A manifestation or symptom that led to the recording of this condition." ) - protected CodeableConcept code; - - /** - * Links to other relevant information, including pathology reports. - */ - @Child(name="detail", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supporting information found elsewhere", formalDefinition="Links to other relevant information, including pathology reports." ) - protected List detail; - /** - * The actual objects that are the target of the reference (Links to other relevant information, including pathology reports.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = 945689926L; - - public ConditionEvidenceComponent() { - super(); - } - - /** - * @return {@link #code} (A manifestation or symptom that led to the recording of this condition.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionEvidenceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A manifestation or symptom that led to the recording of this condition.) - */ - public ConditionEvidenceComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #detail} (Links to other relevant information, including pathology reports.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Links to other relevant information, including pathology reports.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - /** - * @return {@link #detail} (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. Links to other relevant information, including pathology reports.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("detail", "Reference(Any)", "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ConditionEvidenceComponent copy() { - ConditionEvidenceComponent dst = new ConditionEvidenceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionLocationComponent extends BackboneElement { - /** - * Code that identifies the structural location. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Location - may include laterality", formalDefinition="Code that identifies the structural location." ) - protected CodeableConcept code; - - /** - * Detailed anatomical location information. - */ - @Child(name="detail", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Precise location details", formalDefinition="Detailed anatomical location information." ) - protected StringType detail; - - private static final long serialVersionUID = -406205954L; - - public ConditionLocationComponent() { - super(); - } - - /** - * @return {@link #code} (Code that identifies the structural location.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionLocationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies the structural location.) - */ - public ConditionLocationComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #detail} (Detailed anatomical location information.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public StringType getDetailElement() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionLocationComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new StringType(); - return this.detail; - } - - public boolean hasDetailElement() { - return this.detail != null && !this.detail.isEmpty(); - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (Detailed anatomical location information.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public ConditionLocationComponent setDetailElement(StringType value) { - this.detail = value; - return this; - } - - /** - * @return Detailed anatomical location information. - */ - public String getDetail() { - return this.detail == null ? null : this.detail.getValue(); - } - - /** - * @param value Detailed anatomical location information. - */ - public ConditionLocationComponent setDetail(String value) { - if (Utilities.noString(value)) - this.detail = null; - else { - if (this.detail == null) - this.detail = new StringType(); - this.detail.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code that identifies the structural location.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("detail", "string", "Detailed anatomical location information.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ConditionLocationComponent copy() { - ConditionLocationComponent dst = new ConditionLocationComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.detail = detail == null ? null : detail.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionDueToComponent extends BackboneElement { - /** - * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. - */ - @Child(name="codeableConcept", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) - protected CodeableConcept codeableConcept; - - /** - * Target of the relationship. - */ - @Child(name="target", type={Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) - @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Target of the relationship.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = -864422450L; - - public ConditionDueToComponent() { - super(); - } - - /** - * @return {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public CodeableConcept getCodeableConcept() { - if (this.codeableConcept == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionDueToComponent.codeableConcept"); - else if (Configuration.doAutoCreate()) - this.codeableConcept = new CodeableConcept(); - return this.codeableConcept; - } - - public boolean hasCodeableConcept() { - return this.codeableConcept != null && !this.codeableConcept.isEmpty(); - } - - /** - * @param value {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public ConditionDueToComponent setCodeableConcept(CodeableConcept value) { - this.codeableConcept = value; - return this; - } - - /** - * @return {@link #target} (Target of the relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionDueToComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Target of the relationship.) - */ - public ConditionDueToComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Target of the relationship.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @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. (Target of the relationship.) - */ - public ConditionDueToComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeableConcept", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, codeableConcept)); - childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ConditionDueToComponent copy() { - ConditionDueToComponent dst = new ConditionDueToComponent(); - copyValues(dst); - dst.codeableConcept = codeableConcept == null ? null : codeableConcept.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (codeableConcept == null || codeableConcept.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - @Block() - public static class ConditionOccurredFollowingComponent extends BackboneElement { - /** - * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. - */ - @Child(name="codeableConcept", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) - protected CodeableConcept codeableConcept; - - /** - * Target of the relationship. - */ - @Child(name="target", type={Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) - @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Target of the relationship.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = -864422450L; - - public ConditionOccurredFollowingComponent() { - super(); - } - - /** - * @return {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public CodeableConcept getCodeableConcept() { - if (this.codeableConcept == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.codeableConcept"); - else if (Configuration.doAutoCreate()) - this.codeableConcept = new CodeableConcept(); - return this.codeableConcept; - } - - public boolean hasCodeableConcept() { - return this.codeableConcept != null && !this.codeableConcept.isEmpty(); - } - - /** - * @param value {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) - */ - public ConditionOccurredFollowingComponent setCodeableConcept(CodeableConcept value) { - this.codeableConcept = value; - return this; - } - - /** - * @return {@link #target} (Target of the relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Target of the relationship.) - */ - public ConditionOccurredFollowingComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Target of the relationship.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @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. (Target of the relationship.) - */ - public ConditionOccurredFollowingComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeableConcept", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, codeableConcept)); - childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ConditionOccurredFollowingComponent copy() { - ConditionOccurredFollowingComponent dst = new ConditionOccurredFollowingComponent(); - copyValues(dst); - dst.codeableConcept = codeableConcept == null ? null : codeableConcept.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (codeableConcept == null || codeableConcept.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this condition 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 condition", formalDefinition="This records identifiers associated with this condition 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; - - /** - * Indicates the patient who the condition record is associated with. - */ - @Child(name="subject", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Who has the condition?", formalDefinition="Indicates the patient who the condition record is associated with." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Indicates the patient who the condition record is associated with.) - */ - protected Patient subjectTarget; - - /** - * Encounter during which the condition was first asserted. - */ - @Child(name="encounter", type={Encounter.class}, order=1, min=0, max=1) - @Description(shortDefinition="Encounter when condition first asserted", formalDefinition="Encounter during which the condition was first asserted." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Encounter during which the condition was first asserted.) - */ - protected Encounter encounterTarget; - - /** - * Person who takes responsibility for asserting the existence of the condition as part of the electronic record. - */ - @Child(name="asserter", type={Practitioner.class, Patient.class}, order=2, min=0, max=1) - @Description(shortDefinition="Person who asserts this condition", formalDefinition="Person who takes responsibility for asserting the existence of the condition as part of the electronic record." ) - protected Reference asserter; - - /** - * The actual object that is the target of the reference (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - protected Resource asserterTarget; - - /** - * Estimated or actual date the condition/problem/diagnosis was first detected/suspected. - */ - @Child(name="dateAsserted", type={DateType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When first detected/suspected/entered", formalDefinition="Estimated or actual date the condition/problem/diagnosis was first detected/suspected." ) - protected DateType dateAsserted; - - /** - * Identification of the condition, problem or diagnosis. - */ - @Child(name="code", type={CodeableConcept.class}, order=4, min=1, max=1) - @Description(shortDefinition="Identification of the condition, problem or diagnosis", formalDefinition="Identification of the condition, problem or diagnosis." ) - protected CodeableConcept code; - - /** - * A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis. - */ - @Child(name="category", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="E.g. complaint | symptom | finding | diagnosis", formalDefinition="A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis." ) - protected CodeableConcept category; - - /** - * The clinical status of the condition. - */ - @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) - @Description(shortDefinition="provisional | working | confirmed | refuted", formalDefinition="The clinical status of the condition." ) - protected Enumeration status; - - /** - * The degree of confidence that this condition is correct. - */ - @Child(name="certainty", type={CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Degree of confidence", formalDefinition="The degree of confidence that this condition is correct." ) - protected CodeableConcept certainty; - - /** - * A subjective assessment of the severity of the condition as evaluated by the clinician. - */ - @Child(name="severity", type={CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Subjective severity of condition", formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." ) - protected CodeableConcept severity; - - /** - * Estimated or actual date or date-time the condition began, in the opinion of the clinician. - */ - @Child(name="onset", type={DateTimeType.class, Age.class}, order=9, min=0, max=1) - @Description(shortDefinition="Estimated or actual date, date-time, or age", formalDefinition="Estimated or actual date or date-time the condition began, in the opinion of the clinician." ) - protected Type onset; - - /** - * The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. - */ - @Child(name="abatement", type={DateType.class, Age.class, BooleanType.class}, order=10, min=0, max=1) - @Description(shortDefinition="If/when in resolution/remission", formalDefinition="The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate." ) - protected Type abatement; - - /** - * Clinical stage or grade of a condition. May include formal severity assessments. - */ - @Child(name="stage", type={}, order=11, min=0, max=1) - @Description(shortDefinition="Stage/grade, usually assessed formally", formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments." ) - protected ConditionStageComponent stage; - - /** - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. - */ - @Child(name="evidence", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supporting evidence", formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed." ) - protected List evidence; - - /** - * The anatomical location where this condition manifests itself. - */ - @Child(name="location", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where this condition manifests itself." ) - protected List location; - - /** - * Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition. - */ - @Child(name="dueTo", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Causes for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition." ) - protected List dueTo; - - /** - * Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition. - */ - @Child(name="occurredFollowing", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Precedent for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition." ) - protected List occurredFollowing; - - /** - * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - @Child(name="notes", type={StringType.class}, order=16, min=0, max=1) - @Description(shortDefinition="Additional information about the Condition", formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis." ) - protected StringType notes; - - private static final long serialVersionUID = -771013294L; - - public Condition() { - super(); - } - - public Condition(Reference subject, CodeableConcept code, Enumeration status) { - super(); - this.subject = subject; - this.code = code; - this.status = status; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this condition 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 condition 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #subject} (Indicates the patient who the condition record is associated with.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.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} (Indicates the patient who the condition record is associated with.) - */ - public Condition 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. (Indicates the patient who the condition record is associated with.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.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. (Indicates the patient who the condition record is associated with.) - */ - public Condition setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #encounter} (Encounter during which the condition was first asserted.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.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} (Encounter during which the condition was first asserted.) - */ - public Condition 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. (Encounter during which the condition was first asserted.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.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. (Encounter during which the condition was first asserted.) - */ - public Condition setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Reference getAsserter() { - if (this.asserter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.asserter"); - else if (Configuration.doAutoCreate()) - this.asserter = new Reference(); - return this.asserter; - } - - public boolean hasAsserter() { - return this.asserter != null && !this.asserter.isEmpty(); - } - - /** - * @param value {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Condition setAsserter(Reference value) { - this.asserter = value; - return this; - } - - /** - * @return {@link #asserter} 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. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Resource getAsserterTarget() { - return this.asserterTarget; - } - - /** - * @param value {@link #asserter} 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. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) - */ - public Condition setAsserterTarget(Resource value) { - this.asserterTarget = value; - return this; - } - - /** - * @return {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public DateType getDateAssertedElement() { - if (this.dateAsserted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.dateAsserted"); - else if (Configuration.doAutoCreate()) - this.dateAsserted = new DateType(); - return this.dateAsserted; - } - - public boolean hasDateAssertedElement() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - public boolean hasDateAsserted() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - /** - * @param value {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public Condition setDateAssertedElement(DateType value) { - this.dateAsserted = value; - return this; - } - - /** - * @return Estimated or actual date the condition/problem/diagnosis was first detected/suspected. - */ - 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(Date value) { - if (value == null) - this.dateAsserted = null; - else { - if (this.dateAsserted == null) - this.dateAsserted = new DateType(); - this.dateAsserted.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identification of the condition, problem or diagnosis.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identification of the condition, problem or diagnosis.) - */ - public Condition setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #category} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.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} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) - */ - public Condition setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #status} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Condition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The clinical status of the condition. - */ - public ConditionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The clinical status of the condition. - */ - public Condition setStatus(ConditionStatus value) { - if (this.status == null) - this.status = new Enumeration(ConditionStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #certainty} (The degree of confidence that this condition is correct.) - */ - public CodeableConcept getCertainty() { - if (this.certainty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.certainty"); - else if (Configuration.doAutoCreate()) - this.certainty = new CodeableConcept(); - return this.certainty; - } - - public boolean hasCertainty() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - /** - * @param value {@link #certainty} (The degree of confidence that this condition is correct.) - */ - public Condition setCertainty(CodeableConcept value) { - this.certainty = value; - return this; - } - - /** - * @return {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) - */ - public CodeableConcept getSeverity() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new CodeableConcept(); - return this.severity; - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) - */ - public Condition setSeverity(CodeableConcept value) { - this.severity = value; - return this; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Type getOnset() { - return this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public DateTimeType getOnsetDateTimeType() throws Exception { - if (!(this.onset instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (DateTimeType) this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Age getOnsetAge() throws Exception { - if (!(this.onset instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Age) this.onset; - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Condition setOnset(Type value) { - this.onset = value; - return this; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Type getAbatement() { - return this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public DateType getAbatementDateType() throws Exception { - if (!(this.abatement instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (DateType) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Age getAbatementAge() throws Exception { - if (!(this.abatement instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Age) this.abatement; - } - - /** - * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public BooleanType getAbatementBooleanType() throws Exception { - if (!(this.abatement instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (BooleanType) this.abatement; - } - - public boolean hasAbatement() { - return this.abatement != null && !this.abatement.isEmpty(); - } - - /** - * @param value {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) - */ - public Condition setAbatement(Type value) { - this.abatement = value; - return this; - } - - /** - * @return {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) - */ - public ConditionStageComponent getStage() { - if (this.stage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.stage"); - else if (Configuration.doAutoCreate()) - this.stage = new ConditionStageComponent(); - return this.stage; - } - - public boolean hasStage() { - return this.stage != null && !this.stage.isEmpty(); - } - - /** - * @param value {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) - */ - public Condition setStage(ConditionStageComponent value) { - this.stage = value; - return this; - } - - /** - * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) - */ - public List getEvidence() { - if (this.evidence == null) - this.evidence = new ArrayList(); - return this.evidence; - } - - public boolean hasEvidence() { - if (this.evidence == null) - return false; - for (ConditionEvidenceComponent item : this.evidence) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) - */ - // syntactic sugar - public ConditionEvidenceComponent addEvidence() { //3 - ConditionEvidenceComponent t = new ConditionEvidenceComponent(); - if (this.evidence == null) - this.evidence = new ArrayList(); - this.evidence.add(t); - return t; - } - - /** - * @return {@link #location} (The anatomical location where this condition manifests itself.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (ConditionLocationComponent item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The anatomical location where this condition manifests itself.) - */ - // syntactic sugar - public ConditionLocationComponent addLocation() { //3 - ConditionLocationComponent t = new ConditionLocationComponent(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) - */ - public List getDueTo() { - if (this.dueTo == null) - this.dueTo = new ArrayList(); - return this.dueTo; - } - - public boolean hasDueTo() { - if (this.dueTo == null) - return false; - for (ConditionDueToComponent item : this.dueTo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) - */ - // syntactic sugar - public ConditionDueToComponent addDueTo() { //3 - ConditionDueToComponent t = new ConditionDueToComponent(); - if (this.dueTo == null) - this.dueTo = new ArrayList(); - this.dueTo.add(t); - return t; - } - - /** - * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) - */ - public List getOccurredFollowing() { - if (this.occurredFollowing == null) - this.occurredFollowing = new ArrayList(); - return this.occurredFollowing; - } - - public boolean hasOccurredFollowing() { - if (this.occurredFollowing == null) - return false; - for (ConditionOccurredFollowingComponent item : this.occurredFollowing) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) - */ - // syntactic sugar - public ConditionOccurredFollowingComponent addOccurredFollowing() { //3 - ConditionOccurredFollowingComponent t = new ConditionOccurredFollowingComponent(); - if (this.occurredFollowing == null) - this.occurredFollowing = new ArrayList(); - this.occurredFollowing.add(t); - return t; - } - - /** - * @return {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). 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 Condition.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} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public Condition setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - public Condition 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; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this condition 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("subject", "Reference(Patient)", "Indicates the patient who the condition record is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Person who takes responsibility for asserting the existence of the condition as part of the electronic record.", 0, java.lang.Integer.MAX_VALUE, asserter)); - childrenList.add(new Property("dateAsserted", "date", "Estimated or actual date the condition/problem/diagnosis was first detected/suspected.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); - childrenList.add(new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("category", "CodeableConcept", "A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("status", "code", "The clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("certainty", "CodeableConcept", "The degree of confidence that this condition is correct.", 0, java.lang.Integer.MAX_VALUE, certainty)); - childrenList.add(new Property("severity", "CodeableConcept", "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("onset[x]", "dateTime|Age", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("abatement[x]", "date|Age|boolean", "The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate.", 0, java.lang.Integer.MAX_VALUE, abatement)); - childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); - childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); - childrenList.add(new Property("location", "", "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("dueTo", "", "Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.", 0, java.lang.Integer.MAX_VALUE, dueTo)); - childrenList.add(new Property("occurredFollowing", "", "Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.", 0, java.lang.Integer.MAX_VALUE, occurredFollowing)); - childrenList.add(new Property("notes", "string", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - public Condition copy() { - Condition dst = new Condition(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.asserter = asserter == null ? null : asserter.copy(); - dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); - dst.code = code == null ? null : code.copy(); - dst.category = category == null ? null : category.copy(); - dst.status = status == null ? null : status.copy(); - dst.certainty = certainty == null ? null : certainty.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.abatement = abatement == null ? null : abatement.copy(); - dst.stage = stage == null ? null : stage.copy(); - if (evidence != null) { - dst.evidence = new ArrayList(); - for (ConditionEvidenceComponent i : evidence) - dst.evidence.add(i.copy()); - }; - if (location != null) { - dst.location = new ArrayList(); - for (ConditionLocationComponent i : location) - dst.location.add(i.copy()); - }; - if (dueTo != null) { - dst.dueTo = new ArrayList(); - for (ConditionDueToComponent i : dueTo) - dst.dueTo.add(i.copy()); - }; - if (occurredFollowing != null) { - dst.occurredFollowing = new ArrayList(); - for (ConditionOccurredFollowingComponent i : occurredFollowing) - dst.occurredFollowing.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - protected Condition typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (asserter == null || asserter.isEmpty()) - && (dateAsserted == null || dateAsserted.isEmpty()) && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) - && (status == null || status.isEmpty()) && (certainty == null || certainty.isEmpty()) && (severity == null || severity.isEmpty()) - && (onset == null || onset.isEmpty()) && (abatement == null || abatement.isEmpty()) && (stage == null || stage.isEmpty()) - && (evidence == null || evidence.isEmpty()) && (location == null || location.isEmpty()) && (dueTo == null || dueTo.isEmpty()) - && (occurredFollowing == null || occurredFollowing.isEmpty()) && (notes == null || notes.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Condition; - } - - @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference" ) - public static final String SP_ASSERTER = "asserter"; - @SearchParamDefinition(name="following-code", path="Condition.occurredFollowing.codeableConcept", description="Relationship target by means of a predefined code", type="token" ) - public static final String SP_FOLLOWINGCODE = "following-code"; - @SearchParamDefinition(name="dueto-code", path="Condition.dueTo.codeableConcept", description="Relationship target by means of a predefined code", type="token" ) - public static final String SP_DUETOCODE = "dueto-code"; - @SearchParamDefinition(name="status", path="Condition.status", description="The status of the condition", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="location", path="Condition.location.code", description="Location - may include laterality", type="token" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="subject", path="Condition.subject", description="Who has the condition?", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="onset", path="Condition.onset[x]", description="When the Condition started (if started on a date)", type="date" ) - public static final String SP_ONSET = "onset"; - @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="Manifestation/symptom", type="token" ) - public static final String SP_EVIDENCE = "evidence"; - @SearchParamDefinition(name="following-item", path="Condition.occurredFollowing.target", description="Relationship target resource", type="reference" ) - public static final String SP_FOLLOWINGITEM = "following-item"; - @SearchParamDefinition(name="severity", path="Condition.severity", description="The severity of the condition", type="token" ) - public static final String SP_SEVERITY = "severity"; - @SearchParamDefinition(name="code", path="Condition.code", description="Code for the condition", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="encounter", path="Condition.encounter", description="Encounter when condition first asserted", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="date-asserted", path="Condition.dateAsserted", description="When first detected/suspected/entered", type="date" ) - public static final String SP_DATEASSERTED = "date-asserted"; - @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="Simple summary (disease specific)", type="token" ) - public static final String SP_STAGE = "stage"; - @SearchParamDefinition(name="category", path="Condition.category", description="The category of the condition", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="patient", path="Condition.subject", description="Who has the condition?", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="dueto-item", path="Condition.dueTo.target", description="Relationship target resource", type="reference" ) - public static final String SP_DUETOITEM = "dueto-item"; - -} - + +/* + 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; +/** + * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + */ +@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") +public class Condition extends DomainResource { + + public enum ConditionStatus implements FhirEnum { + /** + * This is a tentative diagnosis - still a candidate that is under consideration. + */ + PROVISIONAL, + /** + * The patient is being treated on the basis that this is the condition, but it is still not confirmed. + */ + WORKING, + /** + * There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. + */ + CONFIRMED, + /** + * This condition has been ruled out by diagnostic and clinical evidence. + */ + REFUTED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PROVISIONAL; + if ("working".equals(codeString)) + return WORKING; + if ("confirmed".equals(codeString)) + return CONFIRMED; + if ("refuted".equals(codeString)) + return REFUTED; + throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PROVISIONAL: return "provisional"; + case WORKING: return "working"; + case CONFIRMED: return "confirmed"; + case REFUTED: return "refuted"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROVISIONAL: return ""; + case WORKING: return ""; + case CONFIRMED: return ""; + case REFUTED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROVISIONAL: return "This is a tentative diagnosis - still a candidate that is under consideration."; + case WORKING: return "The patient is being treated on the basis that this is the condition, but it is still not confirmed."; + case CONFIRMED: return "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition."; + case REFUTED: return "This condition has been ruled out by diagnostic and clinical evidence."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROVISIONAL: return "provisional"; + case WORKING: return "working"; + case CONFIRMED: return "confirmed"; + case REFUTED: return "refuted"; + default: return "?"; + } + } + } + + public static class ConditionStatusEnumFactory implements EnumFactory { + public ConditionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("provisional".equals(codeString)) + return ConditionStatus.PROVISIONAL; + if ("working".equals(codeString)) + return ConditionStatus.WORKING; + if ("confirmed".equals(codeString)) + return ConditionStatus.CONFIRMED; + if ("refuted".equals(codeString)) + return ConditionStatus.REFUTED; + throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); + } + public String toCode(ConditionStatus code) throws IllegalArgumentException { + if (code == ConditionStatus.PROVISIONAL) + return "provisional"; + if (code == ConditionStatus.WORKING) + return "working"; + if (code == ConditionStatus.CONFIRMED) + return "confirmed"; + if (code == ConditionStatus.REFUTED) + return "refuted"; + return "?"; + } + } + + @Block() + public static class ConditionStageComponent extends BackboneElement { + /** + * A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. + */ + @Child(name="summary", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Simple summary (disease specific)", formalDefinition="A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific." ) + protected CodeableConcept summary; + + /** + * Reference to a formal record of the evidence on which the staging assessment is based. + */ + @Child(name="assessment", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Formal record of assessment", formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based." ) + protected List assessment; + /** + * The actual objects that are the target of the reference (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + protected List assessmentTarget; + + + private static final long serialVersionUID = -1961530405L; + + public ConditionStageComponent() { + super(); + } + + /** + * @return {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) + */ + public CodeableConcept getSummary() { + if (this.summary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionStageComponent.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new CodeableConcept(); + return this.summary; + } + + public boolean hasSummary() { + return this.summary != null && !this.summary.isEmpty(); + } + + /** + * @param value {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) + */ + public ConditionStageComponent setSummary(CodeableConcept value) { + this.summary = value; + return this; + } + + /** + * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + public List getAssessment() { + if (this.assessment == null) + this.assessment = new ArrayList(); + return this.assessment; + } + + public boolean hasAssessment() { + if (this.assessment == null) + return false; + for (Reference item : this.assessment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) + */ + // syntactic sugar + public Reference addAssessment() { //3 + Reference t = new Reference(); + if (this.assessment == null) + this.assessment = new ArrayList(); + this.assessment.add(t); + return t; + } + + /** + * @return {@link #assessment} (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. Reference to a formal record of the evidence on which the staging assessment is based.) + */ + public List getAssessmentTarget() { + if (this.assessmentTarget == null) + this.assessmentTarget = new ArrayList(); + return this.assessmentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("summary", "CodeableConcept", "A simple summary of the stage such as 'Stage 3'. The determination of the stage is disease-specific.", 0, java.lang.Integer.MAX_VALUE, summary)); + childrenList.add(new Property("assessment", "Reference(Any)", "Reference to a formal record of the evidence on which the staging assessment is based.", 0, java.lang.Integer.MAX_VALUE, assessment)); + } + + public ConditionStageComponent copy() { + ConditionStageComponent dst = new ConditionStageComponent(); + copyValues(dst); + dst.summary = summary == null ? null : summary.copy(); + if (assessment != null) { + dst.assessment = new ArrayList(); + for (Reference i : assessment) + dst.assessment.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (summary == null || summary.isEmpty()) && (assessment == null || assessment.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionEvidenceComponent extends BackboneElement { + /** + * A manifestation or symptom that led to the recording of this condition. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Manifestation/symptom", formalDefinition="A manifestation or symptom that led to the recording of this condition." ) + protected CodeableConcept code; + + /** + * Links to other relevant information, including pathology reports. + */ + @Child(name="detail", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supporting information found elsewhere", formalDefinition="Links to other relevant information, including pathology reports." ) + protected List detail; + /** + * The actual objects that are the target of the reference (Links to other relevant information, including pathology reports.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = 945689926L; + + public ConditionEvidenceComponent() { + super(); + } + + /** + * @return {@link #code} (A manifestation or symptom that led to the recording of this condition.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionEvidenceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A manifestation or symptom that led to the recording of this condition.) + */ + public ConditionEvidenceComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #detail} (Links to other relevant information, including pathology reports.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Links to other relevant information, including pathology reports.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + /** + * @return {@link #detail} (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. Links to other relevant information, including pathology reports.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("detail", "Reference(Any)", "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ConditionEvidenceComponent copy() { + ConditionEvidenceComponent dst = new ConditionEvidenceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionLocationComponent extends BackboneElement { + /** + * Code that identifies the structural location. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Location - may include laterality", formalDefinition="Code that identifies the structural location." ) + protected CodeableConcept code; + + /** + * Detailed anatomical location information. + */ + @Child(name="detail", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Precise location details", formalDefinition="Detailed anatomical location information." ) + protected StringType detail; + + private static final long serialVersionUID = -406205954L; + + public ConditionLocationComponent() { + super(); + } + + /** + * @return {@link #code} (Code that identifies the structural location.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionLocationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies the structural location.) + */ + public ConditionLocationComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #detail} (Detailed anatomical location information.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public StringType getDetailElement() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionLocationComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new StringType(); + return this.detail; + } + + public boolean hasDetailElement() { + return this.detail != null && !this.detail.isEmpty(); + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (Detailed anatomical location information.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public ConditionLocationComponent setDetailElement(StringType value) { + this.detail = value; + return this; + } + + /** + * @return Detailed anatomical location information. + */ + public String getDetail() { + return this.detail == null ? null : this.detail.getValue(); + } + + /** + * @param value Detailed anatomical location information. + */ + public ConditionLocationComponent setDetail(String value) { + if (Utilities.noString(value)) + this.detail = null; + else { + if (this.detail == null) + this.detail = new StringType(); + this.detail.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code that identifies the structural location.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("detail", "string", "Detailed anatomical location information.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ConditionLocationComponent copy() { + ConditionLocationComponent dst = new ConditionLocationComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.detail = detail == null ? null : detail.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionDueToComponent extends BackboneElement { + /** + * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. + */ + @Child(name="codeableConcept", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) + protected CodeableConcept codeableConcept; + + /** + * Target of the relationship. + */ + @Child(name="target", type={Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) + @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Target of the relationship.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = -864422450L; + + public ConditionDueToComponent() { + super(); + } + + /** + * @return {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public CodeableConcept getCodeableConcept() { + if (this.codeableConcept == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionDueToComponent.codeableConcept"); + else if (Configuration.doAutoCreate()) + this.codeableConcept = new CodeableConcept(); + return this.codeableConcept; + } + + public boolean hasCodeableConcept() { + return this.codeableConcept != null && !this.codeableConcept.isEmpty(); + } + + /** + * @param value {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public ConditionDueToComponent setCodeableConcept(CodeableConcept value) { + this.codeableConcept = value; + return this; + } + + /** + * @return {@link #target} (Target of the relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionDueToComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Target of the relationship.) + */ + public ConditionDueToComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Target of the relationship.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @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. (Target of the relationship.) + */ + public ConditionDueToComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeableConcept", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, codeableConcept)); + childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ConditionDueToComponent copy() { + ConditionDueToComponent dst = new ConditionDueToComponent(); + copyValues(dst); + dst.codeableConcept = codeableConcept == null ? null : codeableConcept.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (codeableConcept == null || codeableConcept.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class ConditionOccurredFollowingComponent extends BackboneElement { + /** + * Code that identifies the target of this relationship. The code takes the place of a detailed instance target. + */ + @Child(name="codeableConcept", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Relationship target by means of a predefined code", formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target." ) + protected CodeableConcept codeableConcept; + + /** + * Target of the relationship. + */ + @Child(name="target", type={Condition.class, Procedure.class, MedicationAdministration.class, Immunization.class, MedicationStatement.class}, order=2, min=0, max=1) + @Description(shortDefinition="Relationship target resource", formalDefinition="Target of the relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Target of the relationship.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = -864422450L; + + public ConditionOccurredFollowingComponent() { + super(); + } + + /** + * @return {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public CodeableConcept getCodeableConcept() { + if (this.codeableConcept == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.codeableConcept"); + else if (Configuration.doAutoCreate()) + this.codeableConcept = new CodeableConcept(); + return this.codeableConcept; + } + + public boolean hasCodeableConcept() { + return this.codeableConcept != null && !this.codeableConcept.isEmpty(); + } + + /** + * @param value {@link #codeableConcept} (Code that identifies the target of this relationship. The code takes the place of a detailed instance target.) + */ + public ConditionOccurredFollowingComponent setCodeableConcept(CodeableConcept value) { + this.codeableConcept = value; + return this; + } + + /** + * @return {@link #target} (Target of the relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConditionOccurredFollowingComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Target of the relationship.) + */ + public ConditionOccurredFollowingComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Target of the relationship.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @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. (Target of the relationship.) + */ + public ConditionOccurredFollowingComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("codeableConcept", "CodeableConcept", "Code that identifies the target of this relationship. The code takes the place of a detailed instance target.", 0, java.lang.Integer.MAX_VALUE, codeableConcept)); + childrenList.add(new Property("target", "Reference(Condition|Procedure|MedicationAdministration|Immunization|MedicationStatement)", "Target of the relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ConditionOccurredFollowingComponent copy() { + ConditionOccurredFollowingComponent dst = new ConditionOccurredFollowingComponent(); + copyValues(dst); + dst.codeableConcept = codeableConcept == null ? null : codeableConcept.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (codeableConcept == null || codeableConcept.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this condition 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 condition", formalDefinition="This records identifiers associated with this condition 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; + + /** + * Indicates the patient who the condition record is associated with. + */ + @Child(name="subject", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Who has the condition?", formalDefinition="Indicates the patient who the condition record is associated with." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Indicates the patient who the condition record is associated with.) + */ + protected Patient subjectTarget; + + /** + * Encounter during which the condition was first asserted. + */ + @Child(name="encounter", type={Encounter.class}, order=1, min=0, max=1) + @Description(shortDefinition="Encounter when condition first asserted", formalDefinition="Encounter during which the condition was first asserted." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Encounter during which the condition was first asserted.) + */ + protected Encounter encounterTarget; + + /** + * Person who takes responsibility for asserting the existence of the condition as part of the electronic record. + */ + @Child(name="asserter", type={Practitioner.class, Patient.class}, order=2, min=0, max=1) + @Description(shortDefinition="Person who asserts this condition", formalDefinition="Person who takes responsibility for asserting the existence of the condition as part of the electronic record." ) + protected Reference asserter; + + /** + * The actual object that is the target of the reference (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + protected Resource asserterTarget; + + /** + * Estimated or actual date the condition/problem/diagnosis was first detected/suspected. + */ + @Child(name="dateAsserted", type={DateType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When first detected/suspected/entered", formalDefinition="Estimated or actual date the condition/problem/diagnosis was first detected/suspected." ) + protected DateType dateAsserted; + + /** + * Identification of the condition, problem or diagnosis. + */ + @Child(name="code", type={CodeableConcept.class}, order=4, min=1, max=1) + @Description(shortDefinition="Identification of the condition, problem or diagnosis", formalDefinition="Identification of the condition, problem or diagnosis." ) + protected CodeableConcept code; + + /** + * A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis. + */ + @Child(name="category", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="E.g. complaint | symptom | finding | diagnosis", formalDefinition="A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis." ) + protected CodeableConcept category; + + /** + * The clinical status of the condition. + */ + @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) + @Description(shortDefinition="provisional | working | confirmed | refuted", formalDefinition="The clinical status of the condition." ) + protected Enumeration status; + + /** + * The degree of confidence that this condition is correct. + */ + @Child(name="certainty", type={CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Degree of confidence", formalDefinition="The degree of confidence that this condition is correct." ) + protected CodeableConcept certainty; + + /** + * A subjective assessment of the severity of the condition as evaluated by the clinician. + */ + @Child(name="severity", type={CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Subjective severity of condition", formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." ) + protected CodeableConcept severity; + + /** + * Estimated or actual date or date-time the condition began, in the opinion of the clinician. + */ + @Child(name="onset", type={DateTimeType.class, Age.class}, order=9, min=0, max=1) + @Description(shortDefinition="Estimated or actual date, date-time, or age", formalDefinition="Estimated or actual date or date-time the condition began, in the opinion of the clinician." ) + protected Type onset; + + /** + * The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. + */ + @Child(name="abatement", type={DateType.class, Age.class, BooleanType.class}, order=10, min=0, max=1) + @Description(shortDefinition="If/when in resolution/remission", formalDefinition="The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate." ) + protected Type abatement; + + /** + * Clinical stage or grade of a condition. May include formal severity assessments. + */ + @Child(name="stage", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Stage/grade, usually assessed formally", formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments." ) + protected ConditionStageComponent stage; + + /** + * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. + */ + @Child(name="evidence", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supporting evidence", formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed." ) + protected List evidence; + + /** + * The anatomical location where this condition manifests itself. + */ + @Child(name="location", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where this condition manifests itself." ) + protected List location; + + /** + * Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition. + */ + @Child(name="dueTo", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Causes for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition." ) + protected List dueTo; + + /** + * Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition. + */ + @Child(name="occurredFollowing", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Precedent for this Condition", formalDefinition="Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition." ) + protected List occurredFollowing; + + /** + * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + @Child(name="notes", type={StringType.class}, order=16, min=0, max=1) + @Description(shortDefinition="Additional information about the Condition", formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis." ) + protected StringType notes; + + private static final long serialVersionUID = -771013294L; + + public Condition() { + super(); + } + + public Condition(Reference subject, CodeableConcept code, Enumeration status) { + super(); + this.subject = subject; + this.code = code; + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this condition 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 condition 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #subject} (Indicates the patient who the condition record is associated with.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.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} (Indicates the patient who the condition record is associated with.) + */ + public Condition 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. (Indicates the patient who the condition record is associated with.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.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. (Indicates the patient who the condition record is associated with.) + */ + public Condition setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #encounter} (Encounter during which the condition was first asserted.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.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} (Encounter during which the condition was first asserted.) + */ + public Condition 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. (Encounter during which the condition was first asserted.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.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. (Encounter during which the condition was first asserted.) + */ + public Condition setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Reference getAsserter() { + if (this.asserter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.asserter"); + else if (Configuration.doAutoCreate()) + this.asserter = new Reference(); + return this.asserter; + } + + public boolean hasAsserter() { + return this.asserter != null && !this.asserter.isEmpty(); + } + + /** + * @param value {@link #asserter} (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Condition setAsserter(Reference value) { + this.asserter = value; + return this; + } + + /** + * @return {@link #asserter} 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. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Resource getAsserterTarget() { + return this.asserterTarget; + } + + /** + * @param value {@link #asserter} 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. (Person who takes responsibility for asserting the existence of the condition as part of the electronic record.) + */ + public Condition setAsserterTarget(Resource value) { + this.asserterTarget = value; + return this; + } + + /** + * @return {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public DateType getDateAssertedElement() { + if (this.dateAsserted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.dateAsserted"); + else if (Configuration.doAutoCreate()) + this.dateAsserted = new DateType(); + return this.dateAsserted; + } + + public boolean hasDateAssertedElement() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + public boolean hasDateAsserted() { + return this.dateAsserted != null && !this.dateAsserted.isEmpty(); + } + + /** + * @param value {@link #dateAsserted} (Estimated or actual date the condition/problem/diagnosis was first detected/suspected.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value + */ + public Condition setDateAssertedElement(DateType value) { + this.dateAsserted = value; + return this; + } + + /** + * @return Estimated or actual date the condition/problem/diagnosis was first detected/suspected. + */ + 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(Date value) { + if (value == null) + this.dateAsserted = null; + else { + if (this.dateAsserted == null) + this.dateAsserted = new DateType(); + this.dateAsserted.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Identification of the condition, problem or diagnosis.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identification of the condition, problem or diagnosis.) + */ + public Condition setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.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} (A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.) + */ + public Condition setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #status} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Condition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The clinical status of the condition. + */ + public ConditionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The clinical status of the condition. + */ + public Condition setStatus(ConditionStatus value) { + if (this.status == null) + this.status = new Enumeration(ConditionStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #certainty} (The degree of confidence that this condition is correct.) + */ + public CodeableConcept getCertainty() { + if (this.certainty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.certainty"); + else if (Configuration.doAutoCreate()) + this.certainty = new CodeableConcept(); + return this.certainty; + } + + public boolean hasCertainty() { + return this.certainty != null && !this.certainty.isEmpty(); + } + + /** + * @param value {@link #certainty} (The degree of confidence that this condition is correct.) + */ + public Condition setCertainty(CodeableConcept value) { + this.certainty = value; + return this; + } + + /** + * @return {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) + */ + public CodeableConcept getSeverity() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new CodeableConcept(); + return this.severity; + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) + */ + public Condition setSeverity(CodeableConcept value) { + this.severity = value; + return this; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Type getOnset() { + return this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public DateTimeType getOnsetDateTimeType() throws Exception { + if (!(this.onset instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (DateTimeType) this.onset; + } + + /** + * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Age getOnsetAge() throws Exception { + if (!(this.onset instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) + */ + public Condition setOnset(Type value) { + this.onset = value; + return this; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Type getAbatement() { + return this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public DateType getAbatementDateType() throws Exception { + if (!(this.abatement instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (DateType) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Age getAbatementAge() throws Exception { + if (!(this.abatement instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (Age) this.abatement; + } + + /** + * @return {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public BooleanType getAbatementBooleanType() throws Exception { + if (!(this.abatement instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.abatement.getClass().getName()+" was encountered"); + return (BooleanType) this.abatement; + } + + public boolean hasAbatement() { + return this.abatement != null && !this.abatement.isEmpty(); + } + + /** + * @param value {@link #abatement} (The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.) + */ + public Condition setAbatement(Type value) { + this.abatement = value; + return this; + } + + /** + * @return {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) + */ + public ConditionStageComponent getStage() { + if (this.stage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Condition.stage"); + else if (Configuration.doAutoCreate()) + this.stage = new ConditionStageComponent(); + return this.stage; + } + + public boolean hasStage() { + return this.stage != null && !this.stage.isEmpty(); + } + + /** + * @param value {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) + */ + public Condition setStage(ConditionStageComponent value) { + this.stage = value; + return this; + } + + /** + * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) + */ + public List getEvidence() { + if (this.evidence == null) + this.evidence = new ArrayList(); + return this.evidence; + } + + public boolean hasEvidence() { + if (this.evidence == null) + return false; + for (ConditionEvidenceComponent item : this.evidence) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) + */ + // syntactic sugar + public ConditionEvidenceComponent addEvidence() { //3 + ConditionEvidenceComponent t = new ConditionEvidenceComponent(); + if (this.evidence == null) + this.evidence = new ArrayList(); + this.evidence.add(t); + return t; + } + + /** + * @return {@link #location} (The anatomical location where this condition manifests itself.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (ConditionLocationComponent item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The anatomical location where this condition manifests itself.) + */ + // syntactic sugar + public ConditionLocationComponent addLocation() { //3 + ConditionLocationComponent t = new ConditionLocationComponent(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) + */ + public List getDueTo() { + if (this.dueTo == null) + this.dueTo = new ArrayList(); + return this.dueTo; + } + + public boolean hasDueTo() { + if (this.dueTo == null) + return false; + for (ConditionDueToComponent item : this.dueTo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dueTo} (Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.) + */ + // syntactic sugar + public ConditionDueToComponent addDueTo() { //3 + ConditionDueToComponent t = new ConditionDueToComponent(); + if (this.dueTo == null) + this.dueTo = new ArrayList(); + this.dueTo.add(t); + return t; + } + + /** + * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) + */ + public List getOccurredFollowing() { + if (this.occurredFollowing == null) + this.occurredFollowing = new ArrayList(); + return this.occurredFollowing; + } + + public boolean hasOccurredFollowing() { + if (this.occurredFollowing == null) + return false; + for (ConditionOccurredFollowingComponent item : this.occurredFollowing) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #occurredFollowing} (Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.) + */ + // syntactic sugar + public ConditionOccurredFollowingComponent addOccurredFollowing() { //3 + ConditionOccurredFollowingComponent t = new ConditionOccurredFollowingComponent(); + if (this.occurredFollowing == null) + this.occurredFollowing = new ArrayList(); + this.occurredFollowing.add(t); + return t; + } + + /** + * @return {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). 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 Condition.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} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Condition setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + */ + public Condition 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this condition 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("subject", "Reference(Patient)", "Indicates the patient who the condition record is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Person who takes responsibility for asserting the existence of the condition as part of the electronic record.", 0, java.lang.Integer.MAX_VALUE, asserter)); + childrenList.add(new Property("dateAsserted", "date", "Estimated or actual date the condition/problem/diagnosis was first detected/suspected.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); + childrenList.add(new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "CodeableConcept", "A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("status", "code", "The clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("certainty", "CodeableConcept", "The degree of confidence that this condition is correct.", 0, java.lang.Integer.MAX_VALUE, certainty)); + childrenList.add(new Property("severity", "CodeableConcept", "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("onset[x]", "dateTime|Age", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("abatement[x]", "date|Age|boolean", "The date or estimated date that the condition resolved or went into remission. This is called 'abatement' because of the many overloaded connotations associated with 'remission' or 'resolution' - Conditions are never really resolved, but they can abate.", 0, java.lang.Integer.MAX_VALUE, abatement)); + childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); + childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); + childrenList.add(new Property("location", "", "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("dueTo", "", "Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition.", 0, java.lang.Integer.MAX_VALUE, dueTo)); + childrenList.add(new Property("occurredFollowing", "", "Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition.", 0, java.lang.Integer.MAX_VALUE, occurredFollowing)); + childrenList.add(new Property("notes", "string", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + public Condition copy() { + Condition dst = new Condition(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.asserter = asserter == null ? null : asserter.copy(); + dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.status = status == null ? null : status.copy(); + dst.certainty = certainty == null ? null : certainty.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.abatement = abatement == null ? null : abatement.copy(); + dst.stage = stage == null ? null : stage.copy(); + if (evidence != null) { + dst.evidence = new ArrayList(); + for (ConditionEvidenceComponent i : evidence) + dst.evidence.add(i.copy()); + }; + if (location != null) { + dst.location = new ArrayList(); + for (ConditionLocationComponent i : location) + dst.location.add(i.copy()); + }; + if (dueTo != null) { + dst.dueTo = new ArrayList(); + for (ConditionDueToComponent i : dueTo) + dst.dueTo.add(i.copy()); + }; + if (occurredFollowing != null) { + dst.occurredFollowing = new ArrayList(); + for (ConditionOccurredFollowingComponent i : occurredFollowing) + dst.occurredFollowing.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + protected Condition typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (asserter == null || asserter.isEmpty()) + && (dateAsserted == null || dateAsserted.isEmpty()) && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (status == null || status.isEmpty()) && (certainty == null || certainty.isEmpty()) && (severity == null || severity.isEmpty()) + && (onset == null || onset.isEmpty()) && (abatement == null || abatement.isEmpty()) && (stage == null || stage.isEmpty()) + && (evidence == null || evidence.isEmpty()) && (location == null || location.isEmpty()) && (dueTo == null || dueTo.isEmpty()) + && (occurredFollowing == null || occurredFollowing.isEmpty()) && (notes == null || notes.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Condition; + } + + @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference" ) + public static final String SP_ASSERTER = "asserter"; + @SearchParamDefinition(name="following-code", path="Condition.occurredFollowing.codeableConcept", description="Relationship target by means of a predefined code", type="token" ) + public static final String SP_FOLLOWINGCODE = "following-code"; + @SearchParamDefinition(name="dueto-code", path="Condition.dueTo.codeableConcept", description="Relationship target by means of a predefined code", type="token" ) + public static final String SP_DUETOCODE = "dueto-code"; + @SearchParamDefinition(name="status", path="Condition.status", description="The status of the condition", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="location", path="Condition.location.code", description="Location - may include laterality", type="token" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="subject", path="Condition.subject", description="Who has the condition?", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="onset", path="Condition.onset[x]", description="When the Condition started (if started on a date)", type="date" ) + public static final String SP_ONSET = "onset"; + @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="Manifestation/symptom", type="token" ) + public static final String SP_EVIDENCE = "evidence"; + @SearchParamDefinition(name="following-item", path="Condition.occurredFollowing.target", description="Relationship target resource", type="reference" ) + public static final String SP_FOLLOWINGITEM = "following-item"; + @SearchParamDefinition(name="severity", path="Condition.severity", description="The severity of the condition", type="token" ) + public static final String SP_SEVERITY = "severity"; + @SearchParamDefinition(name="code", path="Condition.code", description="Code for the condition", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="encounter", path="Condition.encounter", description="Encounter when condition first asserted", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="date-asserted", path="Condition.dateAsserted", description="When first detected/suspected/entered", type="date" ) + public static final String SP_DATEASSERTED = "date-asserted"; + @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="Simple summary (disease specific)", type="token" ) + public static final String SP_STAGE = "stage"; + @SearchParamDefinition(name="category", path="Condition.category", description="The category of the condition", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="patient", path="Condition.subject", description="Who has the condition?", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="dueto-item", path="Condition.dueTo.target", description="Relationship target resource", type="reference" ) + public static final String SP_DUETOITEM = "dueto-item"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java index b51a3a6bcf5..d0c5b4a1d82 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java @@ -20,108 +20,108 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* -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. - -*/ - -/** - * This class is created to help implementers deal with a change to - * the API that was made between versions 0.81 and 0.9 - * - * The change is the behaviour of the .getX() where the cardinality of - * x is 0..1 or 1..1. Before the change, these routines would return - * null if the object had not previously been assigned, and after the ' - * change, they will automatically create the object if it had not - * been assigned (unless the object is polymorphic, in which case, - * only the type specific getters create the object) - * - * When making the transition from the old style to the new style, - * the main change is that when testing for presence or abssense - * of the element, instead of doing one of these two: - * - * if (obj.getProperty() == null) - * if (obj.getProperty() != null) - * - * you instead do - * - * if (!obj.hasProperty()) - * if (obj.hasProperty()) - * - * or else one of these two: - * - * if (obj.getProperty().isEmpty()) - * if (!obj.getProperty().isEmpty()) - * - * The only way to sort this out is by finding all these things - * in the code, and changing them. - * - * To help with that, you can set the status field of this class - * to change how this API behaves. Note: the status value is tied - * to the way that you program. The intent of this class is to - * help make developers the transiition to status = 0. The old - * behaviour is status = 2. To make the transition, set the - * status code to 1. This way, any time a .getX routine needs - * to automatically create an object, an exception will be - * raised instead. The expected use of this is: - * - set status = 1 - * - test your code (all paths) - * - when an exception happens, change the code to use .hasX() or .isEmpty() - * - when all execution paths don't raise an exception, set status = 0 - * - start programming to the new style. - * - * You can set status = 2 and leave it like that, but this is not - * compatible with the utilities and validation code, nor with the - * HAPI code. So everyone shoul make this transition - * - * This is a difficult change to make to an API. Most users should engage with it - * as they migrate from DSTU1 to DSTU2, at the same time as they encounter - * other changes. This change was made in order to align the two java reference - * implementations on a common object model, which is an important outcome that - * justifies making this change to implementers (sorry for any pain caused) - * - * @author Grahame - * - */ -public class Configuration { - - private static int status = 0; - // 0: auto-create - // 1: error - // 2: return null - - public static boolean errorOnAutoCreate() { - return status == 1; - } - - - public static boolean doAutoCreate() { - return status == 0; - } - -} + +/* +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. + +*/ + +/** + * This class is created to help implementers deal with a change to + * the API that was made between versions 0.81 and 0.9 + * + * The change is the behaviour of the .getX() where the cardinality of + * x is 0..1 or 1..1. Before the change, these routines would return + * null if the object had not previously been assigned, and after the ' + * change, they will automatically create the object if it had not + * been assigned (unless the object is polymorphic, in which case, + * only the type specific getters create the object) + * + * When making the transition from the old style to the new style, + * the main change is that when testing for presence or abssense + * of the element, instead of doing one of these two: + * + * if (obj.getProperty() == null) + * if (obj.getProperty() != null) + * + * you instead do + * + * if (!obj.hasProperty()) + * if (obj.hasProperty()) + * + * or else one of these two: + * + * if (obj.getProperty().isEmpty()) + * if (!obj.getProperty().isEmpty()) + * + * The only way to sort this out is by finding all these things + * in the code, and changing them. + * + * To help with that, you can set the status field of this class + * to change how this API behaves. Note: the status value is tied + * to the way that you program. The intent of this class is to + * help make developers the transiition to status = 0. The old + * behaviour is status = 2. To make the transition, set the + * status code to 1. This way, any time a .getX routine needs + * to automatically create an object, an exception will be + * raised instead. The expected use of this is: + * - set status = 1 + * - test your code (all paths) + * - when an exception happens, change the code to use .hasX() or .isEmpty() + * - when all execution paths don't raise an exception, set status = 0 + * - start programming to the new style. + * + * You can set status = 2 and leave it like that, but this is not + * compatible with the utilities and validation code, nor with the + * HAPI code. So everyone shoul make this transition + * + * This is a difficult change to make to an API. Most users should engage with it + * as they migrate from DSTU1 to DSTU2, at the same time as they encounter + * other changes. This change was made in order to align the two java reference + * implementations on a common object model, which is an important outcome that + * justifies making this change to implementers (sorry for any pain caused) + * + * @author Grahame + * + */ +public class Configuration { + + private static int status = 0; + // 0: auto-create + // 1: error + // 2: return null + + public static boolean errorOnAutoCreate() { + return status == 1; + } + + + public static boolean doAutoCreate() { + return status == 0; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java index f5d9be300f7..81451b96f42 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java @@ -20,5243 +20,5243 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. - */ -@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") -public class Conformance extends DomainResource { - - public enum ConformanceStatementStatus implements FhirEnum { - /** - * This conformance statement is still under development. - */ - DRAFT, - /** - * This conformance statement is ready for use in production systems. - */ - ACTIVE, - /** - * This conformance statement has been withdrawn or superceded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This conformance statement is still under development."; - case ACTIVE: return "This conformance statement is ready for use in production systems."; - case RETIRED: return "This conformance statement has been withdrawn or superceded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class ConformanceStatementStatusEnumFactory implements EnumFactory { - public ConformanceStatementStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ConformanceStatementStatus.DRAFT; - if ("active".equals(codeString)) - return ConformanceStatementStatus.ACTIVE; - if ("retired".equals(codeString)) - return ConformanceStatementStatus.RETIRED; - throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'"); - } - public String toCode(ConformanceStatementStatus code) throws IllegalArgumentException { - if (code == ConformanceStatementStatus.DRAFT) - return "draft"; - if (code == ConformanceStatementStatus.ACTIVE) - return "active"; - if (code == ConformanceStatementStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum RestfulConformanceMode implements FhirEnum { - /** - * The application acts as a server for this resource. - */ - CLIENT, - /** - * The application acts as a client for this resource. - */ - SERVER, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CLIENT: return "client"; - case SERVER: return "server"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CLIENT: return ""; - case SERVER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CLIENT: return "The application acts as a server for this resource."; - case SERVER: return "The application acts as a client for this resource."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CLIENT: return "client"; - case SERVER: return "server"; - default: return "?"; - } - } - } - - public static class RestfulConformanceModeEnumFactory implements EnumFactory { - public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("client".equals(codeString)) - return RestfulConformanceMode.CLIENT; - if ("server".equals(codeString)) - return RestfulConformanceMode.SERVER; - throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - public String toCode(RestfulConformanceMode code) throws IllegalArgumentException { - if (code == RestfulConformanceMode.CLIENT) - return "client"; - if (code == RestfulConformanceMode.SERVER) - return "server"; - return "?"; - } - } - - public enum TypeRestfulInteraction implements FhirEnum { - /** - * - */ - READ, - /** - * - */ - VREAD, - /** - * - */ - UPDATE, - /** - * - */ - DELETE, - /** - * - */ - HISTORYINSTANCE, - /** - * - */ - VALIDATE, - /** - * - */ - HISTORYTYPE, - /** - * - */ - CREATE, - /** - * - */ - SEARCHTYPE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return READ; - if ("vread".equals(codeString)) - return VREAD; - if ("update".equals(codeString)) - return UPDATE; - if ("delete".equals(codeString)) - return DELETE; - if ("history-instance".equals(codeString)) - return HISTORYINSTANCE; - if ("validate".equals(codeString)) - return VALIDATE; - if ("history-type".equals(codeString)) - return HISTORYTYPE; - if ("create".equals(codeString)) - return CREATE; - if ("search-type".equals(codeString)) - return SEARCHTYPE; - throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case READ: return "read"; - case VREAD: return "vread"; - case UPDATE: return "update"; - case DELETE: return "delete"; - case HISTORYINSTANCE: return "history-instance"; - case VALIDATE: return "validate"; - case HISTORYTYPE: return "history-type"; - case CREATE: return "create"; - case SEARCHTYPE: return "search-type"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case READ: return "http://hl7.org/fhir/restful-interaction"; - case VREAD: return "http://hl7.org/fhir/restful-interaction"; - case UPDATE: return "http://hl7.org/fhir/restful-interaction"; - case DELETE: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; - case VALIDATE: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; - case CREATE: return "http://hl7.org/fhir/restful-interaction"; - case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case READ: return ""; - case VREAD: return ""; - case UPDATE: return ""; - case DELETE: return ""; - case HISTORYINSTANCE: return ""; - case VALIDATE: return ""; - case HISTORYTYPE: return ""; - case CREATE: return ""; - case SEARCHTYPE: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case READ: return "read"; - case VREAD: return "vread"; - case UPDATE: return "update"; - case DELETE: return "delete"; - case HISTORYINSTANCE: return "history-instance"; - case VALIDATE: return "validate"; - case HISTORYTYPE: return "history-type"; - case CREATE: return "create"; - case SEARCHTYPE: return "search-type"; - default: return "?"; - } - } - } - - public static class TypeRestfulInteractionEnumFactory implements EnumFactory { - public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("read".equals(codeString)) - return TypeRestfulInteraction.READ; - if ("vread".equals(codeString)) - return TypeRestfulInteraction.VREAD; - if ("update".equals(codeString)) - return TypeRestfulInteraction.UPDATE; - if ("delete".equals(codeString)) - return TypeRestfulInteraction.DELETE; - if ("history-instance".equals(codeString)) - return TypeRestfulInteraction.HISTORYINSTANCE; - if ("validate".equals(codeString)) - return TypeRestfulInteraction.VALIDATE; - if ("history-type".equals(codeString)) - return TypeRestfulInteraction.HISTORYTYPE; - if ("create".equals(codeString)) - return TypeRestfulInteraction.CREATE; - if ("search-type".equals(codeString)) - return TypeRestfulInteraction.SEARCHTYPE; - throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - public String toCode(TypeRestfulInteraction code) throws IllegalArgumentException { - if (code == TypeRestfulInteraction.READ) - return "read"; - if (code == TypeRestfulInteraction.VREAD) - return "vread"; - if (code == TypeRestfulInteraction.UPDATE) - return "update"; - if (code == TypeRestfulInteraction.DELETE) - return "delete"; - if (code == TypeRestfulInteraction.HISTORYINSTANCE) - return "history-instance"; - if (code == TypeRestfulInteraction.VALIDATE) - return "validate"; - if (code == TypeRestfulInteraction.HISTORYTYPE) - return "history-type"; - if (code == TypeRestfulInteraction.CREATE) - return "create"; - if (code == TypeRestfulInteraction.SEARCHTYPE) - return "search-type"; - return "?"; - } - } - - public enum VersioningPolicy implements FhirEnum { - /** - * VersionId meta-property is not suppoerted (server) or used (client). - */ - NOVERSION, - /** - * VersionId meta-property is suppoerted (server) or used (client). - */ - VERSIONED, - /** - * VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). - */ - VERSIONEDUPDATE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return NOVERSION; - if ("versioned".equals(codeString)) - return VERSIONED; - if ("versioned-update".equals(codeString)) - return VERSIONEDUPDATE; - throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case NOVERSION: return "no-version"; - case VERSIONED: return "versioned"; - case VERSIONEDUPDATE: return "versioned-update"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOVERSION: return ""; - case VERSIONED: return ""; - case VERSIONEDUPDATE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOVERSION: return "VersionId meta-property is not suppoerted (server) or used (client)."; - case VERSIONED: return "VersionId meta-property is suppoerted (server) or used (client)."; - case VERSIONEDUPDATE: return "VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOVERSION: return "No VersionId Support"; - case VERSIONED: return "Versioned"; - case VERSIONEDUPDATE: return "VersionId tracked fully"; - default: return "?"; - } - } - } - - public static class VersioningPolicyEnumFactory implements EnumFactory { - public VersioningPolicy fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("no-version".equals(codeString)) - return VersioningPolicy.NOVERSION; - if ("versioned".equals(codeString)) - return VersioningPolicy.VERSIONED; - if ("versioned-update".equals(codeString)) - return VersioningPolicy.VERSIONEDUPDATE; - throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); - } - public String toCode(VersioningPolicy code) throws IllegalArgumentException { - if (code == VersioningPolicy.NOVERSION) - return "no-version"; - if (code == VersioningPolicy.VERSIONED) - return "versioned"; - if (code == VersioningPolicy.VERSIONEDUPDATE) - return "versioned-update"; - return "?"; - } - } - - public enum SearchParamType implements FhirEnum { - /** - * Search parameter SHALL be a number (a whole number, or a decimal). - */ - NUMBER, - /** - * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. - */ - DATE, - /** - * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. - */ - STRING, - /** - * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. - */ - TOKEN, - /** - * A reference to another resource. - */ - REFERENCE, - /** - * A composite search parameter that combines a search on two values together. - */ - COMPOSITE, - /** - * A search parameter that searches on a quantity. - */ - QUANTITY, - /** - * added to help the parsers - */ - NULL; - - 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)) - return NUMBER; - if ("date".equals(codeString)) - return DATE; - if ("string".equals(codeString)) - return STRING; - if ("token".equals(codeString)) - return TOKEN; - if ("reference".equals(codeString)) - return REFERENCE; - if ("composite".equals(codeString)) - return COMPOSITE; - if ("quantity".equals(codeString)) - return QUANTITY; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NUMBER: return ""; - case DATE: return ""; - case STRING: return ""; - case TOKEN: return ""; - case REFERENCE: return ""; - case COMPOSITE: return ""; - case QUANTITY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; - case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; - case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; - case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; - case REFERENCE: return "A reference to another resource."; - case COMPOSITE: return "A composite search parameter that combines a search on two values together."; - case QUANTITY: return "A search parameter that searches on a quantity."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - } - - public static class SearchParamTypeEnumFactory implements EnumFactory { - public SearchParamType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return SearchParamType.NUMBER; - if ("date".equals(codeString)) - return SearchParamType.DATE; - if ("string".equals(codeString)) - return SearchParamType.STRING; - if ("token".equals(codeString)) - return SearchParamType.TOKEN; - if ("reference".equals(codeString)) - return SearchParamType.REFERENCE; - if ("composite".equals(codeString)) - return SearchParamType.COMPOSITE; - if ("quantity".equals(codeString)) - return SearchParamType.QUANTITY; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode(SearchParamType code) throws IllegalArgumentException { - if (code == SearchParamType.NUMBER) - return "number"; - if (code == SearchParamType.DATE) - return "date"; - if (code == SearchParamType.STRING) - return "string"; - if (code == SearchParamType.TOKEN) - return "token"; - if (code == SearchParamType.REFERENCE) - return "reference"; - if (code == SearchParamType.COMPOSITE) - return "composite"; - if (code == SearchParamType.QUANTITY) - return "quantity"; - return "?"; - } - } - - public enum SystemRestfulInteraction implements FhirEnum { - /** - * - */ - TRANSACTION, - /** - * - */ - SEARCHSYSTEM, - /** - * - */ - HISTORYSYSTEM, - /** - * added to help the parsers - */ - NULL; - - 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)) - return TRANSACTION; - if ("search-system".equals(codeString)) - return SEARCHSYSTEM; - if ("history-system".equals(codeString)) - return HISTORYSYSTEM; - throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case TRANSACTION: return "transaction"; - case SEARCHSYSTEM: return "search-system"; - case HISTORYSYSTEM: return "history-system"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TRANSACTION: return "http://hl7.org/fhir/restful-interaction"; - case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TRANSACTION: return ""; - case SEARCHSYSTEM: return ""; - case HISTORYSYSTEM: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TRANSACTION: return "transaction"; - case SEARCHSYSTEM: return "search-system"; - case HISTORYSYSTEM: return "history-system"; - default: return "?"; - } - } - } - - public static class SystemRestfulInteractionEnumFactory implements EnumFactory { - public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("transaction".equals(codeString)) - return SystemRestfulInteraction.TRANSACTION; - if ("search-system".equals(codeString)) - return SystemRestfulInteraction.SEARCHSYSTEM; - if ("history-system".equals(codeString)) - return SystemRestfulInteraction.HISTORYSYSTEM; - throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - public String toCode(SystemRestfulInteraction code) throws IllegalArgumentException { - if (code == SystemRestfulInteraction.TRANSACTION) - return "transaction"; - if (code == SystemRestfulInteraction.SEARCHSYSTEM) - return "search-system"; - if (code == SystemRestfulInteraction.HISTORYSYSTEM) - return "history-system"; - return "?"; - } - } - - 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. - */ - CONSEQUENCE, - /** - * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. - */ - CURRENCY, - /** - * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. - */ - NOTIFICATION, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CONSEQUENCE; - if ("Currency".equals(codeString)) - return CURRENCY; - if ("Notification".equals(codeString)) - return NOTIFICATION; - throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CONSEQUENCE: return "Consequence"; - case CURRENCY: return "Currency"; - case NOTIFICATION: return "Notification"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONSEQUENCE: return ""; - case CURRENCY: return ""; - case NOTIFICATION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment."; - case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; - case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONSEQUENCE: return "Consequence"; - case CURRENCY: return "Currency"; - case NOTIFICATION: return "Notification"; - default: return "?"; - } - } - } - - public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { - public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("Consequence".equals(codeString)) - return MessageSignificanceCategory.CONSEQUENCE; - if ("Currency".equals(codeString)) - return MessageSignificanceCategory.CURRENCY; - if ("Notification".equals(codeString)) - return MessageSignificanceCategory.NOTIFICATION; - throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - public String toCode(MessageSignificanceCategory code) throws IllegalArgumentException { - if (code == MessageSignificanceCategory.CONSEQUENCE) - return "Consequence"; - if (code == MessageSignificanceCategory.CURRENCY) - return "Currency"; - if (code == MessageSignificanceCategory.NOTIFICATION) - return "Notification"; - return "?"; - } - } - - public enum MessageConformanceEventMode implements FhirEnum { - /** - * The application sends requests and receives responses. - */ - SENDER, - /** - * The application receives requests and sends responses. - */ - RECEIVER, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case SENDER: return "sender"; - case RECEIVER: return "receiver"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SENDER: return ""; - case RECEIVER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SENDER: return "The application sends requests and receives responses."; - case RECEIVER: return "The application receives requests and sends responses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SENDER: return "sender"; - case RECEIVER: return "receiver"; - default: return "?"; - } - } - } - - public static class MessageConformanceEventModeEnumFactory implements EnumFactory { - public MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("sender".equals(codeString)) - return MessageConformanceEventMode.SENDER; - if ("receiver".equals(codeString)) - return MessageConformanceEventMode.RECEIVER; - throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); - } - public String toCode(MessageConformanceEventMode code) throws IllegalArgumentException { - if (code == MessageConformanceEventMode.SENDER) - return "sender"; - if (code == MessageConformanceEventMode.RECEIVER) - return "receiver"; - return "?"; - } - } - - public enum DocumentMode implements FhirEnum { - /** - * The application produces documents of the specified type. - */ - PRODUCER, - /** - * The application consumes documents of the specified type. - */ - CONSUMER, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PRODUCER: return "producer"; - case CONSUMER: return "consumer"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRODUCER: return ""; - case CONSUMER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRODUCER: return "The application produces documents of the specified type."; - case CONSUMER: return "The application consumes documents of the specified type."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRODUCER: return "producer"; - case CONSUMER: return "consumer"; - default: return "?"; - } - } - } - - public static class DocumentModeEnumFactory implements EnumFactory { - public DocumentMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("producer".equals(codeString)) - return DocumentMode.PRODUCER; - if ("consumer".equals(codeString)) - return DocumentMode.CONSUMER; - throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); - } - public String toCode(DocumentMode code) throws IllegalArgumentException { - if (code == DocumentMode.PRODUCER) - return "producer"; - if (code == DocumentMode.CONSUMER) - return "consumer"; - return "?"; - } - } - - @Block() - public static class ConformanceSoftwareComponent extends BackboneElement { - /** - * Name software is known by. - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." ) - protected StringType name; - - /** - * The version identifier for the software covered by this statement. - */ - @Child(name="version", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." ) - protected StringType version; - - /** - * Date this version of the software released. - */ - @Child(name="releaseDate", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software released." ) - protected DateTimeType releaseDate; - - private static final long serialVersionUID = 1819769027L; - - public ConformanceSoftwareComponent() { - super(); - } - - public ConformanceSoftwareComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceSoftwareComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name software is known by. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name software is known by. - */ - public ConformanceSoftwareComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConformanceSoftwareComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version identifier for the software covered by this statement. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version identifier for the software covered by this statement. - */ - public ConformanceSoftwareComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value - */ - public DateTimeType getReleaseDateElement() { - if (this.releaseDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.releaseDate"); - else if (Configuration.doAutoCreate()) - this.releaseDate = new DateTimeType(); - return this.releaseDate; - } - - public boolean hasReleaseDateElement() { - return this.releaseDate != null && !this.releaseDate.isEmpty(); - } - - public boolean hasReleaseDate() { - return this.releaseDate != null && !this.releaseDate.isEmpty(); - } - - /** - * @param value {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value - */ - public ConformanceSoftwareComponent setReleaseDateElement(DateTimeType value) { - this.releaseDate = value; - return this; - } - - /** - * @return Date this version of the software released. - */ - public Date getReleaseDate() { - return this.releaseDate == null ? null : this.releaseDate.getValue(); - } - - /** - * @param value Date this version of the software released. - */ - public ConformanceSoftwareComponent setReleaseDate(Date value) { - if (value == null) - this.releaseDate = null; - else { - if (this.releaseDate == null) - this.releaseDate = new DateTimeType(); - this.releaseDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Name software is known by.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("releaseDate", "dateTime", "Date this version of the software released.", 0, java.lang.Integer.MAX_VALUE, releaseDate)); - } - - public ConformanceSoftwareComponent copy() { - ConformanceSoftwareComponent dst = new ConformanceSoftwareComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.version = version == null ? null : version.copy(); - dst.releaseDate = releaseDate == null ? null : releaseDate.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (version == null || version.isEmpty()) - && (releaseDate == null || releaseDate.isEmpty()); - } - - } - - @Block() - public static class ConformanceImplementationComponent extends BackboneElement { - /** - * Information about the specific installation that this conformance statement relates to. - */ - @Child(name="description", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this conformance statement relates to." ) - protected StringType description; - - /** - * A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - @Child(name="url", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Base URL for the installation", formalDefinition="A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." ) - protected UriType url; - - private static final long serialVersionUID = -289238508L; - - public ConformanceImplementationComponent() { - super(); - } - - public ConformanceImplementationComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (Information about the specific installation that this conformance statement relates to.). 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 ConformanceImplementationComponent.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} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConformanceImplementationComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Information about the specific installation that this conformance statement relates to. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Information about the specific installation that this conformance statement relates to. - */ - public ConformanceImplementationComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #url} (A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceImplementationComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ConformanceImplementationComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - public ConformanceImplementationComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Information about the specific installation that this conformance statement relates to.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("url", "uri", "A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public ConformanceImplementationComponent copy() { - ConformanceImplementationComponent dst = new ConformanceImplementationComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestComponent extends BackboneElement { - /** - * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - @Child(name="mode", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations." ) - protected Enumeration mode; - - /** - * Information about the system's restful capabilities that apply across all applications, such as security. - */ - @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." ) - protected StringType documentation; - - /** - * Information about security of implementation. - */ - @Child(name="security", type={}, order=3, min=0, max=1) - @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security of implementation." ) - protected ConformanceRestSecurityComponent security; - - /** - * A specification of the restful capabilities of the solution for a specific resource type. - */ - @Child(name="resource", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." ) - protected List resource; - - /** - * A specification of restful operations supported by the system. - */ - @Child(name="interaction", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." ) - protected List interaction; - - /** - * Definition of an operation or a named query and with its parameters and their meaning and type. - */ - @Child(name="operation", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query and with its parameters and their meaning and type." ) - protected List operation; - - /** - * A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose. - */ - @Child(name="documentMailbox", type={UriType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="How documents are accepted in /Mailbox", formalDefinition="A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose." ) - protected List documentMailbox; - - private static final long serialVersionUID = 777542519L; - - public ConformanceRestComponent() { - super(); - } - - public ConformanceRestComponent(Enumeration mode) { - super(); - this.mode = mode; - } - - /** - * @return {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceRestComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - public RestfulConformanceMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - public ConformanceRestComponent setMode(RestfulConformanceMode value) { - if (this.mode == null) - this.mode = new Enumeration(RestfulConformanceMode.ENUM_FACTORY); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). 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 ConformanceRestComponent.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} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceRestComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Information about the system's restful capabilities that apply across all applications, such as security. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Information about the system's restful capabilities that apply across all applications, such as security. - */ - public ConformanceRestComponent 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 #security} (Information about security of implementation.) - */ - public ConformanceRestSecurityComponent getSecurity() { - if (this.security == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.security"); - else if (Configuration.doAutoCreate()) - this.security = new ConformanceRestSecurityComponent(); - return this.security; - } - - public boolean hasSecurity() { - return this.security != null && !this.security.isEmpty(); - } - - /** - * @param value {@link #security} (Information about security of implementation.) - */ - public ConformanceRestComponent setSecurity(ConformanceRestSecurityComponent value) { - this.security = value; - return this; - } - - /** - * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) - */ - public List getResource() { - if (this.resource == null) - this.resource = new ArrayList(); - return this.resource; - } - - public boolean hasResource() { - if (this.resource == null) - return false; - for (ConformanceRestResourceComponent item : this.resource) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) - */ - // syntactic sugar - public ConformanceRestResourceComponent addResource() { //3 - ConformanceRestResourceComponent t = new ConformanceRestResourceComponent(); - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return t; - } - - /** - * @return {@link #interaction} (A specification of restful operations supported by the system.) - */ - public List getInteraction() { - if (this.interaction == null) - this.interaction = new ArrayList(); - return this.interaction; - } - - public boolean hasInteraction() { - if (this.interaction == null) - return false; - for (SystemInteractionComponent item : this.interaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interaction} (A specification of restful operations supported by the system.) - */ - // syntactic sugar - public SystemInteractionComponent addInteraction() { //3 - SystemInteractionComponent t = new SystemInteractionComponent(); - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return t; - } - - /** - * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) - */ - public List getOperation() { - if (this.operation == null) - this.operation = new ArrayList(); - return this.operation; - } - - public boolean hasOperation() { - if (this.operation == null) - return false; - for (ConformanceRestOperationComponent item : this.operation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) - */ - // syntactic sugar - public ConformanceRestOperationComponent addOperation() { //3 - ConformanceRestOperationComponent t = new ConformanceRestOperationComponent(); - if (this.operation == null) - this.operation = new ArrayList(); - this.operation.add(t); - return t; - } - - /** - * @return {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - public List getDocumentMailbox() { - if (this.documentMailbox == null) - this.documentMailbox = new ArrayList(); - return this.documentMailbox; - } - - public boolean hasDocumentMailbox() { - if (this.documentMailbox == null) - return false; - for (UriType item : this.documentMailbox) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - // syntactic sugar - public UriType addDocumentMailboxElement() {//2 - UriType t = new UriType(); - if (this.documentMailbox == null) - this.documentMailbox = new ArrayList(); - this.documentMailbox.add(t); - return t; - } - - /** - * @param value {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - public ConformanceRestComponent addDocumentMailbox(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.documentMailbox == null) - this.documentMailbox = new ArrayList(); - this.documentMailbox.add(t); - return this; - } - - /** - * @param value {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) - */ - public boolean hasDocumentMailbox(String value) { - if (this.documentMailbox == null) - return false; - for (UriType v : this.documentMailbox) - if (v.equals(value)) // uri - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("security", "", "Information about security of implementation.", 0, java.lang.Integer.MAX_VALUE, security)); - childrenList.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction)); - childrenList.add(new Property("operation", "", "Definition of an operation or a named query and with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation)); - childrenList.add(new Property("documentMailbox", "uri", "A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose.", 0, java.lang.Integer.MAX_VALUE, documentMailbox)); - } - - public ConformanceRestComponent copy() { - ConformanceRestComponent dst = new ConformanceRestComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.security = security == null ? null : security.copy(); - if (resource != null) { - dst.resource = new ArrayList(); - for (ConformanceRestResourceComponent i : resource) - dst.resource.add(i.copy()); - }; - if (interaction != null) { - dst.interaction = new ArrayList(); - for (SystemInteractionComponent i : interaction) - dst.interaction.add(i.copy()); - }; - if (operation != null) { - dst.operation = new ArrayList(); - for (ConformanceRestOperationComponent i : operation) - dst.operation.add(i.copy()); - }; - if (documentMailbox != null) { - dst.documentMailbox = new ArrayList(); - for (UriType i : documentMailbox) - dst.documentMailbox.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (security == null || security.isEmpty()) && (resource == null || resource.isEmpty()) && (interaction == null || interaction.isEmpty()) - && (operation == null || operation.isEmpty()) && (documentMailbox == null || documentMailbox.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestSecurityComponent extends BackboneElement { - /** - * Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - @Child(name="cors", type={BooleanType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." ) - protected BooleanType cors; - - /** - * Types of security services are supported/required by the system. - */ - @Child(name="service", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="OAuth | OAuth2 | NTLM | Basic | Kerberos", formalDefinition="Types of security services are supported/required by the system." ) - protected List service; - - /** - * General description of how security works. - */ - @Child(name="description", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." ) - protected StringType description; - - /** - * Certificates associated with security profiles. - */ - @Child(name="certificate", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." ) - protected List certificate; - - private static final long serialVersionUID = 391663952L; - - public ConformanceRestSecurityComponent() { - super(); - } - - /** - * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value - */ - public BooleanType getCorsElement() { - if (this.cors == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.cors"); - else if (Configuration.doAutoCreate()) - this.cors = new BooleanType(); - return this.cors; - } - - public boolean hasCorsElement() { - return this.cors != null && !this.cors.isEmpty(); - } - - public boolean hasCors() { - return this.cors != null && !this.cors.isEmpty(); - } - - /** - * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value - */ - public ConformanceRestSecurityComponent setCorsElement(BooleanType value) { - this.cors = value; - return this; - } - - /** - * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - public boolean getCors() { - return this.cors == null ? false : this.cors.getValue(); - } - - /** - * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - public ConformanceRestSecurityComponent setCors(boolean value) { - if (value == false) - this.cors = null; - else { - if (this.cors == null) - this.cors = new BooleanType(); - this.cors.setValue(value); - } - return this; - } - - /** - * @return {@link #service} (Types of security services are supported/required by the system.) - */ - public List getService() { - if (this.service == null) - this.service = new ArrayList(); - return this.service; - } - - public boolean hasService() { - if (this.service == null) - return false; - for (CodeableConcept item : this.service) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #service} (Types of security services are supported/required by the system.) - */ - // syntactic sugar - public CodeableConcept addService() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.service == null) - this.service = new ArrayList(); - this.service.add(t); - return t; - } - - /** - * @return {@link #description} (General description of how security works.). 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 ConformanceRestSecurityComponent.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} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConformanceRestSecurityComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return General description of how security works. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value General description of how security works. - */ - public ConformanceRestSecurityComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #certificate} (Certificates associated with security profiles.) - */ - public List getCertificate() { - if (this.certificate == null) - this.certificate = new ArrayList(); - return this.certificate; - } - - public boolean hasCertificate() { - if (this.certificate == null) - return false; - for (ConformanceRestSecurityCertificateComponent item : this.certificate) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #certificate} (Certificates associated with security profiles.) - */ - // syntactic sugar - public ConformanceRestSecurityCertificateComponent addCertificate() { //3 - ConformanceRestSecurityCertificateComponent t = new ConformanceRestSecurityCertificateComponent(); - if (this.certificate == null) - this.certificate = new ArrayList(); - this.certificate.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, java.lang.Integer.MAX_VALUE, cors)); - childrenList.add(new Property("service", "CodeableConcept", "Types of security services are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("description", "string", "General description of how security works.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate)); - } - - public ConformanceRestSecurityComponent copy() { - ConformanceRestSecurityComponent dst = new ConformanceRestSecurityComponent(); - copyValues(dst); - dst.cors = cors == null ? null : cors.copy(); - if (service != null) { - dst.service = new ArrayList(); - for (CodeableConcept i : service) - dst.service.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (certificate != null) { - dst.certificate = new ArrayList(); - for (ConformanceRestSecurityCertificateComponent i : certificate) - dst.certificate.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (cors == null || cors.isEmpty()) && (service == null || service.isEmpty()) - && (description == null || description.isEmpty()) && (certificate == null || certificate.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestSecurityCertificateComponent extends BackboneElement { - /** - * Mime type for certificate. - */ - @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Mime type for certificate", formalDefinition="Mime type for certificate." ) - protected CodeType type; - - /** - * Actual certificate. - */ - @Child(name="blob", type={Base64BinaryType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." ) - protected Base64BinaryType blob; - - private static final long serialVersionUID = 2092655854L; - - public ConformanceRestSecurityCertificateComponent() { - super(); - } - - /** - * @return {@link #type} (Mime type for certificate.). 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 ConformanceRestSecurityCertificateComponent.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} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestSecurityCertificateComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return Mime type for certificate. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Mime type for certificate. - */ - public ConformanceRestSecurityCertificateComponent 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 #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Base64BinaryType getBlobElement() { - if (this.blob == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.blob"); - else if (Configuration.doAutoCreate()) - this.blob = new Base64BinaryType(); - return this.blob; - } - - public boolean hasBlobElement() { - return this.blob != null && !this.blob.isEmpty(); - } - - public boolean hasBlob() { - return this.blob != null && !this.blob.isEmpty(); - } - - /** - * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public ConformanceRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { - this.blob = value; - return this; - } - - /** - * @return Actual certificate. - */ - public byte[] getBlob() { - return this.blob == null ? null : this.blob.getValue(); - } - - /** - * @param value Actual certificate. - */ - public ConformanceRestSecurityCertificateComponent setBlob(byte[] value) { - if (value == null) - this.blob = null; - else { - if (this.blob == null) - this.blob = new Base64BinaryType(); - this.blob.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Mime type for certificate.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("blob", "base64Binary", "Actual certificate.", 0, java.lang.Integer.MAX_VALUE, blob)); - } - - public ConformanceRestSecurityCertificateComponent copy() { - ConformanceRestSecurityCertificateComponent dst = new ConformanceRestSecurityCertificateComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.blob = blob == null ? null : blob.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (blob == null || blob.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestResourceComponent extends BackboneElement { - /** - * A type of resource exposed via the restful interface. - */ - @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." ) - protected CodeType type; - - /** - * A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. - */ - @Child(name="profile", type={Profile.class}, order=2, min=0, max=1) - @Description(shortDefinition="What structural features are supported", formalDefinition="A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - protected Profile profileTarget; - - /** - * Identifies a restful operation supported by the solution. - */ - @Child(name="interaction", type={}, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." ) - protected List interaction; - - /** - * Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. - */ - @Child(name="versioning", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources." ) - protected Enumeration versioning; - - /** - * A flag for whether the server is able to return past versions as part of the vRead operation. - */ - @Child(name="readHistory", type={BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." ) - protected BooleanType readHistory; - - /** - * A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server. - */ - @Child(name="updateCreate", type={BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="If allows/uses update to a new location", formalDefinition="A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server." ) - protected BooleanType updateCreate; - - /** - * A list of _include values supported by the server. - */ - @Child(name="searchInclude", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." ) - protected List searchInclude; - - /** - * Additional search parameters for implementations to support and/or make use of. - */ - @Child(name="searchParam", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional search params defined", formalDefinition="Additional search parameters for implementations to support and/or make use of." ) - protected List searchParam; - - private static final long serialVersionUID = 120556320L; - - public ConformanceRestResourceComponent() { - super(); - } - - public ConformanceRestResourceComponent(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A type of resource exposed via the restful interface.). 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 ConformanceRestResourceComponent.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} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestResourceComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return A type of resource exposed via the restful interface. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A type of resource exposed via the restful interface. - */ - public ConformanceRestResourceComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.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 specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public ConformanceRestResourceComponent 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 specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public Profile getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.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 specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) - */ - public ConformanceRestResourceComponent setProfileTarget(Profile value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #interaction} (Identifies a restful operation supported by the solution.) - */ - public List getInteraction() { - if (this.interaction == null) - this.interaction = new ArrayList(); - return this.interaction; - } - - public boolean hasInteraction() { - if (this.interaction == null) - return false; - for (ResourceInteractionComponent item : this.interaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interaction} (Identifies a restful operation supported by the solution.) - */ - // syntactic sugar - public ResourceInteractionComponent addInteraction() { //3 - ResourceInteractionComponent t = new ResourceInteractionComponent(); - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return t; - } - - /** - * @return {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public Enumeration getVersioningElement() { - if (this.versioning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.versioning"); - else if (Configuration.doAutoCreate()) - this.versioning = new Enumeration(); - return this.versioning; - } - - public boolean hasVersioningElement() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - public boolean hasVersioning() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - /** - * @param value {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public ConformanceRestResourceComponent setVersioningElement(Enumeration value) { - this.versioning = value; - return this; - } - - /** - * @return Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. - */ - public VersioningPolicy getVersioning() { - return this.versioning == null ? null : this.versioning.getValue(); - } - - /** - * @param value Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. - */ - public ConformanceRestResourceComponent setVersioning(VersioningPolicy value) { - if (value == null) - this.versioning = null; - else { - if (this.versioning == null) - this.versioning = new Enumeration(VersioningPolicy.ENUM_FACTORY); - this.versioning.setValue(value); - } - return this; - } - - /** - * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value - */ - public BooleanType getReadHistoryElement() { - if (this.readHistory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.readHistory"); - else if (Configuration.doAutoCreate()) - this.readHistory = new BooleanType(); - return this.readHistory; - } - - public boolean hasReadHistoryElement() { - return this.readHistory != null && !this.readHistory.isEmpty(); - } - - public boolean hasReadHistory() { - return this.readHistory != null && !this.readHistory.isEmpty(); - } - - /** - * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value - */ - public ConformanceRestResourceComponent setReadHistoryElement(BooleanType value) { - this.readHistory = value; - return this; - } - - /** - * @return A flag for whether the server is able to return past versions as part of the vRead operation. - */ - public boolean getReadHistory() { - return this.readHistory == null ? false : this.readHistory.getValue(); - } - - /** - * @param value A flag for whether the server is able to return past versions as part of the vRead operation. - */ - public ConformanceRestResourceComponent setReadHistory(boolean value) { - if (value == false) - this.readHistory = null; - else { - if (this.readHistory == null) - this.readHistory = new BooleanType(); - this.readHistory.setValue(value); - } - return this; - } - - /** - * @return {@link #updateCreate} (A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value - */ - public BooleanType getUpdateCreateElement() { - if (this.updateCreate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.updateCreate"); - else if (Configuration.doAutoCreate()) - this.updateCreate = new BooleanType(); - return this.updateCreate; - } - - public boolean hasUpdateCreateElement() { - return this.updateCreate != null && !this.updateCreate.isEmpty(); - } - - public boolean hasUpdateCreate() { - return this.updateCreate != null && !this.updateCreate.isEmpty(); - } - - /** - * @param value {@link #updateCreate} (A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value - */ - public ConformanceRestResourceComponent setUpdateCreateElement(BooleanType value) { - this.updateCreate = value; - return this; - } - - /** - * @return A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server. - */ - public boolean getUpdateCreate() { - return this.updateCreate == null ? false : this.updateCreate.getValue(); - } - - /** - * @param value A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server. - */ - public ConformanceRestResourceComponent setUpdateCreate(boolean value) { - if (value == false) - this.updateCreate = null; - else { - if (this.updateCreate == null) - this.updateCreate = new BooleanType(); - this.updateCreate.setValue(value); - } - return this; - } - - /** - * @return {@link #searchInclude} (A list of _include values supported by the server.) - */ - public List getSearchInclude() { - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - return this.searchInclude; - } - - public boolean hasSearchInclude() { - if (this.searchInclude == null) - return false; - for (StringType item : this.searchInclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchInclude} (A list of _include values supported by the server.) - */ - // syntactic sugar - public StringType addSearchIncludeElement() {//2 - StringType t = new StringType(); - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - this.searchInclude.add(t); - return t; - } - - /** - * @param value {@link #searchInclude} (A list of _include values supported by the server.) - */ - public ConformanceRestResourceComponent addSearchInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - this.searchInclude.add(t); - return this; - } - - /** - * @param value {@link #searchInclude} (A list of _include values supported by the server.) - */ - public boolean hasSearchInclude(String value) { - if (this.searchInclude == null) - return false; - for (StringType v : this.searchInclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #searchParam} (Additional search parameters for implementations to support and/or make use of.) - */ - public List getSearchParam() { - if (this.searchParam == null) - this.searchParam = new ArrayList(); - return this.searchParam; - } - - public boolean hasSearchParam() { - if (this.searchParam == null) - return false; - for (ConformanceRestResourceSearchParamComponent item : this.searchParam) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchParam} (Additional search parameters for implementations to support and/or make use of.) - */ - // syntactic sugar - public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 - ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(Profile)", "A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction)); - childrenList.add(new Property("versioning", "code", "Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.", 0, java.lang.Integer.MAX_VALUE, versioning)); - childrenList.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, java.lang.Integer.MAX_VALUE, readHistory)); - childrenList.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.", 0, java.lang.Integer.MAX_VALUE, updateCreate)); - childrenList.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude)); - childrenList.add(new Property("searchParam", "", "Additional search parameters for implementations to support and/or make use of.", 0, java.lang.Integer.MAX_VALUE, searchParam)); - } - - public ConformanceRestResourceComponent copy() { - ConformanceRestResourceComponent dst = new ConformanceRestResourceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (interaction != null) { - dst.interaction = new ArrayList(); - for (ResourceInteractionComponent i : interaction) - dst.interaction.add(i.copy()); - }; - dst.versioning = versioning == null ? null : versioning.copy(); - dst.readHistory = readHistory == null ? null : readHistory.copy(); - dst.updateCreate = updateCreate == null ? null : updateCreate.copy(); - if (searchInclude != null) { - dst.searchInclude = new ArrayList(); - for (StringType i : searchInclude) - dst.searchInclude.add(i.copy()); - }; - if (searchParam != null) { - dst.searchParam = new ArrayList(); - for (ConformanceRestResourceSearchParamComponent i : searchParam) - dst.searchParam.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) - && (interaction == null || interaction.isEmpty()) && (versioning == null || versioning.isEmpty()) - && (readHistory == null || readHistory.isEmpty()) && (updateCreate == null || updateCreate.isEmpty()) - && (searchInclude == null || searchInclude.isEmpty()) && (searchParam == null || searchParam.isEmpty()) - ; - } - - } - - @Block() - public static class ResourceInteractionComponent extends BackboneElement { - /** - * Coded identifier of the operation, supported by the system resource. - */ - @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="read | vread | update | delete | history-instance | validate | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) - protected Enumeration code; - - /** - * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." ) - protected StringType documentation; - - private static final long serialVersionUID = -437507806L; - - public ResourceInteractionComponent() { - super(); - } - - public ResourceInteractionComponent(Enumeration code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceInteractionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ResourceInteractionComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Coded identifier of the operation, supported by the system resource. - */ - public TypeRestfulInteraction getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Coded identifier of the operation, supported by the system resource. - */ - public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { - if (this.code == null) - this.code = new Enumeration(TypeRestfulInteraction.ENUM_FACTORY); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). 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 ResourceInteractionComponent.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} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ResourceInteractionComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - public ResourceInteractionComponent 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; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - public ResourceInteractionComponent copy() { - ResourceInteractionComponent dst = new ResourceInteractionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestResourceSearchParamComponent extends BackboneElement { - /** - * The name of the search parameter used in the interface. - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." ) - protected StringType name; - - /** - * A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter. - */ - @Child(name="definition", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Source of definition for parameter", formalDefinition="A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter." ) - protected UriType definition; - - /** - * The type of value a search parameter refers to, and how the content is interpreted. - */ - @Child(name="type", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) - protected Enumeration type; - - /** - * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - @Child(name="documentation", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) - protected StringType documentation; - - /** - * Types of resource (if a resource is referenced). - */ - @Child(name="target", type={CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - protected List target; - - /** - * Chained names supported. - */ - @Child(name="chain", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Chained names supported", formalDefinition="Chained names supported." ) - protected List chain; - - private static final long serialVersionUID = 938312816L; - - public ConformanceRestResourceSearchParamComponent() { - super(); - } - - public ConformanceRestResourceSearchParamComponent(StringType name, Enumeration type) { - super(); - this.name = name; - this.type = type; - } - - /** - * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the search parameter used in the interface. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the search parameter used in the interface. - */ - public ConformanceRestResourceSearchParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #definition} (A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public UriType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new UriType(); - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setDefinitionElement(UriType value) { - this.definition = value; - return this; - } - - /** - * @return A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter. - */ - public ConformanceRestResourceSearchParamComponent setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new UriType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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 of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParamType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of value a search parameter refers to, and how the content is interpreted. - */ - public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { - if (this.type == null) - this.type = new Enumeration(SearchParamType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). 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 ConformanceRestResourceSearchParamComponent.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} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - public ConformanceRestResourceSearchParamComponent 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 #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - // syntactic sugar - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public ConformanceRestResourceSearchParamComponent addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #chain} (Chained names supported.) - */ - public List getChain() { - if (this.chain == null) - this.chain = new ArrayList(); - return this.chain; - } - - public boolean hasChain() { - if (this.chain == null) - return false; - for (StringType item : this.chain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #chain} (Chained names supported.) - */ - // syntactic sugar - public StringType addChainElement() {//2 - StringType t = new StringType(); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return t; - } - - /** - * @param value {@link #chain} (Chained names supported.) - */ - public ConformanceRestResourceSearchParamComponent addChain(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return this; - } - - /** - * @param value {@link #chain} (Chained names supported.) - */ - public boolean hasChain(String value) { - if (this.chain == null) - return false; - for (StringType v : this.chain) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("definition", "uri", "A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("chain", "string", "Chained names supported.", 0, java.lang.Integer.MAX_VALUE, chain)); - } - - public ConformanceRestResourceSearchParamComponent copy() { - ConformanceRestResourceSearchParamComponent dst = new ConformanceRestResourceSearchParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.type = type == null ? null : type.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - if (chain != null) { - dst.chain = new ArrayList(); - for (StringType i : chain) - dst.chain.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) - && (type == null || type.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (target == null || target.isEmpty()) && (chain == null || chain.isEmpty()); - } - - } - - @Block() - public static class SystemInteractionComponent extends BackboneElement { - /** - * A coded identifier of the operation, supported by the system. - */ - @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="transaction | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." ) - protected Enumeration code; - - /** - * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." ) - protected StringType documentation; - - private static final long serialVersionUID = 510675287L; - - public SystemInteractionComponent() { - super(); - } - - public SystemInteractionComponent(Enumeration code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SystemInteractionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public SystemInteractionComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return A coded identifier of the operation, supported by the system. - */ - public SystemRestfulInteraction getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A coded identifier of the operation, supported by the system. - */ - public SystemInteractionComponent setCode(SystemRestfulInteraction value) { - if (this.code == null) - this.code = new Enumeration(SystemRestfulInteraction.ENUM_FACTORY); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). 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 SystemInteractionComponent.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} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public SystemInteractionComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - public SystemInteractionComponent 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; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - public SystemInteractionComponent copy() { - SystemInteractionComponent dst = new SystemInteractionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceRestOperationComponent extends BackboneElement { - /** - * The name of a query, which is used in the _query parameter when the query is called. - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of a query, which is used in the _query parameter when the query is called." ) - protected StringType name; - - /** - * Where the formal definition can be found. - */ - @Child(name="definition", type={OperationDefinition.class}, order=2, min=1, max=1) - @Description(shortDefinition="The the operation/query is defined", formalDefinition="Where the formal definition can be found." ) - protected Reference definition; - - /** - * The actual object that is the target of the reference (Where the formal definition can be found.) - */ - protected OperationDefinition definitionTarget; - - private static final long serialVersionUID = 122107272L; - - public ConformanceRestOperationComponent() { - super(); - } - - public ConformanceRestOperationComponent(StringType name, Reference definition) { - super(); - this.name = name; - this.definition = definition; - } - - /** - * @return {@link #name} (The name of a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceRestOperationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of a query, which is used in the _query parameter when the query is called. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of a query, which is used in the _query parameter when the query is called. - */ - public ConformanceRestOperationComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #definition} (Where the formal definition can be found.) - */ - public Reference getDefinition() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new Reference(); - return this.definition; - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (Where the formal definition can be found.) - */ - public ConformanceRestOperationComponent setDefinition(Reference value) { - this.definition = value; - return this; - } - - /** - * @return {@link #definition} 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. (Where the formal definition can be found.) - */ - public OperationDefinition getDefinitionTarget() { - if (this.definitionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definitionTarget = new OperationDefinition(); - return this.definitionTarget; - } - - /** - * @param value {@link #definition} 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. (Where the formal definition can be found.) - */ - public ConformanceRestOperationComponent setDefinitionTarget(OperationDefinition value) { - this.definitionTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of a query, which is used in the _query parameter when the query is called.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, java.lang.Integer.MAX_VALUE, definition)); - } - - public ConformanceRestOperationComponent copy() { - ConformanceRestOperationComponent dst = new ConformanceRestOperationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.definition = definition == null ? null : definition.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceMessagingComponent extends BackboneElement { - /** - * An address to which messages and/or replies are to be sent. - */ - @Child(name="endpoint", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Actual endpoint being described", formalDefinition="An address to which messages and/or replies are to be sent." ) - protected UriType endpoint; - - /** - * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - @Child(name="reliableCache", type={IntegerType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." ) - protected IntegerType reliableCache; - - /** - * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - @Child(name="documentation", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner." ) - protected StringType documentation; - - /** - * A description of the solution's support for an event at this end point. - */ - @Child(name="event", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end point." ) - protected List event; - - private static final long serialVersionUID = -217151442L; - - public ConformanceMessagingComponent() { - super(); - } - - /** - * @return {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public ConformanceMessagingComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return An address to which messages and/or replies are to be sent. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value An address to which messages and/or replies are to be sent. - */ - public ConformanceMessagingComponent setEndpoint(String value) { - if (Utilities.noString(value)) - this.endpoint = null; - else { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - } - return this; - } - - /** - * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value - */ - public IntegerType getReliableCacheElement() { - if (this.reliableCache == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.reliableCache"); - else if (Configuration.doAutoCreate()) - this.reliableCache = new IntegerType(); - return this.reliableCache; - } - - public boolean hasReliableCacheElement() { - return this.reliableCache != null && !this.reliableCache.isEmpty(); - } - - public boolean hasReliableCache() { - return this.reliableCache != null && !this.reliableCache.isEmpty(); - } - - /** - * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value - */ - public ConformanceMessagingComponent setReliableCacheElement(IntegerType value) { - this.reliableCache = value; - return this; - } - - /** - * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - public int getReliableCache() { - return this.reliableCache == null ? null : this.reliableCache.getValue(); - } - - /** - * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - public ConformanceMessagingComponent setReliableCache(int value) { - if (value == -1) - this.reliableCache = null; - else { - if (this.reliableCache == null) - this.reliableCache = new IntegerType(); - this.reliableCache.setValue(value); - } - return this; - } - - /** - * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). 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 ConformanceMessagingComponent.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} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceMessagingComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - public ConformanceMessagingComponent 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 #event} (A description of the solution's support for an event at this end point.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (ConformanceMessagingEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A description of the solution's support for an event at this end point.) - */ - // syntactic sugar - public ConformanceMessagingEventComponent addEvent() { //3 - ConformanceMessagingEventComponent t = new ConformanceMessagingEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("endpoint", "uri", "An address to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - childrenList.add(new Property("reliableCache", "integer", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, java.lang.Integer.MAX_VALUE, reliableCache)); - childrenList.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("event", "", "A description of the solution's support for an event at this end point.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - public ConformanceMessagingComponent copy() { - ConformanceMessagingComponent dst = new ConformanceMessagingComponent(); - copyValues(dst); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - dst.reliableCache = reliableCache == null ? null : reliableCache.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (ConformanceMessagingEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (endpoint == null || endpoint.isEmpty()) && (reliableCache == null || reliableCache.isEmpty()) - && (documentation == null || documentation.isEmpty()) && (event == null || event.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceMessagingEventComponent extends BackboneElement { - /** - * A coded identifier of a supported messaging event. - */ - @Child(name="code", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) - protected Coding code; - - /** - * The impact of the content of the message. - */ - @Child(name="category", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) - protected Enumeration category; - - /** - * The mode of this event declaration - whether application is sender or receiver. - */ - @Child(name="mode", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." ) - protected Enumeration mode; - - /** - * A list of the messaging transport protocol(s) identifiers, supported by this endpoint. - */ - @Child(name="protocol", type={Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." ) - protected List protocol; - - /** - * A resource associated with the event. This is the resource that defines the event. - */ - @Child(name="focus", type={CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event. This is the resource that defines the event." ) - protected CodeType focus; - - /** - * Information about the request for this event. - */ - @Child(name="request", type={Profile.class}, order=6, min=1, max=1) - @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Information about the request for this event.) - */ - protected Profile requestTarget; - - /** - * Information about the response for this event. - */ - @Child(name="response", type={Profile.class}, order=7, min=1, max=1) - @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Information about the response for this event.) - */ - protected Profile responseTarget; - - /** - * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - @Child(name="documentation", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." ) - protected StringType documentation; - - private static final long serialVersionUID = 758007981L; - - public ConformanceMessagingEventComponent() { - super(); - } - - public ConformanceMessagingEventComponent(Coding code, Enumeration mode, CodeType focus, Reference request, Reference response) { - super(); - this.code = code; - this.mode = mode; - this.focus = focus; - this.request = request; - this.response = response; - } - - /** - * @return {@link #code} (A coded identifier of a supported messaging event.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A coded identifier of a supported messaging event.) - */ - public ConformanceMessagingEventComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(); - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public ConformanceMessagingEventComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return The impact of the content of the message. - */ - public MessageSignificanceCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value The impact of the content of the message. - */ - public ConformanceMessagingEventComponent setCategory(MessageSignificanceCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(MessageSignificanceCategory.ENUM_FACTORY); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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 mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceMessagingEventComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return The mode of this event declaration - whether application is sender or receiver. - */ - public MessageConformanceEventMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value The mode of this event declaration - whether application is sender or receiver. - */ - public ConformanceMessagingEventComponent setMode(MessageConformanceEventMode value) { - if (this.mode == null) - this.mode = new Enumeration(MessageConformanceEventMode.ENUM_FACTORY); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) - */ - public List getProtocol() { - if (this.protocol == null) - this.protocol = new ArrayList(); - return this.protocol; - } - - public boolean hasProtocol() { - if (this.protocol == null) - return false; - for (Coding item : this.protocol) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) - */ - // syntactic sugar - public Coding addProtocol() { //3 - Coding t = new Coding(); - if (this.protocol == null) - this.protocol = new ArrayList(); - this.protocol.add(t); - return t; - } - - /** - * @return {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value - */ - public CodeType getFocusElement() { - if (this.focus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.focus"); - else if (Configuration.doAutoCreate()) - this.focus = new CodeType(); - return this.focus; - } - - public boolean hasFocusElement() { - return this.focus != null && !this.focus.isEmpty(); - } - - public boolean hasFocus() { - return this.focus != null && !this.focus.isEmpty(); - } - - /** - * @param value {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value - */ - public ConformanceMessagingEventComponent setFocusElement(CodeType value) { - this.focus = value; - return this; - } - - /** - * @return A resource associated with the event. This is the resource that defines the event. - */ - public String getFocus() { - return this.focus == null ? null : this.focus.getValue(); - } - - /** - * @param value A resource associated with the event. This is the resource that defines the event. - */ - public ConformanceMessagingEventComponent setFocus(String value) { - if (this.focus == null) - this.focus = new CodeType(); - this.focus.setValue(value); - return this; - } - - /** - * @return {@link #request} (Information about the request for this event.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Information about the request for this event.) - */ - public ConformanceMessagingEventComponent setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Information about the request for this event.) - */ - public Profile getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Profile(); - 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. (Information about the request for this event.) - */ - public ConformanceMessagingEventComponent setRequestTarget(Profile value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Information about the response for this event.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Information about the response for this event.) - */ - public ConformanceMessagingEventComponent setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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. (Information about the response for this event.) - */ - public Profile getResponseTarget() { - if (this.responseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); - else if (Configuration.doAutoCreate()) - this.responseTarget = new Profile(); - return this.responseTarget; - } - - /** - * @param value {@link #response} 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. (Information about the response for this event.) - */ - public ConformanceMessagingEventComponent setResponseTarget(Profile value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). 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 ConformanceMessagingEventComponent.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} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceMessagingEventComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - public ConformanceMessagingEventComponent 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; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("focus", "code", "A resource associated with the event. This is the resource that defines the event.", 0, java.lang.Integer.MAX_VALUE, focus)); - childrenList.add(new Property("request", "Reference(Profile)", "Information about the request for this event.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Profile)", "Information about the response for this event.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - public ConformanceMessagingEventComponent copy() { - ConformanceMessagingEventComponent dst = new ConformanceMessagingEventComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.category = category == null ? null : category.copy(); - dst.mode = mode == null ? null : mode.copy(); - if (protocol != null) { - dst.protocol = new ArrayList(); - for (Coding i : protocol) - dst.protocol.add(i.copy()); - }; - dst.focus = focus == null ? null : focus.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) - && (mode == null || mode.isEmpty()) && (protocol == null || protocol.isEmpty()) && (focus == null || focus.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - } - - @Block() - public static class ConformanceDocumentComponent extends BackboneElement { - /** - * Mode of this document declaration - whether application is producer or consumer. - */ - @Child(name="mode", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether application is producer or consumer." ) - protected Enumeration mode; - - /** - * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc." ) - protected StringType documentation; - - /** - * A constraint on a resource used in the document. - */ - @Child(name="profile", type={Profile.class}, order=3, min=1, max=1) - @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A constraint on a resource used in the document.) - */ - protected Profile profileTarget; - - private static final long serialVersionUID = 437404016L; - - public ConformanceDocumentComponent() { - super(); - } - - public ConformanceDocumentComponent(Enumeration mode, Reference profile) { - super(); - this.mode = mode; - this.profile = profile; - } - - /** - * @return {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceDocumentComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Mode of this document declaration - whether application is producer or consumer. - */ - public DocumentMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Mode of this document declaration - whether application is producer or consumer. - */ - public ConformanceDocumentComponent setMode(DocumentMode value) { - if (this.mode == null) - this.mode = new Enumeration(DocumentMode.ENUM_FACTORY); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). 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 ConformanceDocumentComponent.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} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceDocumentComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - public ConformanceDocumentComponent 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 #profile} (A constraint on a resource used in the document.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.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 constraint on a resource used in the document.) - */ - public ConformanceDocumentComponent 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 constraint on a resource used in the document.) - */ - public Profile getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.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 constraint on a resource used in the document.) - */ - public ConformanceDocumentComponent setProfileTarget(Profile value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Mode of this document declaration - whether application is producer or consumer.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("profile", "Reference(Profile)", "A constraint on a resource used in the document.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - public ConformanceDocumentComponent copy() { - ConformanceDocumentComponent dst = new ConformanceDocumentComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (profile == null || profile.isEmpty()); - } - - } - - /** - * The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - @Child(name="identifier", type={StringType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Logical id to reference this statement", formalDefinition="The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) - protected StringType identifier; - - /** - * The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the statement", formalDefinition="The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name identifying the conformance statement. - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Informal name for this conformance statement", formalDefinition="A free text natural language name identifying the conformance statement." ) - protected StringType name; - - /** - * Name of Organization publishing this conformance statement. - */ - @Child(name="publisher", type={StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Publishing Organization", formalDefinition="Name of Organization publishing this conformance statement." ) - protected StringType publisher; - - /** - * Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contacts for Organization", formalDefinition="Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc." ) - protected List telecom; - - /** - * A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human description of the conformance statement", formalDefinition="A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP." ) - protected StringType description; - - /** - * The status of this conformance statement. - */ - @Child(name="status", type={CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this conformance statement." ) - protected Enumeration status; - - /** - * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name="experimental", type={BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date (and optionally time) when the conformance statement was published. - */ - @Child(name="date", type={DateTimeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the conformance statement was published." ) - protected DateTimeType date; - - /** - * Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation. - */ - @Child(name="software", type={}, order=8, min=0, max=1) - @Description(shortDefinition="Software that is covered by this conformance statement", formalDefinition="Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation." ) - protected ConformanceSoftwareComponent software; - - /** - * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. - */ - @Child(name="implementation", type={}, order=9, min=0, max=1) - @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program." ) - protected ConformanceImplementationComponent implementation; - - /** - * The version of the FHIR specification on which this conformance statement is based. - */ - @Child(name="fhirVersion", type={IdType.class}, order=10, min=1, max=1) - @Description(shortDefinition="FHIR Version", formalDefinition="The version of the FHIR specification on which this conformance statement is based." ) - protected IdType fhirVersion; - - /** - * A flag that indicates whether the application accepts unknown elements as part of a resource. - */ - @Child(name="acceptUnknown", type={BooleanType.class}, order=11, min=1, max=1) - @Description(shortDefinition="True if application accepts unknown elements", formalDefinition="A flag that indicates whether the application accepts unknown elements as part of a resource." ) - protected BooleanType acceptUnknown; - - /** - * A list of the formats supported by this implementation. - */ - @Child(name="format", type={CodeType.class}, order=12, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="formats supported (xml | json | mime type)", formalDefinition="A list of the formats supported by this implementation." ) - protected List format; - - /** - * A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. - */ - @Child(name="profile", type={Profile.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Profiles supported by the system", formalDefinition="A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile." ) - protected List profile; - /** - * The actual objects that are the target of the reference (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - protected List profileTarget; - - - /** - * A definition of the restful capabilities of the solution, if any. - */ - @Child(name="rest", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) - protected List rest; - - /** - * A description of the messaging capabilities of the solution. - */ - @Child(name="messaging", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) - protected List messaging; - - /** - * A document definition. - */ - @Child(name="document", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) - protected List document; - - private static final long serialVersionUID = 1215207759L; - - public Conformance() { - super(); - } - - public Conformance(StringType publisher, DateTimeType date, IdType fhirVersion, BooleanType acceptUnknown) { - super(); - this.publisher = publisher; - this.date = date; - this.fhirVersion = fhirVersion; - this.acceptUnknown = acceptUnknown; - } - - /** - * @return {@link #identifier} (The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public Conformance setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public Conformance setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Conformance setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public Conformance setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Conformance setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the conformance statement. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the conformance statement. - */ - public Conformance setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (Name of Organization publishing this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Name of Organization publishing this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Conformance setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Name of Organization publishing this conformance statement. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Name of Organization publishing this conformance statement. - */ - public Conformance setPublisher(String value) { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - return this; - } - - /** - * @return {@link #telecom} (Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). 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 Conformance.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} (A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Conformance setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - public Conformance setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Conformance setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this conformance statement. - */ - public ConformanceStatementStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this conformance statement. - */ - public Conformance setStatus(ConformanceStatementStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(ConformanceStatementStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public Conformance setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public Conformance setExperimental(boolean value) { - if (value == false) - this.experimental = null; - else { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Conformance setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the conformance statement was published. - */ - 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(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #software} (Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation.) - */ - public ConformanceSoftwareComponent getSoftware() { - if (this.software == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.software"); - else if (Configuration.doAutoCreate()) - this.software = new ConformanceSoftwareComponent(); - return this.software; - } - - public boolean hasSoftware() { - return this.software != null && !this.software.isEmpty(); - } - - /** - * @param value {@link #software} (Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation.) - */ - public Conformance setSoftware(ConformanceSoftwareComponent value) { - this.software = value; - return this; - } - - /** - * @return {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) - */ - public ConformanceImplementationComponent getImplementation() { - if (this.implementation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.implementation"); - else if (Configuration.doAutoCreate()) - this.implementation = new ConformanceImplementationComponent(); - return this.implementation; - } - - public boolean hasImplementation() { - return this.implementation != null && !this.implementation.isEmpty(); - } - - /** - * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) - */ - public Conformance setImplementation(ConformanceImplementationComponent value) { - this.implementation = value; - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public Conformance setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this conformance statement is based. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this conformance statement is based. - */ - public Conformance setFhirVersion(String value) { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - return this; - } - - /** - * @return {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value - */ - public BooleanType getAcceptUnknownElement() { - if (this.acceptUnknown == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.acceptUnknown"); - else if (Configuration.doAutoCreate()) - this.acceptUnknown = new BooleanType(); - return this.acceptUnknown; - } - - public boolean hasAcceptUnknownElement() { - return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); - } - - public boolean hasAcceptUnknown() { - return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); - } - - /** - * @param value {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value - */ - public Conformance setAcceptUnknownElement(BooleanType value) { - this.acceptUnknown = value; - return this; - } - - /** - * @return A flag that indicates whether the application accepts unknown elements as part of a resource. - */ - public boolean getAcceptUnknown() { - return this.acceptUnknown == null ? false : this.acceptUnknown.getValue(); - } - - /** - * @param value A flag that indicates whether the application accepts unknown elements as part of a resource. - */ - public Conformance setAcceptUnknown(boolean value) { - if (this.acceptUnknown == null) - this.acceptUnknown = new BooleanType(); - this.acceptUnknown.setValue(value); - return this; - } - - /** - * @return {@link #format} (A list of the formats supported by this implementation.) - */ - public List getFormat() { - if (this.format == null) - this.format = new ArrayList(); - return this.format; - } - - public boolean hasFormat() { - if (this.format == null) - return false; - for (CodeType item : this.format) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #format} (A list of the formats supported by this implementation.) - */ - // syntactic sugar - public CodeType addFormatElement() {//2 - CodeType t = new CodeType(); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return t; - } - - /** - * @param value {@link #format} (A list of the formats supported by this implementation.) - */ - public Conformance addFormat(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return this; - } - - /** - * @param value {@link #format} (A list of the formats supported by this implementation.) - */ - public boolean hasFormat(String value) { - if (this.format == null) - return false; - for (CodeType v : this.format) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (Reference item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - // syntactic sugar - public Reference addProfile() { //3 - Reference t = new Reference(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - /** - * @return {@link #profile} (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. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - public List getProfileTarget() { - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - return this.profileTarget; - } - - // syntactic sugar - /** - * @return {@link #profile} (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. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) - */ - public Profile addProfileTarget() { - Profile r = new Profile(); - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - this.profileTarget.add(r); - return r; - } - - /** - * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) - */ - public List getRest() { - if (this.rest == null) - this.rest = new ArrayList(); - return this.rest; - } - - public boolean hasRest() { - if (this.rest == null) - return false; - for (ConformanceRestComponent item : this.rest) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) - */ - // syntactic sugar - public ConformanceRestComponent addRest() { //3 - ConformanceRestComponent t = new ConformanceRestComponent(); - if (this.rest == null) - this.rest = new ArrayList(); - this.rest.add(t); - return t; - } - - /** - * @return {@link #messaging} (A description of the messaging capabilities of the solution.) - */ - public List getMessaging() { - if (this.messaging == null) - this.messaging = new ArrayList(); - return this.messaging; - } - - public boolean hasMessaging() { - if (this.messaging == null) - return false; - for (ConformanceMessagingComponent item : this.messaging) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #messaging} (A description of the messaging capabilities of the solution.) - */ - // syntactic sugar - public ConformanceMessagingComponent addMessaging() { //3 - ConformanceMessagingComponent t = new ConformanceMessagingComponent(); - if (this.messaging == null) - this.messaging = new ArrayList(); - this.messaging.add(t); - return t; - } - - /** - * @return {@link #document} (A document definition.) - */ - public List getDocument() { - if (this.document == null) - this.document = new ArrayList(); - return this.document; - } - - public boolean hasDocument() { - if (this.document == null) - return false; - for (ConformanceDocumentComponent item : this.document) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #document} (A document definition.) - */ - // syntactic sugar - public ConformanceDocumentComponent addDocument() { //3 - ConformanceDocumentComponent t = new ConformanceDocumentComponent(); - if (this.document == null) - this.document = new ArrayList(); - this.document.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "string", "The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the conformance statement.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "Name of Organization publishing this conformance statement.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("description", "string", "A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("status", "code", "The status of this conformance statement.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the conformance statement was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("software", "", "Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation.", 0, java.lang.Integer.MAX_VALUE, software)); - childrenList.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, java.lang.Integer.MAX_VALUE, implementation)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this conformance statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("acceptUnknown", "boolean", "A flag that indicates whether the application accepts unknown elements as part of a resource.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); - childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("profile", "Reference(Profile)", "A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); - childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); - childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); - } - - public Conformance copy() { - Conformance dst = new Conformance(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.software = software == null ? null : software.copy(); - dst.implementation = implementation == null ? null : implementation.copy(); - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy(); - if (format != null) { - dst.format = new ArrayList(); - for (CodeType i : format) - dst.format.add(i.copy()); - }; - if (profile != null) { - dst.profile = new ArrayList(); - for (Reference i : profile) - dst.profile.add(i.copy()); - }; - if (rest != null) { - dst.rest = new ArrayList(); - for (ConformanceRestComponent i : rest) - dst.rest.add(i.copy()); - }; - if (messaging != null) { - dst.messaging = new ArrayList(); - for (ConformanceMessagingComponent i : messaging) - dst.messaging.add(i.copy()); - }; - if (document != null) { - dst.document = new ArrayList(); - for (ConformanceDocumentComponent i : document) - dst.document.add(i.copy()); - }; - return dst; - } - - protected Conformance typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (software == null || software.isEmpty()) - && (implementation == null || implementation.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) - && (acceptUnknown == null || acceptUnknown.isEmpty()) && (format == null || format.isEmpty()) - && (profile == null || profile.isEmpty()) && (rest == null || rest.isEmpty()) && (messaging == null || messaging.isEmpty()) - && (document == null || document.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Conformance; - } - - @SearchParamDefinition(name="status", path="Conformance.status", description="The current status of the conformance statement", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="resource", path="Conformance.rest.resource.type", description="Name of a resource mentioned in a conformance statement", type="token" ) - public static final String SP_RESOURCE = "resource"; - @SearchParamDefinition(name="security", path="Conformance.rest.security", description="Information about security of implementation", type="token" ) - public static final String SP_SECURITY = "security"; - @SearchParamDefinition(name="format", path="Conformance.format", description="formats supported (xml | json | mime type)", type="token" ) - public static final String SP_FORMAT = "format"; - @SearchParamDefinition(name="date", path="Conformance.date", description="The conformance statement publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="version", path="Conformance.version", description="The version identifier of the conformance statement", type="token" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="Conformance.publisher", description="Name of the publisher of the conformance statement", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="mode", path="Conformance.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" ) - public static final String SP_MODE = "mode"; - @SearchParamDefinition(name="software", path="Conformance.software.name", description="Part of a the name of a software application", type="string" ) - public static final String SP_SOFTWARE = "software"; - @SearchParamDefinition(name="description", path="Conformance.description", description="Text search in the description of the conformance statement", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="event", path="Conformance.messaging.event.code", description="Event code in a conformance statement", type="token" ) - public static final String SP_EVENT = "event"; - @SearchParamDefinition(name="name", path="Conformance.name", description="Name of the conformance statement", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="supported-profile", path="Conformance.profile", description="Profiles supported by the system", type="reference" ) - public static final String SP_SUPPORTEDPROFILE = "supported-profile"; - @SearchParamDefinition(name="fhirversion", path="Conformance.version", description="The version of FHIR", type="token" ) - public static final String SP_FHIRVERSION = "fhirversion"; - @SearchParamDefinition(name="identifier", path="Conformance.identifier", description="The identifier of the conformance statement", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="profile", path="Conformance.rest.resource.profile", description="A profile id invoked in a conformance statement", type="reference" ) - public static final String SP_PROFILE = "profile"; - -} - + +/* + 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; +/** + * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + */ +@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") +public class Conformance extends DomainResource { + + public enum ConformanceStatementStatus implements FhirEnum { + /** + * This conformance statement is still under development. + */ + DRAFT, + /** + * This conformance statement is ready for use in production systems. + */ + ACTIVE, + /** + * This conformance statement has been withdrawn or superceded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This conformance statement is still under development."; + case ACTIVE: return "This conformance statement is ready for use in production systems."; + case RETIRED: return "This conformance statement has been withdrawn or superceded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class ConformanceStatementStatusEnumFactory implements EnumFactory { + public ConformanceStatementStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ConformanceStatementStatus.DRAFT; + if ("active".equals(codeString)) + return ConformanceStatementStatus.ACTIVE; + if ("retired".equals(codeString)) + return ConformanceStatementStatus.RETIRED; + throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'"); + } + public String toCode(ConformanceStatementStatus code) throws IllegalArgumentException { + if (code == ConformanceStatementStatus.DRAFT) + return "draft"; + if (code == ConformanceStatementStatus.ACTIVE) + return "active"; + if (code == ConformanceStatementStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum RestfulConformanceMode implements FhirEnum { + /** + * The application acts as a server for this resource. + */ + CLIENT, + /** + * The application acts as a client for this resource. + */ + SERVER, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CLIENT: return "client"; + case SERVER: return "server"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CLIENT: return ""; + case SERVER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CLIENT: return "The application acts as a server for this resource."; + case SERVER: return "The application acts as a client for this resource."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CLIENT: return "client"; + case SERVER: return "server"; + default: return "?"; + } + } + } + + public static class RestfulConformanceModeEnumFactory implements EnumFactory { + public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("client".equals(codeString)) + return RestfulConformanceMode.CLIENT; + if ("server".equals(codeString)) + return RestfulConformanceMode.SERVER; + throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); + } + public String toCode(RestfulConformanceMode code) throws IllegalArgumentException { + if (code == RestfulConformanceMode.CLIENT) + return "client"; + if (code == RestfulConformanceMode.SERVER) + return "server"; + return "?"; + } + } + + public enum TypeRestfulInteraction implements FhirEnum { + /** + * + */ + READ, + /** + * + */ + VREAD, + /** + * + */ + UPDATE, + /** + * + */ + DELETE, + /** + * + */ + HISTORYINSTANCE, + /** + * + */ + VALIDATE, + /** + * + */ + HISTORYTYPE, + /** + * + */ + CREATE, + /** + * + */ + SEARCHTYPE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return READ; + if ("vread".equals(codeString)) + return VREAD; + if ("update".equals(codeString)) + return UPDATE; + if ("delete".equals(codeString)) + return DELETE; + if ("history-instance".equals(codeString)) + return HISTORYINSTANCE; + if ("validate".equals(codeString)) + return VALIDATE; + if ("history-type".equals(codeString)) + return HISTORYTYPE; + if ("create".equals(codeString)) + return CREATE; + if ("search-type".equals(codeString)) + return SEARCHTYPE; + throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORYINSTANCE: return "history-instance"; + case VALIDATE: return "validate"; + case HISTORYTYPE: return "history-type"; + case CREATE: return "create"; + case SEARCHTYPE: return "search-type"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case READ: return "http://hl7.org/fhir/restful-interaction"; + case VREAD: return "http://hl7.org/fhir/restful-interaction"; + case UPDATE: return "http://hl7.org/fhir/restful-interaction"; + case DELETE: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; + case VALIDATE: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; + case CREATE: return "http://hl7.org/fhir/restful-interaction"; + case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case READ: return ""; + case VREAD: return ""; + case UPDATE: return ""; + case DELETE: return ""; + case HISTORYINSTANCE: return ""; + case VALIDATE: return ""; + case HISTORYTYPE: return ""; + case CREATE: return ""; + case SEARCHTYPE: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case READ: return "read"; + case VREAD: return "vread"; + case UPDATE: return "update"; + case DELETE: return "delete"; + case HISTORYINSTANCE: return "history-instance"; + case VALIDATE: return "validate"; + case HISTORYTYPE: return "history-type"; + case CREATE: return "create"; + case SEARCHTYPE: return "search-type"; + default: return "?"; + } + } + } + + public static class TypeRestfulInteractionEnumFactory implements EnumFactory { + public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("read".equals(codeString)) + return TypeRestfulInteraction.READ; + if ("vread".equals(codeString)) + return TypeRestfulInteraction.VREAD; + if ("update".equals(codeString)) + return TypeRestfulInteraction.UPDATE; + if ("delete".equals(codeString)) + return TypeRestfulInteraction.DELETE; + if ("history-instance".equals(codeString)) + return TypeRestfulInteraction.HISTORYINSTANCE; + if ("validate".equals(codeString)) + return TypeRestfulInteraction.VALIDATE; + if ("history-type".equals(codeString)) + return TypeRestfulInteraction.HISTORYTYPE; + if ("create".equals(codeString)) + return TypeRestfulInteraction.CREATE; + if ("search-type".equals(codeString)) + return TypeRestfulInteraction.SEARCHTYPE; + throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); + } + public String toCode(TypeRestfulInteraction code) throws IllegalArgumentException { + if (code == TypeRestfulInteraction.READ) + return "read"; + if (code == TypeRestfulInteraction.VREAD) + return "vread"; + if (code == TypeRestfulInteraction.UPDATE) + return "update"; + if (code == TypeRestfulInteraction.DELETE) + return "delete"; + if (code == TypeRestfulInteraction.HISTORYINSTANCE) + return "history-instance"; + if (code == TypeRestfulInteraction.VALIDATE) + return "validate"; + if (code == TypeRestfulInteraction.HISTORYTYPE) + return "history-type"; + if (code == TypeRestfulInteraction.CREATE) + return "create"; + if (code == TypeRestfulInteraction.SEARCHTYPE) + return "search-type"; + return "?"; + } + } + + public enum VersioningPolicy implements FhirEnum { + /** + * VersionId meta-property is not suppoerted (server) or used (client). + */ + NOVERSION, + /** + * VersionId meta-property is suppoerted (server) or used (client). + */ + VERSIONED, + /** + * VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). + */ + VERSIONEDUPDATE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return NOVERSION; + if ("versioned".equals(codeString)) + return VERSIONED; + if ("versioned-update".equals(codeString)) + return VERSIONEDUPDATE; + throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NOVERSION: return "no-version"; + case VERSIONED: return "versioned"; + case VERSIONEDUPDATE: return "versioned-update"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOVERSION: return ""; + case VERSIONED: return ""; + case VERSIONEDUPDATE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOVERSION: return "VersionId meta-property is not suppoerted (server) or used (client)."; + case VERSIONED: return "VersionId meta-property is suppoerted (server) or used (client)."; + case VERSIONEDUPDATE: return "VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOVERSION: return "No VersionId Support"; + case VERSIONED: return "Versioned"; + case VERSIONEDUPDATE: return "VersionId tracked fully"; + default: return "?"; + } + } + } + + public static class VersioningPolicyEnumFactory implements EnumFactory { + public VersioningPolicy fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("no-version".equals(codeString)) + return VersioningPolicy.NOVERSION; + if ("versioned".equals(codeString)) + return VersioningPolicy.VERSIONED; + if ("versioned-update".equals(codeString)) + return VersioningPolicy.VERSIONEDUPDATE; + throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); + } + public String toCode(VersioningPolicy code) throws IllegalArgumentException { + if (code == VersioningPolicy.NOVERSION) + return "no-version"; + if (code == VersioningPolicy.VERSIONED) + return "versioned"; + if (code == VersioningPolicy.VERSIONEDUPDATE) + return "versioned-update"; + return "?"; + } + } + + public enum SearchParamType implements FhirEnum { + /** + * Search parameter SHALL be a number (a whole number, or a decimal). + */ + NUMBER, + /** + * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. + */ + DATE, + /** + * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. + */ + STRING, + /** + * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. + */ + TOKEN, + /** + * A reference to another resource. + */ + REFERENCE, + /** + * A composite search parameter that combines a search on two values together. + */ + COMPOSITE, + /** + * A search parameter that searches on a quantity. + */ + QUANTITY, + /** + * added to help the parsers + */ + NULL; + + 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)) + return NUMBER; + if ("date".equals(codeString)) + return DATE; + if ("string".equals(codeString)) + return STRING; + if ("token".equals(codeString)) + return TOKEN; + if ("reference".equals(codeString)) + return REFERENCE; + if ("composite".equals(codeString)) + return COMPOSITE; + if ("quantity".equals(codeString)) + return QUANTITY; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NUMBER: return ""; + case DATE: return ""; + case STRING: return ""; + case TOKEN: return ""; + case REFERENCE: return ""; + case COMPOSITE: return ""; + case QUANTITY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; + case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; + case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; + case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; + case REFERENCE: return "A reference to another resource."; + case COMPOSITE: return "A composite search parameter that combines a search on two values together."; + case QUANTITY: return "A search parameter that searches on a quantity."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + } + + public static class SearchParamTypeEnumFactory implements EnumFactory { + public SearchParamType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return SearchParamType.NUMBER; + if ("date".equals(codeString)) + return SearchParamType.DATE; + if ("string".equals(codeString)) + return SearchParamType.STRING; + if ("token".equals(codeString)) + return SearchParamType.TOKEN; + if ("reference".equals(codeString)) + return SearchParamType.REFERENCE; + if ("composite".equals(codeString)) + return SearchParamType.COMPOSITE; + if ("quantity".equals(codeString)) + return SearchParamType.QUANTITY; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode(SearchParamType code) throws IllegalArgumentException { + if (code == SearchParamType.NUMBER) + return "number"; + if (code == SearchParamType.DATE) + return "date"; + if (code == SearchParamType.STRING) + return "string"; + if (code == SearchParamType.TOKEN) + return "token"; + if (code == SearchParamType.REFERENCE) + return "reference"; + if (code == SearchParamType.COMPOSITE) + return "composite"; + if (code == SearchParamType.QUANTITY) + return "quantity"; + return "?"; + } + } + + public enum SystemRestfulInteraction implements FhirEnum { + /** + * + */ + TRANSACTION, + /** + * + */ + SEARCHSYSTEM, + /** + * + */ + HISTORYSYSTEM, + /** + * added to help the parsers + */ + NULL; + + 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)) + return TRANSACTION; + if ("search-system".equals(codeString)) + return SEARCHSYSTEM; + if ("history-system".equals(codeString)) + return HISTORYSYSTEM; + throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case TRANSACTION: return "transaction"; + case SEARCHSYSTEM: return "search-system"; + case HISTORYSYSTEM: return "history-system"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case TRANSACTION: return "http://hl7.org/fhir/restful-interaction"; + case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction"; + case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case TRANSACTION: return ""; + case SEARCHSYSTEM: return ""; + case HISTORYSYSTEM: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case TRANSACTION: return "transaction"; + case SEARCHSYSTEM: return "search-system"; + case HISTORYSYSTEM: return "history-system"; + default: return "?"; + } + } + } + + public static class SystemRestfulInteractionEnumFactory implements EnumFactory { + public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("transaction".equals(codeString)) + return SystemRestfulInteraction.TRANSACTION; + if ("search-system".equals(codeString)) + return SystemRestfulInteraction.SEARCHSYSTEM; + if ("history-system".equals(codeString)) + return SystemRestfulInteraction.HISTORYSYSTEM; + throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); + } + public String toCode(SystemRestfulInteraction code) throws IllegalArgumentException { + if (code == SystemRestfulInteraction.TRANSACTION) + return "transaction"; + if (code == SystemRestfulInteraction.SEARCHSYSTEM) + return "search-system"; + if (code == SystemRestfulInteraction.HISTORYSYSTEM) + return "history-system"; + return "?"; + } + } + + 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. + */ + CONSEQUENCE, + /** + * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. + */ + CURRENCY, + /** + * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. + */ + NOTIFICATION, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CONSEQUENCE; + if ("Currency".equals(codeString)) + return CURRENCY; + if ("Notification".equals(codeString)) + return NOTIFICATION; + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONSEQUENCE: return ""; + case CURRENCY: return ""; + case NOTIFICATION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment."; + case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; + case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONSEQUENCE: return "Consequence"; + case CURRENCY: return "Currency"; + case NOTIFICATION: return "Notification"; + default: return "?"; + } + } + } + + public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { + public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("Consequence".equals(codeString)) + return MessageSignificanceCategory.CONSEQUENCE; + if ("Currency".equals(codeString)) + return MessageSignificanceCategory.CURRENCY; + if ("Notification".equals(codeString)) + return MessageSignificanceCategory.NOTIFICATION; + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); + } + public String toCode(MessageSignificanceCategory code) throws IllegalArgumentException { + if (code == MessageSignificanceCategory.CONSEQUENCE) + return "Consequence"; + if (code == MessageSignificanceCategory.CURRENCY) + return "Currency"; + if (code == MessageSignificanceCategory.NOTIFICATION) + return "Notification"; + return "?"; + } + } + + public enum MessageConformanceEventMode implements FhirEnum { + /** + * The application sends requests and receives responses. + */ + SENDER, + /** + * The application receives requests and sends responses. + */ + RECEIVER, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case SENDER: return "sender"; + case RECEIVER: return "receiver"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case SENDER: return ""; + case RECEIVER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case SENDER: return "The application sends requests and receives responses."; + case RECEIVER: return "The application receives requests and sends responses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case SENDER: return "sender"; + case RECEIVER: return "receiver"; + default: return "?"; + } + } + } + + public static class MessageConformanceEventModeEnumFactory implements EnumFactory { + public MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("sender".equals(codeString)) + return MessageConformanceEventMode.SENDER; + if ("receiver".equals(codeString)) + return MessageConformanceEventMode.RECEIVER; + throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); + } + public String toCode(MessageConformanceEventMode code) throws IllegalArgumentException { + if (code == MessageConformanceEventMode.SENDER) + return "sender"; + if (code == MessageConformanceEventMode.RECEIVER) + return "receiver"; + return "?"; + } + } + + public enum DocumentMode implements FhirEnum { + /** + * The application produces documents of the specified type. + */ + PRODUCER, + /** + * The application consumes documents of the specified type. + */ + CONSUMER, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PRODUCER: return "producer"; + case CONSUMER: return "consumer"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRODUCER: return ""; + case CONSUMER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRODUCER: return "The application produces documents of the specified type."; + case CONSUMER: return "The application consumes documents of the specified type."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRODUCER: return "producer"; + case CONSUMER: return "consumer"; + default: return "?"; + } + } + } + + public static class DocumentModeEnumFactory implements EnumFactory { + public DocumentMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("producer".equals(codeString)) + return DocumentMode.PRODUCER; + if ("consumer".equals(codeString)) + return DocumentMode.CONSUMER; + throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); + } + public String toCode(DocumentMode code) throws IllegalArgumentException { + if (code == DocumentMode.PRODUCER) + return "producer"; + if (code == DocumentMode.CONSUMER) + return "consumer"; + return "?"; + } + } + + @Block() + public static class ConformanceSoftwareComponent extends BackboneElement { + /** + * Name software is known by. + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." ) + protected StringType name; + + /** + * The version identifier for the software covered by this statement. + */ + @Child(name="version", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." ) + protected StringType version; + + /** + * Date this version of the software released. + */ + @Child(name="releaseDate", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software released." ) + protected DateTimeType releaseDate; + + private static final long serialVersionUID = 1819769027L; + + public ConformanceSoftwareComponent() { + super(); + } + + public ConformanceSoftwareComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceSoftwareComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name software is known by. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name software is known by. + */ + public ConformanceSoftwareComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConformanceSoftwareComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version identifier for the software covered by this statement. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version identifier for the software covered by this statement. + */ + public ConformanceSoftwareComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value + */ + public DateTimeType getReleaseDateElement() { + if (this.releaseDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceSoftwareComponent.releaseDate"); + else if (Configuration.doAutoCreate()) + this.releaseDate = new DateTimeType(); + return this.releaseDate; + } + + public boolean hasReleaseDateElement() { + return this.releaseDate != null && !this.releaseDate.isEmpty(); + } + + public boolean hasReleaseDate() { + return this.releaseDate != null && !this.releaseDate.isEmpty(); + } + + /** + * @param value {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value + */ + public ConformanceSoftwareComponent setReleaseDateElement(DateTimeType value) { + this.releaseDate = value; + return this; + } + + /** + * @return Date this version of the software released. + */ + public Date getReleaseDate() { + return this.releaseDate == null ? null : this.releaseDate.getValue(); + } + + /** + * @param value Date this version of the software released. + */ + public ConformanceSoftwareComponent setReleaseDate(Date value) { + if (value == null) + this.releaseDate = null; + else { + if (this.releaseDate == null) + this.releaseDate = new DateTimeType(); + this.releaseDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Name software is known by.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("releaseDate", "dateTime", "Date this version of the software released.", 0, java.lang.Integer.MAX_VALUE, releaseDate)); + } + + public ConformanceSoftwareComponent copy() { + ConformanceSoftwareComponent dst = new ConformanceSoftwareComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.version = version == null ? null : version.copy(); + dst.releaseDate = releaseDate == null ? null : releaseDate.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (version == null || version.isEmpty()) + && (releaseDate == null || releaseDate.isEmpty()); + } + + } + + @Block() + public static class ConformanceImplementationComponent extends BackboneElement { + /** + * Information about the specific installation that this conformance statement relates to. + */ + @Child(name="description", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this conformance statement relates to." ) + protected StringType description; + + /** + * A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + @Child(name="url", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Base URL for the installation", formalDefinition="A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." ) + protected UriType url; + + private static final long serialVersionUID = -289238508L; + + public ConformanceImplementationComponent() { + super(); + } + + public ConformanceImplementationComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (Information about the specific installation that this conformance statement relates to.). 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 ConformanceImplementationComponent.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} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConformanceImplementationComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Information about the specific installation that this conformance statement relates to. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Information about the specific installation that this conformance statement relates to. + */ + public ConformanceImplementationComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #url} (A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceImplementationComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ConformanceImplementationComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + */ + public ConformanceImplementationComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Information about the specific installation that this conformance statement relates to.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("url", "uri", "A base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public ConformanceImplementationComponent copy() { + ConformanceImplementationComponent dst = new ConformanceImplementationComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.url = url == null ? null : url.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestComponent extends BackboneElement { + /** + * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + @Child(name="mode", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations." ) + protected Enumeration mode; + + /** + * Information about the system's restful capabilities that apply across all applications, such as security. + */ + @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." ) + protected StringType documentation; + + /** + * Information about security of implementation. + */ + @Child(name="security", type={}, order=3, min=0, max=1) + @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security of implementation." ) + protected ConformanceRestSecurityComponent security; + + /** + * A specification of the restful capabilities of the solution for a specific resource type. + */ + @Child(name="resource", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." ) + protected List resource; + + /** + * A specification of restful operations supported by the system. + */ + @Child(name="interaction", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." ) + protected List interaction; + + /** + * Definition of an operation or a named query and with its parameters and their meaning and type. + */ + @Child(name="operation", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query and with its parameters and their meaning and type." ) + protected List operation; + + /** + * A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose. + */ + @Child(name="documentMailbox", type={UriType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="How documents are accepted in /Mailbox", formalDefinition="A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose." ) + protected List documentMailbox; + + private static final long serialVersionUID = 777542519L; + + public ConformanceRestComponent() { + super(); + } + + public ConformanceRestComponent(Enumeration mode) { + super(); + this.mode = mode; + } + + /** + * @return {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceRestComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + public RestfulConformanceMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + */ + public ConformanceRestComponent setMode(RestfulConformanceMode value) { + if (this.mode == null) + this.mode = new Enumeration(RestfulConformanceMode.ENUM_FACTORY); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). 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 ConformanceRestComponent.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} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceRestComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Information about the system's restful capabilities that apply across all applications, such as security. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Information about the system's restful capabilities that apply across all applications, such as security. + */ + public ConformanceRestComponent 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 #security} (Information about security of implementation.) + */ + public ConformanceRestSecurityComponent getSecurity() { + if (this.security == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestComponent.security"); + else if (Configuration.doAutoCreate()) + this.security = new ConformanceRestSecurityComponent(); + return this.security; + } + + public boolean hasSecurity() { + return this.security != null && !this.security.isEmpty(); + } + + /** + * @param value {@link #security} (Information about security of implementation.) + */ + public ConformanceRestComponent setSecurity(ConformanceRestSecurityComponent value) { + this.security = value; + return this; + } + + /** + * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) + */ + public List getResource() { + if (this.resource == null) + this.resource = new ArrayList(); + return this.resource; + } + + public boolean hasResource() { + if (this.resource == null) + return false; + for (ConformanceRestResourceComponent item : this.resource) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) + */ + // syntactic sugar + public ConformanceRestResourceComponent addResource() { //3 + ConformanceRestResourceComponent t = new ConformanceRestResourceComponent(); + if (this.resource == null) + this.resource = new ArrayList(); + this.resource.add(t); + return t; + } + + /** + * @return {@link #interaction} (A specification of restful operations supported by the system.) + */ + public List getInteraction() { + if (this.interaction == null) + this.interaction = new ArrayList(); + return this.interaction; + } + + public boolean hasInteraction() { + if (this.interaction == null) + return false; + for (SystemInteractionComponent item : this.interaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interaction} (A specification of restful operations supported by the system.) + */ + // syntactic sugar + public SystemInteractionComponent addInteraction() { //3 + SystemInteractionComponent t = new SystemInteractionComponent(); + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return t; + } + + /** + * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) + */ + public List getOperation() { + if (this.operation == null) + this.operation = new ArrayList(); + return this.operation; + } + + public boolean hasOperation() { + if (this.operation == null) + return false; + for (ConformanceRestOperationComponent item : this.operation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) + */ + // syntactic sugar + public ConformanceRestOperationComponent addOperation() { //3 + ConformanceRestOperationComponent t = new ConformanceRestOperationComponent(); + if (this.operation == null) + this.operation = new ArrayList(); + this.operation.add(t); + return t; + } + + /** + * @return {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + public List getDocumentMailbox() { + if (this.documentMailbox == null) + this.documentMailbox = new ArrayList(); + return this.documentMailbox; + } + + public boolean hasDocumentMailbox() { + if (this.documentMailbox == null) + return false; + for (UriType item : this.documentMailbox) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + // syntactic sugar + public UriType addDocumentMailboxElement() {//2 + UriType t = new UriType(); + if (this.documentMailbox == null) + this.documentMailbox = new ArrayList(); + this.documentMailbox.add(t); + return t; + } + + /** + * @param value {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + public ConformanceRestComponent addDocumentMailbox(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.documentMailbox == null) + this.documentMailbox = new ArrayList(); + this.documentMailbox.add(t); + return this; + } + + /** + * @param value {@link #documentMailbox} (A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.) + */ + public boolean hasDocumentMailbox(String value) { + if (this.documentMailbox == null) + return false; + for (UriType v : this.documentMailbox) + if (v.equals(value)) // uri + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("security", "", "Information about security of implementation.", 0, java.lang.Integer.MAX_VALUE, security)); + childrenList.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction)); + childrenList.add(new Property("operation", "", "Definition of an operation or a named query and with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation)); + childrenList.add(new Property("documentMailbox", "uri", "A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier 'http://hl7.org/fhir/documents/mailbox'. Other specifications can declare their own identifier for this purpose.", 0, java.lang.Integer.MAX_VALUE, documentMailbox)); + } + + public ConformanceRestComponent copy() { + ConformanceRestComponent dst = new ConformanceRestComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.security = security == null ? null : security.copy(); + if (resource != null) { + dst.resource = new ArrayList(); + for (ConformanceRestResourceComponent i : resource) + dst.resource.add(i.copy()); + }; + if (interaction != null) { + dst.interaction = new ArrayList(); + for (SystemInteractionComponent i : interaction) + dst.interaction.add(i.copy()); + }; + if (operation != null) { + dst.operation = new ArrayList(); + for (ConformanceRestOperationComponent i : operation) + dst.operation.add(i.copy()); + }; + if (documentMailbox != null) { + dst.documentMailbox = new ArrayList(); + for (UriType i : documentMailbox) + dst.documentMailbox.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (security == null || security.isEmpty()) && (resource == null || resource.isEmpty()) && (interaction == null || interaction.isEmpty()) + && (operation == null || operation.isEmpty()) && (documentMailbox == null || documentMailbox.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestSecurityComponent extends BackboneElement { + /** + * Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + @Child(name="cors", type={BooleanType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." ) + protected BooleanType cors; + + /** + * Types of security services are supported/required by the system. + */ + @Child(name="service", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="OAuth | OAuth2 | NTLM | Basic | Kerberos", formalDefinition="Types of security services are supported/required by the system." ) + protected List service; + + /** + * General description of how security works. + */ + @Child(name="description", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." ) + protected StringType description; + + /** + * Certificates associated with security profiles. + */ + @Child(name="certificate", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." ) + protected List certificate; + + private static final long serialVersionUID = 391663952L; + + public ConformanceRestSecurityComponent() { + super(); + } + + /** + * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value + */ + public BooleanType getCorsElement() { + if (this.cors == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.cors"); + else if (Configuration.doAutoCreate()) + this.cors = new BooleanType(); + return this.cors; + } + + public boolean hasCorsElement() { + return this.cors != null && !this.cors.isEmpty(); + } + + public boolean hasCors() { + return this.cors != null && !this.cors.isEmpty(); + } + + /** + * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value + */ + public ConformanceRestSecurityComponent setCorsElement(BooleanType value) { + this.cors = value; + return this; + } + + /** + * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + public boolean getCors() { + return this.cors == null ? false : this.cors.getValue(); + } + + /** + * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + */ + public ConformanceRestSecurityComponent setCors(boolean value) { + if (value == false) + this.cors = null; + else { + if (this.cors == null) + this.cors = new BooleanType(); + this.cors.setValue(value); + } + return this; + } + + /** + * @return {@link #service} (Types of security services are supported/required by the system.) + */ + public List getService() { + if (this.service == null) + this.service = new ArrayList(); + return this.service; + } + + public boolean hasService() { + if (this.service == null) + return false; + for (CodeableConcept item : this.service) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #service} (Types of security services are supported/required by the system.) + */ + // syntactic sugar + public CodeableConcept addService() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.service == null) + this.service = new ArrayList(); + this.service.add(t); + return t; + } + + /** + * @return {@link #description} (General description of how security works.). 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 ConformanceRestSecurityComponent.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} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ConformanceRestSecurityComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return General description of how security works. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value General description of how security works. + */ + public ConformanceRestSecurityComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #certificate} (Certificates associated with security profiles.) + */ + public List getCertificate() { + if (this.certificate == null) + this.certificate = new ArrayList(); + return this.certificate; + } + + public boolean hasCertificate() { + if (this.certificate == null) + return false; + for (ConformanceRestSecurityCertificateComponent item : this.certificate) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #certificate} (Certificates associated with security profiles.) + */ + // syntactic sugar + public ConformanceRestSecurityCertificateComponent addCertificate() { //3 + ConformanceRestSecurityCertificateComponent t = new ConformanceRestSecurityCertificateComponent(); + if (this.certificate == null) + this.certificate = new ArrayList(); + this.certificate.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, java.lang.Integer.MAX_VALUE, cors)); + childrenList.add(new Property("service", "CodeableConcept", "Types of security services are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("description", "string", "General description of how security works.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate)); + } + + public ConformanceRestSecurityComponent copy() { + ConformanceRestSecurityComponent dst = new ConformanceRestSecurityComponent(); + copyValues(dst); + dst.cors = cors == null ? null : cors.copy(); + if (service != null) { + dst.service = new ArrayList(); + for (CodeableConcept i : service) + dst.service.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (certificate != null) { + dst.certificate = new ArrayList(); + for (ConformanceRestSecurityCertificateComponent i : certificate) + dst.certificate.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (cors == null || cors.isEmpty()) && (service == null || service.isEmpty()) + && (description == null || description.isEmpty()) && (certificate == null || certificate.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestSecurityCertificateComponent extends BackboneElement { + /** + * Mime type for certificate. + */ + @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Mime type for certificate", formalDefinition="Mime type for certificate." ) + protected CodeType type; + + /** + * Actual certificate. + */ + @Child(name="blob", type={Base64BinaryType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." ) + protected Base64BinaryType blob; + + private static final long serialVersionUID = 2092655854L; + + public ConformanceRestSecurityCertificateComponent() { + super(); + } + + /** + * @return {@link #type} (Mime type for certificate.). 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 ConformanceRestSecurityCertificateComponent.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} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestSecurityCertificateComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return Mime type for certificate. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Mime type for certificate. + */ + public ConformanceRestSecurityCertificateComponent 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 #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public Base64BinaryType getBlobElement() { + if (this.blob == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.blob"); + else if (Configuration.doAutoCreate()) + this.blob = new Base64BinaryType(); + return this.blob; + } + + public boolean hasBlobElement() { + return this.blob != null && !this.blob.isEmpty(); + } + + public boolean hasBlob() { + return this.blob != null && !this.blob.isEmpty(); + } + + /** + * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value + */ + public ConformanceRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { + this.blob = value; + return this; + } + + /** + * @return Actual certificate. + */ + public byte[] getBlob() { + return this.blob == null ? null : this.blob.getValue(); + } + + /** + * @param value Actual certificate. + */ + public ConformanceRestSecurityCertificateComponent setBlob(byte[] value) { + if (value == null) + this.blob = null; + else { + if (this.blob == null) + this.blob = new Base64BinaryType(); + this.blob.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Mime type for certificate.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("blob", "base64Binary", "Actual certificate.", 0, java.lang.Integer.MAX_VALUE, blob)); + } + + public ConformanceRestSecurityCertificateComponent copy() { + ConformanceRestSecurityCertificateComponent dst = new ConformanceRestSecurityCertificateComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.blob = blob == null ? null : blob.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (blob == null || blob.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestResourceComponent extends BackboneElement { + /** + * A type of resource exposed via the restful interface. + */ + @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." ) + protected CodeType type; + + /** + * A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. + */ + @Child(name="profile", type={Profile.class}, order=2, min=0, max=1) + @Description(shortDefinition="What structural features are supported", formalDefinition="A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + protected Profile profileTarget; + + /** + * Identifies a restful operation supported by the solution. + */ + @Child(name="interaction", type={}, order=3, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." ) + protected List interaction; + + /** + * Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + */ + @Child(name="versioning", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources." ) + protected Enumeration versioning; + + /** + * A flag for whether the server is able to return past versions as part of the vRead operation. + */ + @Child(name="readHistory", type={BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." ) + protected BooleanType readHistory; + + /** + * A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server. + */ + @Child(name="updateCreate", type={BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="If allows/uses update to a new location", formalDefinition="A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server." ) + protected BooleanType updateCreate; + + /** + * A list of _include values supported by the server. + */ + @Child(name="searchInclude", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." ) + protected List searchInclude; + + /** + * Additional search parameters for implementations to support and/or make use of. + */ + @Child(name="searchParam", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional search params defined", formalDefinition="Additional search parameters for implementations to support and/or make use of." ) + protected List searchParam; + + private static final long serialVersionUID = 120556320L; + + public ConformanceRestResourceComponent() { + super(); + } + + public ConformanceRestResourceComponent(CodeType type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A type of resource exposed via the restful interface.). 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 ConformanceRestResourceComponent.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} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestResourceComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return A type of resource exposed via the restful interface. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A type of resource exposed via the restful interface. + */ + public ConformanceRestResourceComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.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 specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public ConformanceRestResourceComponent 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 specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public Profile getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.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 specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.) + */ + public ConformanceRestResourceComponent setProfileTarget(Profile value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #interaction} (Identifies a restful operation supported by the solution.) + */ + public List getInteraction() { + if (this.interaction == null) + this.interaction = new ArrayList(); + return this.interaction; + } + + public boolean hasInteraction() { + if (this.interaction == null) + return false; + for (ResourceInteractionComponent item : this.interaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interaction} (Identifies a restful operation supported by the solution.) + */ + // syntactic sugar + public ResourceInteractionComponent addInteraction() { //3 + ResourceInteractionComponent t = new ResourceInteractionComponent(); + if (this.interaction == null) + this.interaction = new ArrayList(); + this.interaction.add(t); + return t; + } + + /** + * @return {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public Enumeration getVersioningElement() { + if (this.versioning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.versioning"); + else if (Configuration.doAutoCreate()) + this.versioning = new Enumeration(); + return this.versioning; + } + + public boolean hasVersioningElement() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + public boolean hasVersioning() { + return this.versioning != null && !this.versioning.isEmpty(); + } + + /** + * @param value {@link #versioning} (Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value + */ + public ConformanceRestResourceComponent setVersioningElement(Enumeration value) { + this.versioning = value; + return this; + } + + /** + * @return Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + */ + public VersioningPolicy getVersioning() { + return this.versioning == null ? null : this.versioning.getValue(); + } + + /** + * @param value Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + */ + public ConformanceRestResourceComponent setVersioning(VersioningPolicy value) { + if (value == null) + this.versioning = null; + else { + if (this.versioning == null) + this.versioning = new Enumeration(VersioningPolicy.ENUM_FACTORY); + this.versioning.setValue(value); + } + return this; + } + + /** + * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value + */ + public BooleanType getReadHistoryElement() { + if (this.readHistory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.readHistory"); + else if (Configuration.doAutoCreate()) + this.readHistory = new BooleanType(); + return this.readHistory; + } + + public boolean hasReadHistoryElement() { + return this.readHistory != null && !this.readHistory.isEmpty(); + } + + public boolean hasReadHistory() { + return this.readHistory != null && !this.readHistory.isEmpty(); + } + + /** + * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value + */ + public ConformanceRestResourceComponent setReadHistoryElement(BooleanType value) { + this.readHistory = value; + return this; + } + + /** + * @return A flag for whether the server is able to return past versions as part of the vRead operation. + */ + public boolean getReadHistory() { + return this.readHistory == null ? false : this.readHistory.getValue(); + } + + /** + * @param value A flag for whether the server is able to return past versions as part of the vRead operation. + */ + public ConformanceRestResourceComponent setReadHistory(boolean value) { + if (value == false) + this.readHistory = null; + else { + if (this.readHistory == null) + this.readHistory = new BooleanType(); + this.readHistory.setValue(value); + } + return this; + } + + /** + * @return {@link #updateCreate} (A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value + */ + public BooleanType getUpdateCreateElement() { + if (this.updateCreate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceComponent.updateCreate"); + else if (Configuration.doAutoCreate()) + this.updateCreate = new BooleanType(); + return this.updateCreate; + } + + public boolean hasUpdateCreateElement() { + return this.updateCreate != null && !this.updateCreate.isEmpty(); + } + + public boolean hasUpdateCreate() { + return this.updateCreate != null && !this.updateCreate.isEmpty(); + } + + /** + * @param value {@link #updateCreate} (A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value + */ + public ConformanceRestResourceComponent setUpdateCreateElement(BooleanType value) { + this.updateCreate = value; + return this; + } + + /** + * @return A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server. + */ + public boolean getUpdateCreate() { + return this.updateCreate == null ? false : this.updateCreate.getValue(); + } + + /** + * @param value A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server. + */ + public ConformanceRestResourceComponent setUpdateCreate(boolean value) { + if (value == false) + this.updateCreate = null; + else { + if (this.updateCreate == null) + this.updateCreate = new BooleanType(); + this.updateCreate.setValue(value); + } + return this; + } + + /** + * @return {@link #searchInclude} (A list of _include values supported by the server.) + */ + public List getSearchInclude() { + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + return this.searchInclude; + } + + public boolean hasSearchInclude() { + if (this.searchInclude == null) + return false; + for (StringType item : this.searchInclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchInclude} (A list of _include values supported by the server.) + */ + // syntactic sugar + public StringType addSearchIncludeElement() {//2 + StringType t = new StringType(); + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + this.searchInclude.add(t); + return t; + } + + /** + * @param value {@link #searchInclude} (A list of _include values supported by the server.) + */ + public ConformanceRestResourceComponent addSearchInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.searchInclude == null) + this.searchInclude = new ArrayList(); + this.searchInclude.add(t); + return this; + } + + /** + * @param value {@link #searchInclude} (A list of _include values supported by the server.) + */ + public boolean hasSearchInclude(String value) { + if (this.searchInclude == null) + return false; + for (StringType v : this.searchInclude) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #searchParam} (Additional search parameters for implementations to support and/or make use of.) + */ + public List getSearchParam() { + if (this.searchParam == null) + this.searchParam = new ArrayList(); + return this.searchParam; + } + + public boolean hasSearchParam() { + if (this.searchParam == null) + return false; + for (ConformanceRestResourceSearchParamComponent item : this.searchParam) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #searchParam} (Additional search parameters for implementations to support and/or make use of.) + */ + // syntactic sugar + public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 + ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); + if (this.searchParam == null) + this.searchParam = new ArrayList(); + this.searchParam.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(Profile)", "A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction)); + childrenList.add(new Property("versioning", "code", "Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.", 0, java.lang.Integer.MAX_VALUE, versioning)); + childrenList.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, java.lang.Integer.MAX_VALUE, readHistory)); + childrenList.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.", 0, java.lang.Integer.MAX_VALUE, updateCreate)); + childrenList.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude)); + childrenList.add(new Property("searchParam", "", "Additional search parameters for implementations to support and/or make use of.", 0, java.lang.Integer.MAX_VALUE, searchParam)); + } + + public ConformanceRestResourceComponent copy() { + ConformanceRestResourceComponent dst = new ConformanceRestResourceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (interaction != null) { + dst.interaction = new ArrayList(); + for (ResourceInteractionComponent i : interaction) + dst.interaction.add(i.copy()); + }; + dst.versioning = versioning == null ? null : versioning.copy(); + dst.readHistory = readHistory == null ? null : readHistory.copy(); + dst.updateCreate = updateCreate == null ? null : updateCreate.copy(); + if (searchInclude != null) { + dst.searchInclude = new ArrayList(); + for (StringType i : searchInclude) + dst.searchInclude.add(i.copy()); + }; + if (searchParam != null) { + dst.searchParam = new ArrayList(); + for (ConformanceRestResourceSearchParamComponent i : searchParam) + dst.searchParam.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) + && (interaction == null || interaction.isEmpty()) && (versioning == null || versioning.isEmpty()) + && (readHistory == null || readHistory.isEmpty()) && (updateCreate == null || updateCreate.isEmpty()) + && (searchInclude == null || searchInclude.isEmpty()) && (searchParam == null || searchParam.isEmpty()) + ; + } + + } + + @Block() + public static class ResourceInteractionComponent extends BackboneElement { + /** + * Coded identifier of the operation, supported by the system resource. + */ + @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="read | vread | update | delete | history-instance | validate | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) + protected Enumeration code; + + /** + * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." ) + protected StringType documentation; + + private static final long serialVersionUID = -437507806L; + + public ResourceInteractionComponent() { + super(); + } + + public ResourceInteractionComponent(Enumeration code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResourceInteractionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ResourceInteractionComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Coded identifier of the operation, supported by the system resource. + */ + public TypeRestfulInteraction getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Coded identifier of the operation, supported by the system resource. + */ + public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { + if (this.code == null) + this.code = new Enumeration(TypeRestfulInteraction.ENUM_FACTORY); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). 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 ResourceInteractionComponent.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} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ResourceInteractionComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + */ + public ResourceInteractionComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + public ResourceInteractionComponent copy() { + ResourceInteractionComponent dst = new ResourceInteractionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestResourceSearchParamComponent extends BackboneElement { + /** + * The name of the search parameter used in the interface. + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." ) + protected StringType name; + + /** + * A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter. + */ + @Child(name="definition", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Source of definition for parameter", formalDefinition="A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter." ) + protected UriType definition; + + /** + * The type of value a search parameter refers to, and how the content is interpreted. + */ + @Child(name="type", type={CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) + protected Enumeration type; + + /** + * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + @Child(name="documentation", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) + protected StringType documentation; + + /** + * Types of resource (if a resource is referenced). + */ + @Child(name="target", type={CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) + protected List target; + + /** + * Chained names supported. + */ + @Child(name="chain", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Chained names supported", formalDefinition="Chained names supported." ) + protected List chain; + + private static final long serialVersionUID = 938312816L; + + public ConformanceRestResourceSearchParamComponent() { + super(); + } + + public ConformanceRestResourceSearchParamComponent(StringType name, Enumeration type) { + super(); + this.name = name; + this.type = type; + } + + /** + * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the search parameter used in the interface. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the search parameter used in the interface. + */ + public ConformanceRestResourceSearchParamComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #definition} (A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public UriType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new UriType(); + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setDefinitionElement(UriType value) { + this.definition = value; + return this; + } + + /** + * @return A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter. + */ + public ConformanceRestResourceSearchParamComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new UriType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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 of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParamType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of value a search parameter refers to, and how the content is interpreted. + */ + public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { + if (this.type == null) + this.type = new Enumeration(SearchParamType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). 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 ConformanceRestResourceSearchParamComponent.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} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceRestResourceSearchParamComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + */ + public ConformanceRestResourceSearchParamComponent 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 #target} (Types of resource (if a resource is referenced).) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (CodeType item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + // syntactic sugar + public CodeType addTargetElement() {//2 + CodeType t = new CodeType(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public ConformanceRestResourceSearchParamComponent addTarget(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public boolean hasTarget(String value) { + if (this.target == null) + return false; + for (CodeType v : this.target) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #chain} (Chained names supported.) + */ + public List getChain() { + if (this.chain == null) + this.chain = new ArrayList(); + return this.chain; + } + + public boolean hasChain() { + if (this.chain == null) + return false; + for (StringType item : this.chain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #chain} (Chained names supported.) + */ + // syntactic sugar + public StringType addChainElement() {//2 + StringType t = new StringType(); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return t; + } + + /** + * @param value {@link #chain} (Chained names supported.) + */ + public ConformanceRestResourceSearchParamComponent addChain(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.chain == null) + this.chain = new ArrayList(); + this.chain.add(t); + return this; + } + + /** + * @param value {@link #chain} (Chained names supported.) + */ + public boolean hasChain(String value) { + if (this.chain == null) + return false; + for (StringType v : this.chain) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("definition", "uri", "A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("chain", "string", "Chained names supported.", 0, java.lang.Integer.MAX_VALUE, chain)); + } + + public ConformanceRestResourceSearchParamComponent copy() { + ConformanceRestResourceSearchParamComponent dst = new ConformanceRestResourceSearchParamComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.type = type == null ? null : type.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (CodeType i : target) + dst.target.add(i.copy()); + }; + if (chain != null) { + dst.chain = new ArrayList(); + for (StringType i : chain) + dst.chain.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) + && (type == null || type.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (target == null || target.isEmpty()) && (chain == null || chain.isEmpty()); + } + + } + + @Block() + public static class SystemInteractionComponent extends BackboneElement { + /** + * A coded identifier of the operation, supported by the system. + */ + @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="transaction | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." ) + protected Enumeration code; + + /** + * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." ) + protected StringType documentation; + + private static final long serialVersionUID = 510675287L; + + public SystemInteractionComponent() { + super(); + } + + public SystemInteractionComponent(Enumeration code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SystemInteractionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public SystemInteractionComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return A coded identifier of the operation, supported by the system. + */ + public SystemRestfulInteraction getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A coded identifier of the operation, supported by the system. + */ + public SystemInteractionComponent setCode(SystemRestfulInteraction value) { + if (this.code == null) + this.code = new Enumeration(SystemRestfulInteraction.ENUM_FACTORY); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). 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 SystemInteractionComponent.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} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public SystemInteractionComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + */ + public SystemInteractionComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + public SystemInteractionComponent copy() { + SystemInteractionComponent dst = new SystemInteractionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceRestOperationComponent extends BackboneElement { + /** + * The name of a query, which is used in the _query parameter when the query is called. + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of a query, which is used in the _query parameter when the query is called." ) + protected StringType name; + + /** + * Where the formal definition can be found. + */ + @Child(name="definition", type={OperationDefinition.class}, order=2, min=1, max=1) + @Description(shortDefinition="The the operation/query is defined", formalDefinition="Where the formal definition can be found." ) + protected Reference definition; + + /** + * The actual object that is the target of the reference (Where the formal definition can be found.) + */ + protected OperationDefinition definitionTarget; + + private static final long serialVersionUID = 122107272L; + + public ConformanceRestOperationComponent() { + super(); + } + + public ConformanceRestOperationComponent(StringType name, Reference definition) { + super(); + this.name = name; + this.definition = definition; + } + + /** + * @return {@link #name} (The name of a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 a query, which is used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ConformanceRestOperationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of a query, which is used in the _query parameter when the query is called. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of a query, which is used in the _query parameter when the query is called. + */ + public ConformanceRestOperationComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #definition} (Where the formal definition can be found.) + */ + public Reference getDefinition() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new Reference(); + return this.definition; + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (Where the formal definition can be found.) + */ + public ConformanceRestOperationComponent setDefinition(Reference value) { + this.definition = value; + return this; + } + + /** + * @return {@link #definition} 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. (Where the formal definition can be found.) + */ + public OperationDefinition getDefinitionTarget() { + if (this.definitionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definitionTarget = new OperationDefinition(); + return this.definitionTarget; + } + + /** + * @param value {@link #definition} 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. (Where the formal definition can be found.) + */ + public ConformanceRestOperationComponent setDefinitionTarget(OperationDefinition value) { + this.definitionTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of a query, which is used in the _query parameter when the query is called.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, java.lang.Integer.MAX_VALUE, definition)); + } + + public ConformanceRestOperationComponent copy() { + ConformanceRestOperationComponent dst = new ConformanceRestOperationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.definition = definition == null ? null : definition.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceMessagingComponent extends BackboneElement { + /** + * An address to which messages and/or replies are to be sent. + */ + @Child(name="endpoint", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Actual endpoint being described", formalDefinition="An address to which messages and/or replies are to be sent." ) + protected UriType endpoint; + + /** + * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + @Child(name="reliableCache", type={IntegerType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." ) + protected IntegerType reliableCache; + + /** + * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + @Child(name="documentation", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner." ) + protected StringType documentation; + + /** + * A description of the solution's support for an event at this end point. + */ + @Child(name="event", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end point." ) + protected List event; + + private static final long serialVersionUID = -217151442L; + + public ConformanceMessagingComponent() { + super(); + } + + /** + * @return {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (An address to which messages and/or replies are to be sent.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public ConformanceMessagingComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return An address to which messages and/or replies are to be sent. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value An address to which messages and/or replies are to be sent. + */ + public ConformanceMessagingComponent setEndpoint(String value) { + if (Utilities.noString(value)) + this.endpoint = null; + else { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + } + return this; + } + + /** + * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value + */ + public IntegerType getReliableCacheElement() { + if (this.reliableCache == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingComponent.reliableCache"); + else if (Configuration.doAutoCreate()) + this.reliableCache = new IntegerType(); + return this.reliableCache; + } + + public boolean hasReliableCacheElement() { + return this.reliableCache != null && !this.reliableCache.isEmpty(); + } + + public boolean hasReliableCache() { + return this.reliableCache != null && !this.reliableCache.isEmpty(); + } + + /** + * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value + */ + public ConformanceMessagingComponent setReliableCacheElement(IntegerType value) { + this.reliableCache = value; + return this; + } + + /** + * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + public int getReliableCache() { + return this.reliableCache == null ? null : this.reliableCache.getValue(); + } + + /** + * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + */ + public ConformanceMessagingComponent setReliableCache(int value) { + if (value == -1) + this.reliableCache = null; + else { + if (this.reliableCache == null) + this.reliableCache = new IntegerType(); + this.reliableCache.setValue(value); + } + return this; + } + + /** + * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). 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 ConformanceMessagingComponent.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} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceMessagingComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + */ + public ConformanceMessagingComponent 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 #event} (A description of the solution's support for an event at this end point.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (ConformanceMessagingEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A description of the solution's support for an event at this end point.) + */ + // syntactic sugar + public ConformanceMessagingEventComponent addEvent() { //3 + ConformanceMessagingEventComponent t = new ConformanceMessagingEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("endpoint", "uri", "An address to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + childrenList.add(new Property("reliableCache", "integer", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, java.lang.Integer.MAX_VALUE, reliableCache)); + childrenList.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("event", "", "A description of the solution's support for an event at this end point.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + public ConformanceMessagingComponent copy() { + ConformanceMessagingComponent dst = new ConformanceMessagingComponent(); + copyValues(dst); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + dst.reliableCache = reliableCache == null ? null : reliableCache.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (ConformanceMessagingEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (endpoint == null || endpoint.isEmpty()) && (reliableCache == null || reliableCache.isEmpty()) + && (documentation == null || documentation.isEmpty()) && (event == null || event.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceMessagingEventComponent extends BackboneElement { + /** + * A coded identifier of a supported messaging event. + */ + @Child(name="code", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) + protected Coding code; + + /** + * The impact of the content of the message. + */ + @Child(name="category", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) + protected Enumeration category; + + /** + * The mode of this event declaration - whether application is sender or receiver. + */ + @Child(name="mode", type={CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." ) + protected Enumeration mode; + + /** + * A list of the messaging transport protocol(s) identifiers, supported by this endpoint. + */ + @Child(name="protocol", type={Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." ) + protected List protocol; + + /** + * A resource associated with the event. This is the resource that defines the event. + */ + @Child(name="focus", type={CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event. This is the resource that defines the event." ) + protected CodeType focus; + + /** + * Information about the request for this event. + */ + @Child(name="request", type={Profile.class}, order=6, min=1, max=1) + @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Information about the request for this event.) + */ + protected Profile requestTarget; + + /** + * Information about the response for this event. + */ + @Child(name="response", type={Profile.class}, order=7, min=1, max=1) + @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Information about the response for this event.) + */ + protected Profile responseTarget; + + /** + * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + @Child(name="documentation", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." ) + protected StringType documentation; + + private static final long serialVersionUID = 758007981L; + + public ConformanceMessagingEventComponent() { + super(); + } + + public ConformanceMessagingEventComponent(Coding code, Enumeration mode, CodeType focus, Reference request, Reference response) { + super(); + this.code = code; + this.mode = mode; + this.focus = focus; + this.request = request; + this.response = response; + } + + /** + * @return {@link #code} (A coded identifier of a supported messaging event.) + */ + public Coding getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Coding(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A coded identifier of a supported messaging event.) + */ + public ConformanceMessagingEventComponent setCode(Coding value) { + this.code = value; + return this; + } + + /** + * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public ConformanceMessagingEventComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return The impact of the content of the message. + */ + public MessageSignificanceCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value The impact of the content of the message. + */ + public ConformanceMessagingEventComponent setCategory(MessageSignificanceCategory value) { + if (value == null) + this.category = null; + else { + if (this.category == null) + this.category = new Enumeration(MessageSignificanceCategory.ENUM_FACTORY); + this.category.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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 mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceMessagingEventComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return The mode of this event declaration - whether application is sender or receiver. + */ + public MessageConformanceEventMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value The mode of this event declaration - whether application is sender or receiver. + */ + public ConformanceMessagingEventComponent setMode(MessageConformanceEventMode value) { + if (this.mode == null) + this.mode = new Enumeration(MessageConformanceEventMode.ENUM_FACTORY); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) + */ + public List getProtocol() { + if (this.protocol == null) + this.protocol = new ArrayList(); + return this.protocol; + } + + public boolean hasProtocol() { + if (this.protocol == null) + return false; + for (Coding item : this.protocol) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) + */ + // syntactic sugar + public Coding addProtocol() { //3 + Coding t = new Coding(); + if (this.protocol == null) + this.protocol = new ArrayList(); + this.protocol.add(t); + return t; + } + + /** + * @return {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value + */ + public CodeType getFocusElement() { + if (this.focus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.focus"); + else if (Configuration.doAutoCreate()) + this.focus = new CodeType(); + return this.focus; + } + + public boolean hasFocusElement() { + return this.focus != null && !this.focus.isEmpty(); + } + + public boolean hasFocus() { + return this.focus != null && !this.focus.isEmpty(); + } + + /** + * @param value {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value + */ + public ConformanceMessagingEventComponent setFocusElement(CodeType value) { + this.focus = value; + return this; + } + + /** + * @return A resource associated with the event. This is the resource that defines the event. + */ + public String getFocus() { + return this.focus == null ? null : this.focus.getValue(); + } + + /** + * @param value A resource associated with the event. This is the resource that defines the event. + */ + public ConformanceMessagingEventComponent setFocus(String value) { + if (this.focus == null) + this.focus = new CodeType(); + this.focus.setValue(value); + return this; + } + + /** + * @return {@link #request} (Information about the request for this event.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Information about the request for this event.) + */ + public ConformanceMessagingEventComponent setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Information about the request for this event.) + */ + public Profile getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Profile(); + 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. (Information about the request for this event.) + */ + public ConformanceMessagingEventComponent setRequestTarget(Profile value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Information about the response for this event.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Information about the response for this event.) + */ + public ConformanceMessagingEventComponent setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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. (Information about the response for this event.) + */ + public Profile getResponseTarget() { + if (this.responseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); + else if (Configuration.doAutoCreate()) + this.responseTarget = new Profile(); + return this.responseTarget; + } + + /** + * @param value {@link #response} 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. (Information about the response for this event.) + */ + public ConformanceMessagingEventComponent setResponseTarget(Profile value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). 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 ConformanceMessagingEventComponent.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} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceMessagingEventComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + */ + public ConformanceMessagingEventComponent 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("focus", "code", "A resource associated with the event. This is the resource that defines the event.", 0, java.lang.Integer.MAX_VALUE, focus)); + childrenList.add(new Property("request", "Reference(Profile)", "Information about the request for this event.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Profile)", "Information about the response for this event.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); + } + + public ConformanceMessagingEventComponent copy() { + ConformanceMessagingEventComponent dst = new ConformanceMessagingEventComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.category = category == null ? null : category.copy(); + dst.mode = mode == null ? null : mode.copy(); + if (protocol != null) { + dst.protocol = new ArrayList(); + for (Coding i : protocol) + dst.protocol.add(i.copy()); + }; + dst.focus = focus == null ? null : focus.copy(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) + && (mode == null || mode.isEmpty()) && (protocol == null || protocol.isEmpty()) && (focus == null || focus.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (documentation == null || documentation.isEmpty()) + ; + } + + } + + @Block() + public static class ConformanceDocumentComponent extends BackboneElement { + /** + * Mode of this document declaration - whether application is producer or consumer. + */ + @Child(name="mode", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether application is producer or consumer." ) + protected Enumeration mode; + + /** + * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + @Child(name="documentation", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc." ) + protected StringType documentation; + + /** + * A constraint on a resource used in the document. + */ + @Child(name="profile", type={Profile.class}, order=3, min=1, max=1) + @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A constraint on a resource used in the document.) + */ + protected Profile profileTarget; + + private static final long serialVersionUID = 437404016L; + + public ConformanceDocumentComponent() { + super(); + } + + public ConformanceDocumentComponent(Enumeration mode, Reference profile) { + super(); + this.mode = mode; + this.profile = profile; + } + + /** + * @return {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public ConformanceDocumentComponent setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Mode of this document declaration - whether application is producer or consumer. + */ + public DocumentMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Mode of this document declaration - whether application is producer or consumer. + */ + public ConformanceDocumentComponent setMode(DocumentMode value) { + if (this.mode == null) + this.mode = new Enumeration(DocumentMode.ENUM_FACTORY); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). 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 ConformanceDocumentComponent.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} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public ConformanceDocumentComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + */ + public ConformanceDocumentComponent 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 #profile} (A constraint on a resource used in the document.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.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 constraint on a resource used in the document.) + */ + public ConformanceDocumentComponent 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 constraint on a resource used in the document.) + */ + public Profile getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConformanceDocumentComponent.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 constraint on a resource used in the document.) + */ + public ConformanceDocumentComponent setProfileTarget(Profile value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("mode", "code", "Mode of this document declaration - whether application is producer or consumer.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("profile", "Reference(Profile)", "A constraint on a resource used in the document.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + public ConformanceDocumentComponent copy() { + ConformanceDocumentComponent dst = new ConformanceDocumentComponent(); + copyValues(dst); + dst.mode = mode == null ? null : mode.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) + && (profile == null || profile.isEmpty()); + } + + } + + /** + * The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + @Child(name="identifier", type={StringType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Logical id to reference this statement", formalDefinition="The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) + protected StringType identifier; + + /** + * The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the statement", formalDefinition="The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name identifying the conformance statement. + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Informal name for this conformance statement", formalDefinition="A free text natural language name identifying the conformance statement." ) + protected StringType name; + + /** + * Name of Organization publishing this conformance statement. + */ + @Child(name="publisher", type={StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Publishing Organization", formalDefinition="Name of Organization publishing this conformance statement." ) + protected StringType publisher; + + /** + * Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contacts for Organization", formalDefinition="Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc." ) + protected List telecom; + + /** + * A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human description of the conformance statement", formalDefinition="A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP." ) + protected StringType description; + + /** + * The status of this conformance statement. + */ + @Child(name="status", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this conformance statement." ) + protected Enumeration status; + + /** + * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name="experimental", type={BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date (and optionally time) when the conformance statement was published. + */ + @Child(name="date", type={DateTimeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the conformance statement was published." ) + protected DateTimeType date; + + /** + * Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation. + */ + @Child(name="software", type={}, order=8, min=0, max=1) + @Description(shortDefinition="Software that is covered by this conformance statement", formalDefinition="Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation." ) + protected ConformanceSoftwareComponent software; + + /** + * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. + */ + @Child(name="implementation", type={}, order=9, min=0, max=1) + @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program." ) + protected ConformanceImplementationComponent implementation; + + /** + * The version of the FHIR specification on which this conformance statement is based. + */ + @Child(name="fhirVersion", type={IdType.class}, order=10, min=1, max=1) + @Description(shortDefinition="FHIR Version", formalDefinition="The version of the FHIR specification on which this conformance statement is based." ) + protected IdType fhirVersion; + + /** + * A flag that indicates whether the application accepts unknown elements as part of a resource. + */ + @Child(name="acceptUnknown", type={BooleanType.class}, order=11, min=1, max=1) + @Description(shortDefinition="True if application accepts unknown elements", formalDefinition="A flag that indicates whether the application accepts unknown elements as part of a resource." ) + protected BooleanType acceptUnknown; + + /** + * A list of the formats supported by this implementation. + */ + @Child(name="format", type={CodeType.class}, order=12, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="formats supported (xml | json | mime type)", formalDefinition="A list of the formats supported by this implementation." ) + protected List format; + + /** + * A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. + */ + @Child(name="profile", type={Profile.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Profiles supported by the system", formalDefinition="A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile." ) + protected List profile; + /** + * The actual objects that are the target of the reference (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + protected List profileTarget; + + + /** + * A definition of the restful capabilities of the solution, if any. + */ + @Child(name="rest", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) + protected List rest; + + /** + * A description of the messaging capabilities of the solution. + */ + @Child(name="messaging", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) + protected List messaging; + + /** + * A document definition. + */ + @Child(name="document", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) + protected List document; + + private static final long serialVersionUID = 1215207759L; + + public Conformance() { + super(); + } + + public Conformance(StringType publisher, DateTimeType date, IdType fhirVersion, BooleanType acceptUnknown) { + super(); + this.publisher = publisher; + this.date = date; + this.fhirVersion = fhirVersion; + this.acceptUnknown = acceptUnknown; + } + + /** + * @return {@link #identifier} (The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public Conformance setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public Conformance setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Conformance setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public Conformance setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Conformance setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the conformance statement. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the conformance statement. + */ + public Conformance setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (Name of Organization publishing this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Name of Organization publishing this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Conformance setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Name of Organization publishing this conformance statement. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Name of Organization publishing this conformance statement. + */ + public Conformance setPublisher(String value) { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + return this; + } + + /** + * @return {@link #telecom} (Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). 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 Conformance.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} (A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Conformance setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + */ + public Conformance setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Conformance setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this conformance statement. + */ + public ConformanceStatementStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this conformance statement. + */ + public Conformance setStatus(ConformanceStatementStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(ConformanceStatementStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public Conformance setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null ? false : this.experimental.getValue(); + } + + /** + * @param value A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public Conformance setExperimental(boolean value) { + if (value == false) + this.experimental = null; + else { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and optionally time) when the conformance statement was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Conformance setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and optionally time) when the conformance statement was published. + */ + 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(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #software} (Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation.) + */ + public ConformanceSoftwareComponent getSoftware() { + if (this.software == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.software"); + else if (Configuration.doAutoCreate()) + this.software = new ConformanceSoftwareComponent(); + return this.software; + } + + public boolean hasSoftware() { + return this.software != null && !this.software.isEmpty(); + } + + /** + * @param value {@link #software} (Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation.) + */ + public Conformance setSoftware(ConformanceSoftwareComponent value) { + this.software = value; + return this; + } + + /** + * @return {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) + */ + public ConformanceImplementationComponent getImplementation() { + if (this.implementation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.implementation"); + else if (Configuration.doAutoCreate()) + this.implementation = new ConformanceImplementationComponent(); + return this.implementation; + } + + public boolean hasImplementation() { + return this.implementation != null && !this.implementation.isEmpty(); + } + + /** + * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) + */ + public Conformance setImplementation(ConformanceImplementationComponent value) { + this.implementation = value; + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public Conformance setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this conformance statement is based. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this conformance statement is based. + */ + public Conformance setFhirVersion(String value) { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + return this; + } + + /** + * @return {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value + */ + public BooleanType getAcceptUnknownElement() { + if (this.acceptUnknown == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Conformance.acceptUnknown"); + else if (Configuration.doAutoCreate()) + this.acceptUnknown = new BooleanType(); + return this.acceptUnknown; + } + + public boolean hasAcceptUnknownElement() { + return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); + } + + public boolean hasAcceptUnknown() { + return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); + } + + /** + * @param value {@link #acceptUnknown} (A flag that indicates whether the application accepts unknown elements as part of a resource.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value + */ + public Conformance setAcceptUnknownElement(BooleanType value) { + this.acceptUnknown = value; + return this; + } + + /** + * @return A flag that indicates whether the application accepts unknown elements as part of a resource. + */ + public boolean getAcceptUnknown() { + return this.acceptUnknown == null ? false : this.acceptUnknown.getValue(); + } + + /** + * @param value A flag that indicates whether the application accepts unknown elements as part of a resource. + */ + public Conformance setAcceptUnknown(boolean value) { + if (this.acceptUnknown == null) + this.acceptUnknown = new BooleanType(); + this.acceptUnknown.setValue(value); + return this; + } + + /** + * @return {@link #format} (A list of the formats supported by this implementation.) + */ + public List getFormat() { + if (this.format == null) + this.format = new ArrayList(); + return this.format; + } + + public boolean hasFormat() { + if (this.format == null) + return false; + for (CodeType item : this.format) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #format} (A list of the formats supported by this implementation.) + */ + // syntactic sugar + public CodeType addFormatElement() {//2 + CodeType t = new CodeType(); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return t; + } + + /** + * @param value {@link #format} (A list of the formats supported by this implementation.) + */ + public Conformance addFormat(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return this; + } + + /** + * @param value {@link #format} (A list of the formats supported by this implementation.) + */ + public boolean hasFormat(String value) { + if (this.format == null) + return false; + for (CodeType v : this.format) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (Reference item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + // syntactic sugar + public Reference addProfile() { //3 + Reference t = new Reference(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + /** + * @return {@link #profile} (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. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + public List getProfileTarget() { + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + return this.profileTarget; + } + + // syntactic sugar + /** + * @return {@link #profile} (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. A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.) + */ + public Profile addProfileTarget() { + Profile r = new Profile(); + if (this.profileTarget == null) + this.profileTarget = new ArrayList(); + this.profileTarget.add(r); + return r; + } + + /** + * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) + */ + public List getRest() { + if (this.rest == null) + this.rest = new ArrayList(); + return this.rest; + } + + public boolean hasRest() { + if (this.rest == null) + return false; + for (ConformanceRestComponent item : this.rest) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) + */ + // syntactic sugar + public ConformanceRestComponent addRest() { //3 + ConformanceRestComponent t = new ConformanceRestComponent(); + if (this.rest == null) + this.rest = new ArrayList(); + this.rest.add(t); + return t; + } + + /** + * @return {@link #messaging} (A description of the messaging capabilities of the solution.) + */ + public List getMessaging() { + if (this.messaging == null) + this.messaging = new ArrayList(); + return this.messaging; + } + + public boolean hasMessaging() { + if (this.messaging == null) + return false; + for (ConformanceMessagingComponent item : this.messaging) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #messaging} (A description of the messaging capabilities of the solution.) + */ + // syntactic sugar + public ConformanceMessagingComponent addMessaging() { //3 + ConformanceMessagingComponent t = new ConformanceMessagingComponent(); + if (this.messaging == null) + this.messaging = new ArrayList(); + this.messaging.add(t); + return t; + } + + /** + * @return {@link #document} (A document definition.) + */ + public List getDocument() { + if (this.document == null) + this.document = new ArrayList(); + return this.document; + } + + public boolean hasDocument() { + if (this.document == null) + return false; + for (ConformanceDocumentComponent item : this.document) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #document} (A document definition.) + */ + // syntactic sugar + public ConformanceDocumentComponent addDocument() { //3 + ConformanceDocumentComponent t = new ConformanceDocumentComponent(); + if (this.document == null) + this.document = new ArrayList(); + this.document.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "string", "The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the conformance statement.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "Name of Organization publishing this conformance statement.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contacts for Organization relevant to this conformance statement. The contacts may be a website, email, phone numbers, etc.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("description", "string", "A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("status", "code", "The status of this conformance statement.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the conformance statement was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("software", "", "Software that is covered by this conformance statement. It is used when the profile describes the capabilities of a particular software version, independent of an installation.", 0, java.lang.Integer.MAX_VALUE, software)); + childrenList.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, java.lang.Integer.MAX_VALUE, implementation)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this conformance statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("acceptUnknown", "boolean", "A flag that indicates whether the application accepts unknown elements as part of a resource.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); + childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation.", 0, java.lang.Integer.MAX_VALUE, format)); + childrenList.add(new Property("profile", "Reference(Profile)", "A list of profiles supported by the system. For a server, 'supported by the system' means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); + childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); + childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); + } + + public Conformance copy() { + Conformance dst = new Conformance(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.software = software == null ? null : software.copy(); + dst.implementation = implementation == null ? null : implementation.copy(); + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy(); + if (format != null) { + dst.format = new ArrayList(); + for (CodeType i : format) + dst.format.add(i.copy()); + }; + if (profile != null) { + dst.profile = new ArrayList(); + for (Reference i : profile) + dst.profile.add(i.copy()); + }; + if (rest != null) { + dst.rest = new ArrayList(); + for (ConformanceRestComponent i : rest) + dst.rest.add(i.copy()); + }; + if (messaging != null) { + dst.messaging = new ArrayList(); + for (ConformanceMessagingComponent i : messaging) + dst.messaging.add(i.copy()); + }; + if (document != null) { + dst.document = new ArrayList(); + for (ConformanceDocumentComponent i : document) + dst.document.add(i.copy()); + }; + return dst; + } + + protected Conformance typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (software == null || software.isEmpty()) + && (implementation == null || implementation.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) + && (acceptUnknown == null || acceptUnknown.isEmpty()) && (format == null || format.isEmpty()) + && (profile == null || profile.isEmpty()) && (rest == null || rest.isEmpty()) && (messaging == null || messaging.isEmpty()) + && (document == null || document.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Conformance; + } + + @SearchParamDefinition(name="status", path="Conformance.status", description="The current status of the conformance statement", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="resource", path="Conformance.rest.resource.type", description="Name of a resource mentioned in a conformance statement", type="token" ) + public static final String SP_RESOURCE = "resource"; + @SearchParamDefinition(name="security", path="Conformance.rest.security", description="Information about security of implementation", type="token" ) + public static final String SP_SECURITY = "security"; + @SearchParamDefinition(name="format", path="Conformance.format", description="formats supported (xml | json | mime type)", type="token" ) + public static final String SP_FORMAT = "format"; + @SearchParamDefinition(name="date", path="Conformance.date", description="The conformance statement publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="version", path="Conformance.version", description="The version identifier of the conformance statement", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="publisher", path="Conformance.publisher", description="Name of the publisher of the conformance statement", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="mode", path="Conformance.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" ) + public static final String SP_MODE = "mode"; + @SearchParamDefinition(name="software", path="Conformance.software.name", description="Part of a the name of a software application", type="string" ) + public static final String SP_SOFTWARE = "software"; + @SearchParamDefinition(name="description", path="Conformance.description", description="Text search in the description of the conformance statement", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="event", path="Conformance.messaging.event.code", description="Event code in a conformance statement", type="token" ) + public static final String SP_EVENT = "event"; + @SearchParamDefinition(name="name", path="Conformance.name", description="Name of the conformance statement", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="supported-profile", path="Conformance.profile", description="Profiles supported by the system", type="reference" ) + public static final String SP_SUPPORTEDPROFILE = "supported-profile"; + @SearchParamDefinition(name="fhirversion", path="Conformance.version", description="The version of FHIR", type="token" ) + public static final String SP_FHIRVERSION = "fhirversion"; + @SearchParamDefinition(name="identifier", path="Conformance.identifier", description="The identifier of the conformance statement", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="profile", path="Conformance.rest.resource.profile", description="A profile id invoked in a conformance statement", type="reference" ) + public static final String SP_PROFILE = "profile"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java index 4e59aa1dfe2..5be92f30d7d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java @@ -20,42 +20,42 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 - - -public class Constants { - - public final static String VERSION = "0.3.0"; - public final static String REVISION = "3775"; - public final static String DATE = "Sun Dec 07 21:45:56 EST 2014"; -} + +/* + 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 + + +public class Constants { + + public final static String VERSION = "0.3.0"; + public final static String REVISION = "3775"; + public final static String DATE = "Sun Dec 07 21:45:56 EST 2014"; +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java index 5484f0dbcfa..127976c9122 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java @@ -20,504 +20,504 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - */ -@DatatypeDef(name="ContactPoint") -public class ContactPoint extends Type implements ICompositeType{ - - 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. - */ - PHONE, - /** - * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. - */ - FAX, - /** - * The value is an email address. - */ - EMAIL, - /** - * The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. - */ - URL, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PHONE; - if ("fax".equals(codeString)) - return FAX; - if ("email".equals(codeString)) - return EMAIL; - if ("url".equals(codeString)) - return URL; - throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PHONE: return "phone"; - case FAX: return "fax"; - case EMAIL: return "email"; - case URL: return "url"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PHONE: return ""; - case FAX: return ""; - case EMAIL: return ""; - case URL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PHONE: return "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."; - case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; - case EMAIL: return "The value is an email address."; - case URL: return "The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PHONE: return "phone"; - case FAX: return "fax"; - case EMAIL: return "email"; - case URL: return "url"; - default: return "?"; - } - } - } - - public static class ContactPointSystemEnumFactory implements EnumFactory { - public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("phone".equals(codeString)) - return ContactPointSystem.PHONE; - if ("fax".equals(codeString)) - return ContactPointSystem.FAX; - if ("email".equals(codeString)) - return ContactPointSystem.EMAIL; - if ("url".equals(codeString)) - return ContactPointSystem.URL; - throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); - } - public String toCode(ContactPointSystem code) throws IllegalArgumentException { - if (code == ContactPointSystem.PHONE) - return "phone"; - if (code == ContactPointSystem.FAX) - return "fax"; - if (code == ContactPointSystem.EMAIL) - return "email"; - if (code == ContactPointSystem.URL) - return "url"; - return "?"; - } - } - - 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. - */ - HOME, - /** - * An office contact point. First choice for business related contacts during business hours. - */ - WORK, - /** - * A temporary contact point. The period can provide more detailed information. - */ - TEMP, - /** - * This contact point is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business. - */ - MOBILE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return HOME; - if ("work".equals(codeString)) - return WORK; - if ("temp".equals(codeString)) - return TEMP; - if ("old".equals(codeString)) - return OLD; - if ("mobile".equals(codeString)) - return MOBILE; - throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - case MOBILE: return "mobile"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HOME: return ""; - case WORK: return ""; - case TEMP: return ""; - case OLD: return ""; - case MOBILE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HOME: return "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."; - case WORK: return "An office contact point. First choice for business related contacts during business hours."; - case TEMP: return "A temporary contact point. The period can provide more detailed information."; - case OLD: return "This contact point is no longer in use (or was never correct, but retained for records)."; - case MOBILE: return "A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - case MOBILE: return "mobile"; - default: return "?"; - } - } - } - - public static class ContactPointUseEnumFactory implements EnumFactory { - public ContactPointUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return ContactPointUse.HOME; - if ("work".equals(codeString)) - return ContactPointUse.WORK; - if ("temp".equals(codeString)) - return ContactPointUse.TEMP; - if ("old".equals(codeString)) - return ContactPointUse.OLD; - if ("mobile".equals(codeString)) - return ContactPointUse.MOBILE; - throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); - } - public String toCode(ContactPointUse code) throws IllegalArgumentException { - if (code == ContactPointUse.HOME) - return "home"; - if (code == ContactPointUse.WORK) - return "work"; - if (code == ContactPointUse.TEMP) - return "temp"; - if (code == ContactPointUse.OLD) - return "old"; - if (code == ContactPointUse.MOBILE) - return "mobile"; - return "?"; - } - } - - /** - * Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - @Child(name="system", type={CodeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="phone | fax | email | url", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) - protected Enumeration system; - - /** - * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - @Child(name="value", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="The actual contact point details", formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." ) - protected StringType value; - - /** - * Identifies the purpose for the contact point. - */ - @Child(name="use", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="home | work | temp | old | mobile - purpose of this contact point", formalDefinition="Identifies the purpose for the contact point." ) - protected Enumeration use; - - /** - * Time period when the contact point was/is in use. - */ - @Child(name="period", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Time period when the contact point was/is in use", formalDefinition="Time period when the contact point was/is in use." ) - protected Period period; - - private static final long serialVersionUID = 1972725348L; - - public ContactPoint() { - super(); - } - - /** - * @return {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Enumeration getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.system"); - else if (Configuration.doAutoCreate()) - this.system = new Enumeration(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ContactPoint setSystemElement(Enumeration value) { - this.system = value; - return this; - } - - /** - * @return Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - public ContactPointSystem getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - public ContactPoint setSystem(ContactPointSystem value) { - if (value == null) - this.system = null; - else { - if (this.system == null) - this.system = new Enumeration(ContactPointSystem.ENUM_FACTORY); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ContactPoint setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - public ContactPoint setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public ContactPoint setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Identifies the purpose for the contact point. - */ - public ContactPointUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Identifies the purpose for the contact point. - */ - public ContactPoint setUse(ContactPointUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(ContactPointUse.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period when the contact point was/is in use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.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} (Time period when the contact point was/is in use.) - */ - public ContactPoint setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "code", "Telecommunications form for contact point - what communications system is required to make use of the contact.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("value", "string", "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("use", "code", "Identifies the purpose for the contact point.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("period", "Period", "Time period when the contact point was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public ContactPoint copy() { - ContactPoint dst = new ContactPoint(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.value = value == null ? null : value.copy(); - dst.use = use == null ? null : use.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected ContactPoint typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) - && (use == null || use.isEmpty()) && (period == null || period.isEmpty()); - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + */ +@DatatypeDef(name="ContactPoint") +public class ContactPoint extends Type implements ICompositeType{ + + 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. + */ + PHONE, + /** + * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + */ + FAX, + /** + * The value is an email address. + */ + EMAIL, + /** + * The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. + */ + URL, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PHONE; + if ("fax".equals(codeString)) + return FAX; + if ("email".equals(codeString)) + return EMAIL; + if ("url".equals(codeString)) + return URL; + throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PHONE: return "phone"; + case FAX: return "fax"; + case EMAIL: return "email"; + case URL: return "url"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PHONE: return ""; + case FAX: return ""; + case EMAIL: return ""; + case URL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PHONE: return "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."; + case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; + case EMAIL: return "The value is an email address."; + case URL: return "The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PHONE: return "phone"; + case FAX: return "fax"; + case EMAIL: return "email"; + case URL: return "url"; + default: return "?"; + } + } + } + + public static class ContactPointSystemEnumFactory implements EnumFactory { + public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("phone".equals(codeString)) + return ContactPointSystem.PHONE; + if ("fax".equals(codeString)) + return ContactPointSystem.FAX; + if ("email".equals(codeString)) + return ContactPointSystem.EMAIL; + if ("url".equals(codeString)) + return ContactPointSystem.URL; + throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); + } + public String toCode(ContactPointSystem code) throws IllegalArgumentException { + if (code == ContactPointSystem.PHONE) + return "phone"; + if (code == ContactPointSystem.FAX) + return "fax"; + if (code == ContactPointSystem.EMAIL) + return "email"; + if (code == ContactPointSystem.URL) + return "url"; + return "?"; + } + } + + 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. + */ + HOME, + /** + * An office contact point. First choice for business related contacts during business hours. + */ + WORK, + /** + * A temporary contact point. The period can provide more detailed information. + */ + TEMP, + /** + * This contact point is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business. + */ + MOBILE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return HOME; + if ("work".equals(codeString)) + return WORK; + if ("temp".equals(codeString)) + return TEMP; + if ("old".equals(codeString)) + return OLD; + if ("mobile".equals(codeString)) + return MOBILE; + throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + case MOBILE: return "mobile"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HOME: return ""; + case WORK: return ""; + case TEMP: return ""; + case OLD: return ""; + case MOBILE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HOME: return "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."; + case WORK: return "An office contact point. First choice for business related contacts during business hours."; + case TEMP: return "A temporary contact point. The period can provide more detailed information."; + case OLD: return "This contact point is no longer in use (or was never correct, but retained for records)."; + case MOBILE: return "A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HOME: return "home"; + case WORK: return "work"; + case TEMP: return "temp"; + case OLD: return "old"; + case MOBILE: return "mobile"; + default: return "?"; + } + } + } + + public static class ContactPointUseEnumFactory implements EnumFactory { + public ContactPointUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("home".equals(codeString)) + return ContactPointUse.HOME; + if ("work".equals(codeString)) + return ContactPointUse.WORK; + if ("temp".equals(codeString)) + return ContactPointUse.TEMP; + if ("old".equals(codeString)) + return ContactPointUse.OLD; + if ("mobile".equals(codeString)) + return ContactPointUse.MOBILE; + throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); + } + public String toCode(ContactPointUse code) throws IllegalArgumentException { + if (code == ContactPointUse.HOME) + return "home"; + if (code == ContactPointUse.WORK) + return "work"; + if (code == ContactPointUse.TEMP) + return "temp"; + if (code == ContactPointUse.OLD) + return "old"; + if (code == ContactPointUse.MOBILE) + return "mobile"; + return "?"; + } + } + + /** + * Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + @Child(name="system", type={CodeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="phone | fax | email | url", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) + protected Enumeration system; + + /** + * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + @Child(name="value", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="The actual contact point details", formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." ) + protected StringType value; + + /** + * Identifies the purpose for the contact point. + */ + @Child(name="use", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="home | work | temp | old | mobile - purpose of this contact point", formalDefinition="Identifies the purpose for the contact point." ) + protected Enumeration use; + + /** + * Time period when the contact point was/is in use. + */ + @Child(name="period", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time period when the contact point was/is in use", formalDefinition="Time period when the contact point was/is in use." ) + protected Period period; + + private static final long serialVersionUID = 1972725348L; + + public ContactPoint() { + super(); + } + + /** + * @return {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Enumeration getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.system"); + else if (Configuration.doAutoCreate()) + this.system = new Enumeration(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ContactPoint setSystemElement(Enumeration value) { + this.system = value; + return this; + } + + /** + * @return Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + public ContactPointSystem getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value Telecommunications form for contact point - what communications system is required to make use of the contact. + */ + public ContactPoint setSystem(ContactPointSystem value) { + if (value == null) + this.system = null; + else { + if (this.system == null) + this.system = new Enumeration(ContactPointSystem.ENUM_FACTORY); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ContactPoint setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + */ + public ContactPoint setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ContactPoint setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Identifies the purpose for the contact point. + */ + public ContactPointUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Identifies the purpose for the contact point. + */ + public ContactPoint setUse(ContactPointUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(ContactPointUse.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period when the contact point was/is in use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactPoint.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} (Time period when the contact point was/is in use.) + */ + public ContactPoint setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "code", "Telecommunications form for contact point - what communications system is required to make use of the contact.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("value", "string", "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("use", "code", "Identifies the purpose for the contact point.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("period", "Period", "Time period when the contact point was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public ContactPoint copy() { + ContactPoint dst = new ContactPoint(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.value = value == null ? null : value.copy(); + dst.use = use == null ? null : use.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected ContactPoint typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) + && (use == null || use.isEmpty()) && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java index 6920b435e74..28e997fd125 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java @@ -20,2210 +20,2210 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ -@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") -public class Contract extends DomainResource { - - @Block() - public static class ContractSignerComponent extends BackboneElement { - /** - * Party or role who is signing. - */ - @Child(name="type", type={Coding.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Signer Type", formalDefinition="Party or role who is signing." ) - protected List type; - - /** - * The DSIG signature contents in Base64. - */ - @Child(name="signature", type={StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Documentation Signature", formalDefinition="The DSIG signature contents in Base64." ) - protected StringType signature; - - private static final long serialVersionUID = 584509693L; - - public ContractSignerComponent() { - super(); - } - - public ContractSignerComponent(StringType signature) { - super(); - this.signature = signature; - } - - /** - * @return {@link #type} (Party or role who is signing.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Coding item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Party or role who is signing.) - */ - // syntactic sugar - public Coding addType() { //3 - Coding t = new Coding(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #signature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public StringType getSignatureElement() { - if (this.signature == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractSignerComponent.signature"); - else if (Configuration.doAutoCreate()) - this.signature = new StringType(); - return this.signature; - } - - public boolean hasSignatureElement() { - return this.signature != null && !this.signature.isEmpty(); - } - - public boolean hasSignature() { - return this.signature != null && !this.signature.isEmpty(); - } - - /** - * @param value {@link #signature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value - */ - public ContractSignerComponent setSignatureElement(StringType value) { - this.signature = value; - return this; - } - - /** - * @return The DSIG signature contents in Base64. - */ - public String getSignature() { - return this.signature == null ? null : this.signature.getValue(); - } - - /** - * @param value The DSIG signature contents in Base64. - */ - public ContractSignerComponent setSignature(String value) { - if (this.signature == null) - this.signature = new StringType(); - this.signature.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party or role who is signing.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("signature", "string", "The DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - public ContractSignerComponent copy() { - ContractSignerComponent dst = new ContractSignerComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) - dst.type.add(i.copy()); - }; - dst.signature = signature == null ? null : signature.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (signature == null || signature.isEmpty()) - ; - } - - } - - @Block() - public static class ContractTermComponent extends BackboneElement { - /** - * Unique Id for this particular term. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Term identifier", formalDefinition="Unique Id for this particular term." ) - protected Identifier identifier; - - /** - * The type of the term. - */ - @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Term type", formalDefinition="The type of the term." ) - protected CodeableConcept type; - - /** - * The subtype of the term which is appropriate to the term type. - */ - @Child(name="subtype", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Term subtype", formalDefinition="The subtype of the term which is appropriate to the term type." ) - protected CodeableConcept subtype; - - /** - * Who or what the contract term is about. - */ - @Child(name="subject", type={}, order=4, min=0, max=1) - @Description(shortDefinition="Subject for the Term", formalDefinition="Who or what the contract term is about." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the contract term is about.) - */ - protected Resource subjectTarget; - - /** - * Human readable form of the term of the contract. - */ - @Child(name="text", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Human readable Term text", formalDefinition="Human readable form of the term of the contract." ) - protected StringType text; - - /** - * When this term was issued. - */ - @Child(name="issued", type={DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="When issued", formalDefinition="When this term was issued." ) - protected DateTimeType issued; - - /** - * Relevant time/time-period when the term is applicable. - */ - @Child(name="applies", type={Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="When effective", formalDefinition="Relevant time/time-period when the term is applicable." ) - protected Period applies; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The unit price product. - */ - @Child(name="unitPrice", type={Money.class}, order=9, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The unit price product." ) - 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=10, 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=11, 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=12, 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; - - private static final long serialVersionUID = -1958595473L; - - public ContractTermComponent() { - super(); - } - - /** - * @return {@link #identifier} (Unique Id for this particular term.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique Id for this particular term.) - */ - public ContractTermComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #type} (The type of the term.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the term.) - */ - public ContractTermComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subtype} (The subtype of the term which is appropriate to the term type.) - */ - public CodeableConcept getSubtype() { - if (this.subtype == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.subtype"); - else if (Configuration.doAutoCreate()) - this.subtype = new CodeableConcept(); - return this.subtype; - } - - public boolean hasSubtype() { - return this.subtype != null && !this.subtype.isEmpty(); - } - - /** - * @param value {@link #subtype} (The subtype of the term which is appropriate to the term type.) - */ - public ContractTermComponent setSubtype(CodeableConcept value) { - this.subtype = value; - return this; - } - - /** - * @return {@link #subject} (Who or what the contract term is about.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.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} (Who or what the contract term is about.) - */ - public ContractTermComponent 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. (Who or what the contract term is about.) - */ - public Resource getSubjectTarget() { - 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. (Who or what the contract term is about.) - */ - public ContractTermComponent setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #text} (Human readable form of the term of the contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Human readable form of the term of the contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public ContractTermComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Human readable form of the term of the contract. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Human readable form of the term of the contract. - */ - public ContractTermComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #issued} (When this term was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (When this term was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public ContractTermComponent setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return When this term was issued. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value When this term was issued. - */ - public ContractTermComponent setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (Relevant time/time-period when the term is applicable.) - */ - public Period getApplies() { - if (this.applies == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.applies"); - else if (Configuration.doAutoCreate()) - this.applies = new Period(); - return this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (Relevant time/time-period when the term is applicable.) - */ - public ContractTermComponent setApplies(Period value) { - this.applies = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ContractTermComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The unit price product.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The unit price product.) - */ - public ContractTermComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ContractTermComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public ContractTermComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ContractTermComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public ContractTermComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractTermComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public ContractTermComponent setNet(Money value) { - this.net = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique Id for this particular term.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "The type of the term.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "The subtype of the term which is appropriate to the term type.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("subject", "Reference(Any)", "Who or what the contract term is about.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("text", "string", "Human readable form of the term of the contract.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("issued", "dateTime", "When this term was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("applies", "Period", "Relevant time/time-period when the term is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The unit price product.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - } - - public ContractTermComponent copy() { - ContractTermComponent dst = new ContractTermComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.type = type == null ? null : type.copy(); - dst.subtype = subtype == null ? null : subtype.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.text = text == null ? null : text.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.applies = applies == null ? null : applies.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (subtype == null || subtype.isEmpty()) && (subject == null || subject.isEmpty()) && (text == null || text.isEmpty()) - && (issued == null || issued.isEmpty()) && (applies == null || applies.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()); - } - - } - - /** - * Unique Id for this contract. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract identifier", formalDefinition="Unique Id for this contract." ) - protected List identifier; - - /** - * Who and/or what this is about: typically Patient, Organization, property. - */ - @Child(name="subject", type={}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subject", formalDefinition="Who and/or what this is about: typically Patient, Organization, property." ) - protected List subject; - /** - * The actual objects that are the target of the reference (Who and/or what this is about: typically Patient, Organization, property.) - */ - protected List subjectTarget; - - - /** - * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. - */ - @Child(name="authority", type={Organization.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Authority", formalDefinition="A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc." ) - protected List authority; - /** - * The actual objects that are the target of the reference (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) - */ - protected List authorityTarget; - - - /** - * A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations. - */ - @Child(name="domain", type={Location.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Domain", formalDefinition="A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations." ) - protected List domain; - /** - * The actual objects that are the target of the reference (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) - */ - protected List domainTarget; - - - /** - * Type of contract (Privacy-Security, Agreement, Insurance). - */ - @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Type of contract", formalDefinition="Type of contract (Privacy-Security, Agreement, Insurance)." ) - protected CodeableConcept type; - - /** - * More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat). - */ - @Child(name="subtype", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Subtype of contract", formalDefinition="More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat)." ) - protected List subtype; - - /** - * When this was issued. - */ - @Child(name="issued", type={DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="When this was issued", formalDefinition="When this was issued." ) - protected DateTimeType issued; - - /** - * Relevant time/time-period when applicable. - */ - @Child(name="applies", type={Period.class}, order=6, min=0, max=1) - @Description(shortDefinition="Effective time", formalDefinition="Relevant time/time-period when applicable." ) - protected Period applies; - - /** - * The number of repetitions of a service or product. - */ - @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; - - /** - * The unit price product. - */ - @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The unit price product." ) - 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=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=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=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; - - /** - * Contract author or responsible party. - */ - @Child(name="author", type={Practitioner.class, RelatedPerson.class, Organization.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract author or responsible party", formalDefinition="Contract author or responsible party." ) - protected List author; - /** - * The actual objects that are the target of the reference (Contract author or responsible party.) - */ - protected List authorTarget; - - - /** - * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. - */ - @Child(name="grantor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="First Party or delegator", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) - protected List grantor; - /** - * The actual objects that are the target of the reference (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - protected List grantorTarget; - - - /** - * The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated. - */ - @Child(name="grantee", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Second Party or delegatee", formalDefinition="The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated." ) - protected List grantee; - /** - * The actual objects that are the target of the reference (The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) - */ - protected List granteeTarget; - - - /** - * Who witnesses the contract. - */ - @Child(name="witness", type={Practitioner.class, RelatedPerson.class, Patient.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Witness to the contract", formalDefinition="Who witnesses the contract." ) - protected List witness; - /** - * The actual objects that are the target of the reference (Who witnesses the contract.) - */ - protected List witnessTarget; - - - /** - * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. - */ - @Child(name="executor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Trustee", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) - protected List executor; - /** - * The actual objects that are the target of the reference (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - protected List executorTarget; - - - /** - * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. - */ - @Child(name="notary", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notary Public", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) - protected List notary; - /** - * The actual objects that are the target of the reference (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - protected List notaryTarget; - - - /** - * List or contract signatures. - */ - @Child(name="signer", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Signer", formalDefinition="List or contract signatures." ) - protected List signer; - - /** - * The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time. - */ - @Child(name="term", type={}, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The terms of the Contract", formalDefinition="The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time." ) - protected List term; - - /** - * Legally binding contract. - */ - @Child(name="binding", type={Attachment.class}, order=20, min=0, max=1) - @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding contract." ) - protected Attachment binding; - - /** - * Relevant time/time-period when applicable. - */ - @Child(name="bindingDateTime", type={DateTimeType.class}, order=21, min=0, max=1) - @Description(shortDefinition="Binding Contract effective time", formalDefinition="Relevant time/time-period when applicable." ) - protected DateTimeType bindingDateTime; - - /** - * Friendly Human readable form (might be a reference to the UI used to capture the contract). - */ - @Child(name="friendly", type={Attachment.class}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Human readable contract text", formalDefinition="Friendly Human readable form (might be a reference to the UI used to capture the contract)." ) - protected List friendly; - - /** - * Relevant time/time-period when applicable. - */ - @Child(name="friendlyDateTime", type={DateTimeType.class}, order=23, min=0, max=1) - @Description(shortDefinition="Human readable contract text effective time", formalDefinition="Relevant time/time-period when applicable." ) - protected DateTimeType friendlyDateTime; - - /** - * Legal text in Human readable form. - */ - @Child(name="legal", type={Attachment.class}, order=24, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Legal contract text", formalDefinition="Legal text in Human readable form." ) - protected List legal; - - /** - * Relevant time/time-period when applicable. - */ - @Child(name="legalDateTime", type={DateTimeType.class}, order=25, min=0, max=1) - @Description(shortDefinition="Legal contract text date time", formalDefinition="Relevant time/time-period when applicable." ) - protected DateTimeType legalDateTime; - - /** - * Computable Policy rules (e.g. XACML, DKAL, SecPal). - */ - @Child(name="rule", type={Attachment.class}, order=26, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Computable contract text", formalDefinition="Computable Policy rules (e.g. XACML, DKAL, SecPal)." ) - protected List rule; - - /** - * Relevant time/time-period when applicable. - */ - @Child(name="ruleDateTime", type={DateTimeType.class}, order=27, min=0, max=1) - @Description(shortDefinition="Computable contract text effect time", formalDefinition="Relevant time/time-period when applicable." ) - protected DateTimeType ruleDateTime; - - private static final long serialVersionUID = -467568093L; - - public Contract() { - super(); - } - - /** - * @return {@link #identifier} (Unique Id for this contract.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Unique Id for this contract.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #subject} (Who and/or what this is about: typically Patient, Organization, property.) - */ - public List getSubject() { - if (this.subject == null) - this.subject = new ArrayList(); - return this.subject; - } - - public boolean hasSubject() { - if (this.subject == null) - return false; - for (Reference item : this.subject) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subject} (Who and/or what this is about: typically Patient, Organization, property.) - */ - // syntactic sugar - public Reference addSubject() { //3 - Reference t = new Reference(); - if (this.subject == null) - this.subject = new ArrayList(); - this.subject.add(t); - return t; - } - - /** - * @return {@link #subject} (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. Who and/or what this is about: typically Patient, Organization, property.) - */ - public List getSubjectTarget() { - if (this.subjectTarget == null) - this.subjectTarget = new ArrayList(); - return this.subjectTarget; - } - - /** - * @return {@link #authority} (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) - */ - public List getAuthority() { - if (this.authority == null) - this.authority = new ArrayList(); - return this.authority; - } - - public boolean hasAuthority() { - if (this.authority == null) - return false; - for (Reference item : this.authority) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #authority} (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) - */ - // syntactic sugar - public Reference addAuthority() { //3 - Reference t = new Reference(); - if (this.authority == null) - this.authority = new ArrayList(); - this.authority.add(t); - return t; - } - - /** - * @return {@link #authority} (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. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) - */ - public List getAuthorityTarget() { - if (this.authorityTarget == null) - this.authorityTarget = new ArrayList(); - return this.authorityTarget; - } - - // syntactic sugar - /** - * @return {@link #authority} (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. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) - */ - public Organization addAuthorityTarget() { - Organization r = new Organization(); - if (this.authorityTarget == null) - this.authorityTarget = new ArrayList(); - this.authorityTarget.add(r); - return r; - } - - /** - * @return {@link #domain} (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) - */ - public List getDomain() { - if (this.domain == null) - this.domain = new ArrayList(); - return this.domain; - } - - public boolean hasDomain() { - if (this.domain == null) - return false; - for (Reference item : this.domain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #domain} (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) - */ - // syntactic sugar - public Reference addDomain() { //3 - Reference t = new Reference(); - if (this.domain == null) - this.domain = new ArrayList(); - this.domain.add(t); - return t; - } - - /** - * @return {@link #domain} (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. A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) - */ - public List getDomainTarget() { - if (this.domainTarget == null) - this.domainTarget = new ArrayList(); - return this.domainTarget; - } - - // syntactic sugar - /** - * @return {@link #domain} (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. A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) - */ - public Location addDomainTarget() { - Location r = new Location(); - if (this.domainTarget == null) - this.domainTarget = new ArrayList(); - this.domainTarget.add(r); - return r; - } - - /** - * @return {@link #type} (Type of contract (Privacy-Security, Agreement, Insurance).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of contract (Privacy-Security, Agreement, Insurance).) - */ - public Contract setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subtype} (More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).) - */ - public List getSubtype() { - if (this.subtype == null) - this.subtype = new ArrayList(); - return this.subtype; - } - - public boolean hasSubtype() { - if (this.subtype == null) - return false; - for (CodeableConcept item : this.subtype) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subtype} (More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).) - */ - // syntactic sugar - public CodeableConcept addSubtype() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.subtype == null) - this.subtype = new ArrayList(); - this.subtype.add(t); - return t; - } - - /** - * @return {@link #issued} (When this was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (When this was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public Contract setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return When this was issued. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value When this was issued. - */ - public Contract setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (Relevant time/time-period when applicable.) - */ - public Period getApplies() { - if (this.applies == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.applies"); - else if (Configuration.doAutoCreate()) - this.applies = new Period(); - return this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (Relevant time/time-period when applicable.) - */ - public Contract setApplies(Period value) { - this.applies = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public Contract setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The unit price product.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The unit price product.) - */ - public Contract setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public Contract setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public Contract setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public Contract setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public Contract setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public Contract setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #author} (Contract author or responsible party.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Contract author or responsible party.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - /** - * @return {@link #author} (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. Contract author or responsible party.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #grantor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - public List getGrantor() { - if (this.grantor == null) - this.grantor = new ArrayList(); - return this.grantor; - } - - public boolean hasGrantor() { - if (this.grantor == null) - return false; - for (Reference item : this.grantor) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #grantor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - // syntactic sugar - public Reference addGrantor() { //3 - Reference t = new Reference(); - if (this.grantor == null) - this.grantor = new ArrayList(); - this.grantor.add(t); - return t; - } - - /** - * @return {@link #grantor} (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. First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - public List getGrantorTarget() { - if (this.grantorTarget == null) - this.grantorTarget = new ArrayList(); - return this.grantorTarget; - } - - /** - * @return {@link #grantee} (The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) - */ - public List getGrantee() { - if (this.grantee == null) - this.grantee = new ArrayList(); - return this.grantee; - } - - public boolean hasGrantee() { - if (this.grantee == null) - return false; - for (Reference item : this.grantee) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #grantee} (The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) - */ - // syntactic sugar - public Reference addGrantee() { //3 - Reference t = new Reference(); - if (this.grantee == null) - this.grantee = new ArrayList(); - this.grantee.add(t); - return t; - } - - /** - * @return {@link #grantee} (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 Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) - */ - public List getGranteeTarget() { - if (this.granteeTarget == null) - this.granteeTarget = new ArrayList(); - return this.granteeTarget; - } - - /** - * @return {@link #witness} (Who witnesses the contract.) - */ - public List getWitness() { - if (this.witness == null) - this.witness = new ArrayList(); - return this.witness; - } - - public boolean hasWitness() { - if (this.witness == null) - return false; - for (Reference item : this.witness) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #witness} (Who witnesses the contract.) - */ - // syntactic sugar - public Reference addWitness() { //3 - Reference t = new Reference(); - if (this.witness == null) - this.witness = new ArrayList(); - this.witness.add(t); - return t; - } - - /** - * @return {@link #witness} (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. Who witnesses the contract.) - */ - public List getWitnessTarget() { - if (this.witnessTarget == null) - this.witnessTarget = new ArrayList(); - return this.witnessTarget; - } - - /** - * @return {@link #executor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - public List getExecutor() { - if (this.executor == null) - this.executor = new ArrayList(); - return this.executor; - } - - public boolean hasExecutor() { - if (this.executor == null) - return false; - for (Reference item : this.executor) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #executor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - // syntactic sugar - public Reference addExecutor() { //3 - Reference t = new Reference(); - if (this.executor == null) - this.executor = new ArrayList(); - this.executor.add(t); - return t; - } - - /** - * @return {@link #executor} (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. First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - public List getExecutorTarget() { - if (this.executorTarget == null) - this.executorTarget = new ArrayList(); - return this.executorTarget; - } - - /** - * @return {@link #notary} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - public List getNotary() { - if (this.notary == null) - this.notary = new ArrayList(); - return this.notary; - } - - public boolean hasNotary() { - if (this.notary == null) - return false; - for (Reference item : this.notary) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notary} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - // syntactic sugar - public Reference addNotary() { //3 - Reference t = new Reference(); - if (this.notary == null) - this.notary = new ArrayList(); - this.notary.add(t); - return t; - } - - /** - * @return {@link #notary} (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. First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) - */ - public List getNotaryTarget() { - if (this.notaryTarget == null) - this.notaryTarget = new ArrayList(); - return this.notaryTarget; - } - - /** - * @return {@link #signer} (List or contract signatures.) - */ - public List getSigner() { - if (this.signer == null) - this.signer = new ArrayList(); - return this.signer; - } - - public boolean hasSigner() { - if (this.signer == null) - return false; - for (ContractSignerComponent item : this.signer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #signer} (List or contract signatures.) - */ - // syntactic sugar - public ContractSignerComponent addSigner() { //3 - ContractSignerComponent t = new ContractSignerComponent(); - if (this.signer == null) - this.signer = new ArrayList(); - this.signer.add(t); - return t; - } - - /** - * @return {@link #term} (The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.) - */ - public List getTerm() { - if (this.term == null) - this.term = new ArrayList(); - return this.term; - } - - public boolean hasTerm() { - if (this.term == null) - return false; - for (ContractTermComponent item : this.term) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #term} (The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.) - */ - // syntactic sugar - public ContractTermComponent addTerm() { //3 - ContractTermComponent t = new ContractTermComponent(); - if (this.term == null) - this.term = new ArrayList(); - this.term.add(t); - return t; - } - - /** - * @return {@link #binding} (Legally binding contract.) - */ - public Attachment getBinding() { - if (this.binding == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.binding"); - else if (Configuration.doAutoCreate()) - this.binding = new Attachment(); - return this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Legally binding contract.) - */ - public Contract setBinding(Attachment value) { - this.binding = value; - return this; - } - - /** - * @return {@link #bindingDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getBindingDateTime" gives direct access to the value - */ - public DateTimeType getBindingDateTimeElement() { - if (this.bindingDateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.bindingDateTime"); - else if (Configuration.doAutoCreate()) - this.bindingDateTime = new DateTimeType(); - return this.bindingDateTime; - } - - public boolean hasBindingDateTimeElement() { - return this.bindingDateTime != null && !this.bindingDateTime.isEmpty(); - } - - public boolean hasBindingDateTime() { - return this.bindingDateTime != null && !this.bindingDateTime.isEmpty(); - } - - /** - * @param value {@link #bindingDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getBindingDateTime" gives direct access to the value - */ - public Contract setBindingDateTimeElement(DateTimeType value) { - this.bindingDateTime = value; - return this; - } - - /** - * @return Relevant time/time-period when applicable. - */ - public Date getBindingDateTime() { - return this.bindingDateTime == null ? null : this.bindingDateTime.getValue(); - } - - /** - * @param value Relevant time/time-period when applicable. - */ - public Contract setBindingDateTime(Date value) { - if (value == null) - this.bindingDateTime = null; - else { - if (this.bindingDateTime == null) - this.bindingDateTime = new DateTimeType(); - this.bindingDateTime.setValue(value); - } - return this; - } - - /** - * @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) - */ - public List getFriendly() { - if (this.friendly == null) - this.friendly = new ArrayList(); - return this.friendly; - } - - public boolean hasFriendly() { - if (this.friendly == null) - return false; - for (Attachment item : this.friendly) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) - */ - // syntactic sugar - public Attachment addFriendly() { //3 - Attachment t = new Attachment(); - if (this.friendly == null) - this.friendly = new ArrayList(); - this.friendly.add(t); - return t; - } - - /** - * @return {@link #friendlyDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getFriendlyDateTime" gives direct access to the value - */ - public DateTimeType getFriendlyDateTimeElement() { - if (this.friendlyDateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.friendlyDateTime"); - else if (Configuration.doAutoCreate()) - this.friendlyDateTime = new DateTimeType(); - return this.friendlyDateTime; - } - - public boolean hasFriendlyDateTimeElement() { - return this.friendlyDateTime != null && !this.friendlyDateTime.isEmpty(); - } - - public boolean hasFriendlyDateTime() { - return this.friendlyDateTime != null && !this.friendlyDateTime.isEmpty(); - } - - /** - * @param value {@link #friendlyDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getFriendlyDateTime" gives direct access to the value - */ - public Contract setFriendlyDateTimeElement(DateTimeType value) { - this.friendlyDateTime = value; - return this; - } - - /** - * @return Relevant time/time-period when applicable. - */ - public Date getFriendlyDateTime() { - return this.friendlyDateTime == null ? null : this.friendlyDateTime.getValue(); - } - - /** - * @param value Relevant time/time-period when applicable. - */ - public Contract setFriendlyDateTime(Date value) { - if (value == null) - this.friendlyDateTime = null; - else { - if (this.friendlyDateTime == null) - this.friendlyDateTime = new DateTimeType(); - this.friendlyDateTime.setValue(value); - } - return this; - } - - /** - * @return {@link #legal} (Legal text in Human readable form.) - */ - public List getLegal() { - if (this.legal == null) - this.legal = new ArrayList(); - return this.legal; - } - - public boolean hasLegal() { - if (this.legal == null) - return false; - for (Attachment item : this.legal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #legal} (Legal text in Human readable form.) - */ - // syntactic sugar - public Attachment addLegal() { //3 - Attachment t = new Attachment(); - if (this.legal == null) - this.legal = new ArrayList(); - this.legal.add(t); - return t; - } - - /** - * @return {@link #legalDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getLegalDateTime" gives direct access to the value - */ - public DateTimeType getLegalDateTimeElement() { - if (this.legalDateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.legalDateTime"); - else if (Configuration.doAutoCreate()) - this.legalDateTime = new DateTimeType(); - return this.legalDateTime; - } - - public boolean hasLegalDateTimeElement() { - return this.legalDateTime != null && !this.legalDateTime.isEmpty(); - } - - public boolean hasLegalDateTime() { - return this.legalDateTime != null && !this.legalDateTime.isEmpty(); - } - - /** - * @param value {@link #legalDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getLegalDateTime" gives direct access to the value - */ - public Contract setLegalDateTimeElement(DateTimeType value) { - this.legalDateTime = value; - return this; - } - - /** - * @return Relevant time/time-period when applicable. - */ - public Date getLegalDateTime() { - return this.legalDateTime == null ? null : this.legalDateTime.getValue(); - } - - /** - * @param value Relevant time/time-period when applicable. - */ - public Contract setLegalDateTime(Date value) { - if (value == null) - this.legalDateTime = null; - else { - if (this.legalDateTime == null) - this.legalDateTime = new DateTimeType(); - this.legalDateTime.setValue(value); - } - return this; - } - - /** - * @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (Attachment item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) - */ - // syntactic sugar - public Attachment addRule() { //3 - Attachment t = new Attachment(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - /** - * @return {@link #ruleDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getRuleDateTime" gives direct access to the value - */ - public DateTimeType getRuleDateTimeElement() { - if (this.ruleDateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.ruleDateTime"); - else if (Configuration.doAutoCreate()) - this.ruleDateTime = new DateTimeType(); - return this.ruleDateTime; - } - - public boolean hasRuleDateTimeElement() { - return this.ruleDateTime != null && !this.ruleDateTime.isEmpty(); - } - - public boolean hasRuleDateTime() { - return this.ruleDateTime != null && !this.ruleDateTime.isEmpty(); - } - - /** - * @param value {@link #ruleDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getRuleDateTime" gives direct access to the value - */ - public Contract setRuleDateTimeElement(DateTimeType value) { - this.ruleDateTime = value; - return this; - } - - /** - * @return Relevant time/time-period when applicable. - */ - public Date getRuleDateTime() { - return this.ruleDateTime == null ? null : this.ruleDateTime.getValue(); - } - - /** - * @param value Relevant time/time-period when applicable. - */ - public Contract setRuleDateTime(Date value) { - if (value == null) - this.ruleDateTime = null; - else { - if (this.ruleDateTime == null) - this.ruleDateTime = new DateTimeType(); - this.ruleDateTime.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique Id for this contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Any)", "Who and/or what this is about: typically Patient, Organization, property.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("domain", "Reference(Location)", "A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.", 0, java.lang.Integer.MAX_VALUE, domain)); - childrenList.add(new Property("type", "CodeableConcept", "Type of contract (Privacy-Security, Agreement, Insurance).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("issued", "dateTime", "When this was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("applies", "Period", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The unit price product.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("author", "Reference(Practitioner|RelatedPerson|Organization)", "Contract author or responsible party.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("grantor", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, grantor)); - childrenList.add(new Property("grantee", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.", 0, java.lang.Integer.MAX_VALUE, grantee)); - childrenList.add(new Property("witness", "Reference(Practitioner|RelatedPerson|Patient)", "Who witnesses the contract.", 0, java.lang.Integer.MAX_VALUE, witness)); - childrenList.add(new Property("executor", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, executor)); - childrenList.add(new Property("notary", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, notary)); - childrenList.add(new Property("signer", "", "List or contract signatures.", 0, java.lang.Integer.MAX_VALUE, signer)); - childrenList.add(new Property("term", "", "The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.", 0, java.lang.Integer.MAX_VALUE, term)); - childrenList.add(new Property("binding", "Attachment", "Legally binding contract.", 0, java.lang.Integer.MAX_VALUE, binding)); - childrenList.add(new Property("bindingDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, bindingDateTime)); - childrenList.add(new Property("friendly", "Attachment", "Friendly Human readable form (might be a reference to the UI used to capture the contract).", 0, java.lang.Integer.MAX_VALUE, friendly)); - childrenList.add(new Property("friendlyDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, friendlyDateTime)); - childrenList.add(new Property("legal", "Attachment", "Legal text in Human readable form.", 0, java.lang.Integer.MAX_VALUE, legal)); - childrenList.add(new Property("legalDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, legalDateTime)); - childrenList.add(new Property("rule", "Attachment", "Computable Policy rules (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, rule)); - childrenList.add(new Property("ruleDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, ruleDateTime)); - } - - public Contract copy() { - Contract dst = new Contract(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (subject != null) { - dst.subject = new ArrayList(); - for (Reference i : subject) - dst.subject.add(i.copy()); - }; - if (authority != null) { - dst.authority = new ArrayList(); - for (Reference i : authority) - dst.authority.add(i.copy()); - }; - if (domain != null) { - dst.domain = new ArrayList(); - for (Reference i : domain) - dst.domain.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (subtype != null) { - dst.subtype = new ArrayList(); - for (CodeableConcept i : subtype) - dst.subtype.add(i.copy()); - }; - dst.issued = issued == null ? null : issued.copy(); - dst.applies = applies == null ? null : applies.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - if (grantor != null) { - dst.grantor = new ArrayList(); - for (Reference i : grantor) - dst.grantor.add(i.copy()); - }; - if (grantee != null) { - dst.grantee = new ArrayList(); - for (Reference i : grantee) - dst.grantee.add(i.copy()); - }; - if (witness != null) { - dst.witness = new ArrayList(); - for (Reference i : witness) - dst.witness.add(i.copy()); - }; - if (executor != null) { - dst.executor = new ArrayList(); - for (Reference i : executor) - dst.executor.add(i.copy()); - }; - if (notary != null) { - dst.notary = new ArrayList(); - for (Reference i : notary) - dst.notary.add(i.copy()); - }; - if (signer != null) { - dst.signer = new ArrayList(); - for (ContractSignerComponent i : signer) - dst.signer.add(i.copy()); - }; - if (term != null) { - dst.term = new ArrayList(); - for (ContractTermComponent i : term) - dst.term.add(i.copy()); - }; - dst.binding = binding == null ? null : binding.copy(); - dst.bindingDateTime = bindingDateTime == null ? null : bindingDateTime.copy(); - if (friendly != null) { - dst.friendly = new ArrayList(); - for (Attachment i : friendly) - dst.friendly.add(i.copy()); - }; - dst.friendlyDateTime = friendlyDateTime == null ? null : friendlyDateTime.copy(); - if (legal != null) { - dst.legal = new ArrayList(); - for (Attachment i : legal) - dst.legal.add(i.copy()); - }; - dst.legalDateTime = legalDateTime == null ? null : legalDateTime.copy(); - if (rule != null) { - dst.rule = new ArrayList(); - for (Attachment i : rule) - dst.rule.add(i.copy()); - }; - dst.ruleDateTime = ruleDateTime == null ? null : ruleDateTime.copy(); - return dst; - } - - protected Contract typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (authority == null || authority.isEmpty()) && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) - && (subtype == null || subtype.isEmpty()) && (issued == null || issued.isEmpty()) && (applies == null || applies.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (author == null || author.isEmpty()) && (grantor == null || grantor.isEmpty()) && (grantee == null || grantee.isEmpty()) - && (witness == null || witness.isEmpty()) && (executor == null || executor.isEmpty()) && (notary == null || notary.isEmpty()) - && (signer == null || signer.isEmpty()) && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) - && (bindingDateTime == null || bindingDateTime.isEmpty()) && (friendly == null || friendly.isEmpty()) - && (friendlyDateTime == null || friendlyDateTime.isEmpty()) && (legal == null || legal.isEmpty()) - && (legalDateTime == null || legalDateTime.isEmpty()) && (rule == null || rule.isEmpty()) - && (ruleDateTime == null || ruleDateTime.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Contract; - } - - @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the target of the contract (if a patient)", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the target of the contract", type="reference" ) - public static final String SP_SUBJECT = "subject"; - -} - + +/* + 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 java.math.*; +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; +/** + * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + */ +@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") +public class Contract extends DomainResource { + + @Block() + public static class ContractSignerComponent extends BackboneElement { + /** + * Party or role who is signing. + */ + @Child(name="type", type={Coding.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Signer Type", formalDefinition="Party or role who is signing." ) + protected List type; + + /** + * The DSIG signature contents in Base64. + */ + @Child(name="signature", type={StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Documentation Signature", formalDefinition="The DSIG signature contents in Base64." ) + protected StringType signature; + + private static final long serialVersionUID = 584509693L; + + public ContractSignerComponent() { + super(); + } + + public ContractSignerComponent(StringType signature) { + super(); + this.signature = signature; + } + + /** + * @return {@link #type} (Party or role who is signing.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Party or role who is signing.) + */ + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #signature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public StringType getSignatureElement() { + if (this.signature == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractSignerComponent.signature"); + else if (Configuration.doAutoCreate()) + this.signature = new StringType(); + return this.signature; + } + + public boolean hasSignatureElement() { + return this.signature != null && !this.signature.isEmpty(); + } + + public boolean hasSignature() { + return this.signature != null && !this.signature.isEmpty(); + } + + /** + * @param value {@link #signature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value + */ + public ContractSignerComponent setSignatureElement(StringType value) { + this.signature = value; + return this; + } + + /** + * @return The DSIG signature contents in Base64. + */ + public String getSignature() { + return this.signature == null ? null : this.signature.getValue(); + } + + /** + * @param value The DSIG signature contents in Base64. + */ + public ContractSignerComponent setSignature(String value) { + if (this.signature == null) + this.signature = new StringType(); + this.signature.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party or role who is signing.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("signature", "string", "The DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); + } + + public ContractSignerComponent copy() { + ContractSignerComponent dst = new ContractSignerComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + dst.signature = signature == null ? null : signature.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (signature == null || signature.isEmpty()) + ; + } + + } + + @Block() + public static class ContractTermComponent extends BackboneElement { + /** + * Unique Id for this particular term. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Term identifier", formalDefinition="Unique Id for this particular term." ) + protected Identifier identifier; + + /** + * The type of the term. + */ + @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Term type", formalDefinition="The type of the term." ) + protected CodeableConcept type; + + /** + * The subtype of the term which is appropriate to the term type. + */ + @Child(name="subtype", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Term subtype", formalDefinition="The subtype of the term which is appropriate to the term type." ) + protected CodeableConcept subtype; + + /** + * Who or what the contract term is about. + */ + @Child(name="subject", type={}, order=4, min=0, max=1) + @Description(shortDefinition="Subject for the Term", formalDefinition="Who or what the contract term is about." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the contract term is about.) + */ + protected Resource subjectTarget; + + /** + * Human readable form of the term of the contract. + */ + @Child(name="text", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Human readable Term text", formalDefinition="Human readable form of the term of the contract." ) + protected StringType text; + + /** + * When this term was issued. + */ + @Child(name="issued", type={DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="When issued", formalDefinition="When this term was issued." ) + protected DateTimeType issued; + + /** + * Relevant time/time-period when the term is applicable. + */ + @Child(name="applies", type={Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="When effective", formalDefinition="Relevant time/time-period when the term is applicable." ) + protected Period applies; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The unit price product. + */ + @Child(name="unitPrice", type={Money.class}, order=9, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The unit price product." ) + 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=10, 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=11, 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=12, 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; + + private static final long serialVersionUID = -1958595473L; + + public ContractTermComponent() { + super(); + } + + /** + * @return {@link #identifier} (Unique Id for this particular term.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique Id for this particular term.) + */ + public ContractTermComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #type} (The type of the term.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the term.) + */ + public ContractTermComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subtype} (The subtype of the term which is appropriate to the term type.) + */ + public CodeableConcept getSubtype() { + if (this.subtype == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.subtype"); + else if (Configuration.doAutoCreate()) + this.subtype = new CodeableConcept(); + return this.subtype; + } + + public boolean hasSubtype() { + return this.subtype != null && !this.subtype.isEmpty(); + } + + /** + * @param value {@link #subtype} (The subtype of the term which is appropriate to the term type.) + */ + public ContractTermComponent setSubtype(CodeableConcept value) { + this.subtype = value; + return this; + } + + /** + * @return {@link #subject} (Who or what the contract term is about.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.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} (Who or what the contract term is about.) + */ + public ContractTermComponent 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. (Who or what the contract term is about.) + */ + public Resource getSubjectTarget() { + 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. (Who or what the contract term is about.) + */ + public ContractTermComponent setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #text} (Human readable form of the term of the contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Human readable form of the term of the contract.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public ContractTermComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Human readable form of the term of the contract. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Human readable form of the term of the contract. + */ + public ContractTermComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #issued} (When this term was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (When this term was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public ContractTermComponent setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this term was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this term was issued. + */ + public ContractTermComponent setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (Relevant time/time-period when the term is applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time/time-period when the term is applicable.) + */ + public ContractTermComponent setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ContractTermComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The unit price product.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The unit price product.) + */ + public ContractTermComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ContractTermComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public ContractTermComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ContractTermComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public ContractTermComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public ContractTermComponent setNet(Money value) { + this.net = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique Id for this particular term.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "The type of the term.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "The subtype of the term which is appropriate to the term type.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("subject", "Reference(Any)", "Who or what the contract term is about.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("text", "string", "Human readable form of the term of the contract.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("issued", "dateTime", "When this term was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time/time-period when the term is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The unit price product.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + } + + public ContractTermComponent copy() { + ContractTermComponent dst = new ContractTermComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.type = type == null ? null : type.copy(); + dst.subtype = subtype == null ? null : subtype.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.text = text == null ? null : text.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (subtype == null || subtype.isEmpty()) && (subject == null || subject.isEmpty()) && (text == null || text.isEmpty()) + && (issued == null || issued.isEmpty()) && (applies == null || applies.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) + && (net == null || net.isEmpty()); + } + + } + + /** + * Unique Id for this contract. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract identifier", formalDefinition="Unique Id for this contract." ) + protected List identifier; + + /** + * Who and/or what this is about: typically Patient, Organization, property. + */ + @Child(name="subject", type={}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subject", formalDefinition="Who and/or what this is about: typically Patient, Organization, property." ) + protected List subject; + /** + * The actual objects that are the target of the reference (Who and/or what this is about: typically Patient, Organization, property.) + */ + protected List subjectTarget; + + + /** + * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + */ + @Child(name="authority", type={Organization.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Authority", formalDefinition="A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc." ) + protected List authority; + /** + * The actual objects that are the target of the reference (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + protected List authorityTarget; + + + /** + * A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations. + */ + @Child(name="domain", type={Location.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Domain", formalDefinition="A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations." ) + protected List domain; + /** + * The actual objects that are the target of the reference (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + protected List domainTarget; + + + /** + * Type of contract (Privacy-Security, Agreement, Insurance). + */ + @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Type of contract", formalDefinition="Type of contract (Privacy-Security, Agreement, Insurance)." ) + protected CodeableConcept type; + + /** + * More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat). + */ + @Child(name="subtype", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Subtype of contract", formalDefinition="More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat)." ) + protected List subtype; + + /** + * When this was issued. + */ + @Child(name="issued", type={DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="When this was issued", formalDefinition="When this was issued." ) + protected DateTimeType issued; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="applies", type={Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="Effective time", formalDefinition="Relevant time/time-period when applicable." ) + protected Period applies; + + /** + * The number of repetitions of a service or product. + */ + @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; + + /** + * The unit price product. + */ + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The unit price product." ) + 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=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=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=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; + + /** + * Contract author or responsible party. + */ + @Child(name="author", type={Practitioner.class, RelatedPerson.class, Organization.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract author or responsible party", formalDefinition="Contract author or responsible party." ) + protected List author; + /** + * The actual objects that are the target of the reference (Contract author or responsible party.) + */ + protected List authorTarget; + + + /** + * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. + */ + @Child(name="grantor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="First Party or delegator", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) + protected List grantor; + /** + * The actual objects that are the target of the reference (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + protected List grantorTarget; + + + /** + * The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated. + */ + @Child(name="grantee", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Second Party or delegatee", formalDefinition="The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated." ) + protected List grantee; + /** + * The actual objects that are the target of the reference (The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) + */ + protected List granteeTarget; + + + /** + * Who witnesses the contract. + */ + @Child(name="witness", type={Practitioner.class, RelatedPerson.class, Patient.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Witness to the contract", formalDefinition="Who witnesses the contract." ) + protected List witness; + /** + * The actual objects that are the target of the reference (Who witnesses the contract.) + */ + protected List witnessTarget; + + + /** + * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. + */ + @Child(name="executor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Trustee", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) + protected List executor; + /** + * The actual objects that are the target of the reference (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + protected List executorTarget; + + + /** + * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. + */ + @Child(name="notary", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notary Public", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) + protected List notary; + /** + * The actual objects that are the target of the reference (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + protected List notaryTarget; + + + /** + * List or contract signatures. + */ + @Child(name="signer", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Signer", formalDefinition="List or contract signatures." ) + protected List signer; + + /** + * The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time. + */ + @Child(name="term", type={}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The terms of the Contract", formalDefinition="The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time." ) + protected List term; + + /** + * Legally binding contract. + */ + @Child(name="binding", type={Attachment.class}, order=20, min=0, max=1) + @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding contract." ) + protected Attachment binding; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="bindingDateTime", type={DateTimeType.class}, order=21, min=0, max=1) + @Description(shortDefinition="Binding Contract effective time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType bindingDateTime; + + /** + * Friendly Human readable form (might be a reference to the UI used to capture the contract). + */ + @Child(name="friendly", type={Attachment.class}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Human readable contract text", formalDefinition="Friendly Human readable form (might be a reference to the UI used to capture the contract)." ) + protected List friendly; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="friendlyDateTime", type={DateTimeType.class}, order=23, min=0, max=1) + @Description(shortDefinition="Human readable contract text effective time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType friendlyDateTime; + + /** + * Legal text in Human readable form. + */ + @Child(name="legal", type={Attachment.class}, order=24, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Legal contract text", formalDefinition="Legal text in Human readable form." ) + protected List legal; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="legalDateTime", type={DateTimeType.class}, order=25, min=0, max=1) + @Description(shortDefinition="Legal contract text date time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType legalDateTime; + + /** + * Computable Policy rules (e.g. XACML, DKAL, SecPal). + */ + @Child(name="rule", type={Attachment.class}, order=26, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Computable contract text", formalDefinition="Computable Policy rules (e.g. XACML, DKAL, SecPal)." ) + protected List rule; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="ruleDateTime", type={DateTimeType.class}, order=27, min=0, max=1) + @Description(shortDefinition="Computable contract text effect time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType ruleDateTime; + + private static final long serialVersionUID = -467568093L; + + public Contract() { + super(); + } + + /** + * @return {@link #identifier} (Unique Id for this contract.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Unique Id for this contract.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #subject} (Who and/or what this is about: typically Patient, Organization, property.) + */ + public List getSubject() { + if (this.subject == null) + this.subject = new ArrayList(); + return this.subject; + } + + public boolean hasSubject() { + if (this.subject == null) + return false; + for (Reference item : this.subject) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subject} (Who and/or what this is about: typically Patient, Organization, property.) + */ + // syntactic sugar + public Reference addSubject() { //3 + Reference t = new Reference(); + if (this.subject == null) + this.subject = new ArrayList(); + this.subject.add(t); + return t; + } + + /** + * @return {@link #subject} (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. Who and/or what this is about: typically Patient, Organization, property.) + */ + public List getSubjectTarget() { + if (this.subjectTarget == null) + this.subjectTarget = new ArrayList(); + return this.subjectTarget; + } + + /** + * @return {@link #authority} (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + public List getAuthority() { + if (this.authority == null) + this.authority = new ArrayList(); + return this.authority; + } + + public boolean hasAuthority() { + if (this.authority == null) + return false; + for (Reference item : this.authority) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #authority} (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + // syntactic sugar + public Reference addAuthority() { //3 + Reference t = new Reference(); + if (this.authority == null) + this.authority = new ArrayList(); + this.authority.add(t); + return t; + } + + /** + * @return {@link #authority} (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. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + public List getAuthorityTarget() { + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + return this.authorityTarget; + } + + // syntactic sugar + /** + * @return {@link #authority} (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. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + public Organization addAuthorityTarget() { + Organization r = new Organization(); + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + this.authorityTarget.add(r); + return r; + } + + /** + * @return {@link #domain} (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + public List getDomain() { + if (this.domain == null) + this.domain = new ArrayList(); + return this.domain; + } + + public boolean hasDomain() { + if (this.domain == null) + return false; + for (Reference item : this.domain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #domain} (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + // syntactic sugar + public Reference addDomain() { //3 + Reference t = new Reference(); + if (this.domain == null) + this.domain = new ArrayList(); + this.domain.add(t); + return t; + } + + /** + * @return {@link #domain} (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. A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + public List getDomainTarget() { + if (this.domainTarget == null) + this.domainTarget = new ArrayList(); + return this.domainTarget; + } + + // syntactic sugar + /** + * @return {@link #domain} (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. A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + public Location addDomainTarget() { + Location r = new Location(); + if (this.domainTarget == null) + this.domainTarget = new ArrayList(); + this.domainTarget.add(r); + return r; + } + + /** + * @return {@link #type} (Type of contract (Privacy-Security, Agreement, Insurance).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Type of contract (Privacy-Security, Agreement, Insurance).) + */ + public Contract setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subtype} (More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).) + */ + public List getSubtype() { + if (this.subtype == null) + this.subtype = new ArrayList(); + return this.subtype; + } + + public boolean hasSubtype() { + if (this.subtype == null) + return false; + for (CodeableConcept item : this.subtype) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subtype} (More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).) + */ + // syntactic sugar + public CodeableConcept addSubtype() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.subtype == null) + this.subtype = new ArrayList(); + this.subtype.add(t); + return t; + } + + /** + * @return {@link #issued} (When this was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (When this was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public Contract setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this was issued. + */ + public Contract setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (Relevant time/time-period when applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time/time-period when applicable.) + */ + public Contract setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public Contract setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The unit price product.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The unit price product.) + */ + public Contract setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public Contract setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public Contract setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public Contract setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public Contract setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public Contract setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #author} (Contract author or responsible party.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Contract author or responsible party.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + /** + * @return {@link #author} (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. Contract author or responsible party.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #grantor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + public List getGrantor() { + if (this.grantor == null) + this.grantor = new ArrayList(); + return this.grantor; + } + + public boolean hasGrantor() { + if (this.grantor == null) + return false; + for (Reference item : this.grantor) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #grantor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + // syntactic sugar + public Reference addGrantor() { //3 + Reference t = new Reference(); + if (this.grantor == null) + this.grantor = new ArrayList(); + this.grantor.add(t); + return t; + } + + /** + * @return {@link #grantor} (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. First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + public List getGrantorTarget() { + if (this.grantorTarget == null) + this.grantorTarget = new ArrayList(); + return this.grantorTarget; + } + + /** + * @return {@link #grantee} (The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) + */ + public List getGrantee() { + if (this.grantee == null) + this.grantee = new ArrayList(); + return this.grantee; + } + + public boolean hasGrantee() { + if (this.grantee == null) + return false; + for (Reference item : this.grantee) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #grantee} (The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) + */ + // syntactic sugar + public Reference addGrantee() { //3 + Reference t = new Reference(); + if (this.grantee == null) + this.grantee = new ArrayList(); + this.grantee.add(t); + return t; + } + + /** + * @return {@link #grantee} (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 Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.) + */ + public List getGranteeTarget() { + if (this.granteeTarget == null) + this.granteeTarget = new ArrayList(); + return this.granteeTarget; + } + + /** + * @return {@link #witness} (Who witnesses the contract.) + */ + public List getWitness() { + if (this.witness == null) + this.witness = new ArrayList(); + return this.witness; + } + + public boolean hasWitness() { + if (this.witness == null) + return false; + for (Reference item : this.witness) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #witness} (Who witnesses the contract.) + */ + // syntactic sugar + public Reference addWitness() { //3 + Reference t = new Reference(); + if (this.witness == null) + this.witness = new ArrayList(); + this.witness.add(t); + return t; + } + + /** + * @return {@link #witness} (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. Who witnesses the contract.) + */ + public List getWitnessTarget() { + if (this.witnessTarget == null) + this.witnessTarget = new ArrayList(); + return this.witnessTarget; + } + + /** + * @return {@link #executor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + public List getExecutor() { + if (this.executor == null) + this.executor = new ArrayList(); + return this.executor; + } + + public boolean hasExecutor() { + if (this.executor == null) + return false; + for (Reference item : this.executor) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #executor} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + // syntactic sugar + public Reference addExecutor() { //3 + Reference t = new Reference(); + if (this.executor == null) + this.executor = new ArrayList(); + this.executor.add(t); + return t; + } + + /** + * @return {@link #executor} (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. First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + public List getExecutorTarget() { + if (this.executorTarget == null) + this.executorTarget = new ArrayList(); + return this.executorTarget; + } + + /** + * @return {@link #notary} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + public List getNotary() { + if (this.notary == null) + this.notary = new ArrayList(); + return this.notary; + } + + public boolean hasNotary() { + if (this.notary == null) + return false; + for (Reference item : this.notary) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notary} (First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + // syntactic sugar + public Reference addNotary() { //3 + Reference t = new Reference(); + if (this.notary == null) + this.notary = new ArrayList(); + this.notary.add(t); + return t; + } + + /** + * @return {@link #notary} (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. First Party to the contract, may be the party who confers or delegates the rights defined in the contract.) + */ + public List getNotaryTarget() { + if (this.notaryTarget == null) + this.notaryTarget = new ArrayList(); + return this.notaryTarget; + } + + /** + * @return {@link #signer} (List or contract signatures.) + */ + public List getSigner() { + if (this.signer == null) + this.signer = new ArrayList(); + return this.signer; + } + + public boolean hasSigner() { + if (this.signer == null) + return false; + for (ContractSignerComponent item : this.signer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #signer} (List or contract signatures.) + */ + // syntactic sugar + public ContractSignerComponent addSigner() { //3 + ContractSignerComponent t = new ContractSignerComponent(); + if (this.signer == null) + this.signer = new ArrayList(); + this.signer.add(t); + return t; + } + + /** + * @return {@link #term} (The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.) + */ + public List getTerm() { + if (this.term == null) + this.term = new ArrayList(); + return this.term; + } + + public boolean hasTerm() { + if (this.term == null) + return false; + for (ContractTermComponent item : this.term) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #term} (The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.) + */ + // syntactic sugar + public ContractTermComponent addTerm() { //3 + ContractTermComponent t = new ContractTermComponent(); + if (this.term == null) + this.term = new ArrayList(); + this.term.add(t); + return t; + } + + /** + * @return {@link #binding} (Legally binding contract.) + */ + public Attachment getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new Attachment(); + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Legally binding contract.) + */ + public Contract setBinding(Attachment value) { + this.binding = value; + return this; + } + + /** + * @return {@link #bindingDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getBindingDateTime" gives direct access to the value + */ + public DateTimeType getBindingDateTimeElement() { + if (this.bindingDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.bindingDateTime"); + else if (Configuration.doAutoCreate()) + this.bindingDateTime = new DateTimeType(); + return this.bindingDateTime; + } + + public boolean hasBindingDateTimeElement() { + return this.bindingDateTime != null && !this.bindingDateTime.isEmpty(); + } + + public boolean hasBindingDateTime() { + return this.bindingDateTime != null && !this.bindingDateTime.isEmpty(); + } + + /** + * @param value {@link #bindingDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getBindingDateTime" gives direct access to the value + */ + public Contract setBindingDateTimeElement(DateTimeType value) { + this.bindingDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getBindingDateTime() { + return this.bindingDateTime == null ? null : this.bindingDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setBindingDateTime(Date value) { + if (value == null) + this.bindingDateTime = null; + else { + if (this.bindingDateTime == null) + this.bindingDateTime = new DateTimeType(); + this.bindingDateTime.setValue(value); + } + return this; + } + + /** + * @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) + */ + public List getFriendly() { + if (this.friendly == null) + this.friendly = new ArrayList(); + return this.friendly; + } + + public boolean hasFriendly() { + if (this.friendly == null) + return false; + for (Attachment item : this.friendly) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) + */ + // syntactic sugar + public Attachment addFriendly() { //3 + Attachment t = new Attachment(); + if (this.friendly == null) + this.friendly = new ArrayList(); + this.friendly.add(t); + return t; + } + + /** + * @return {@link #friendlyDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getFriendlyDateTime" gives direct access to the value + */ + public DateTimeType getFriendlyDateTimeElement() { + if (this.friendlyDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.friendlyDateTime"); + else if (Configuration.doAutoCreate()) + this.friendlyDateTime = new DateTimeType(); + return this.friendlyDateTime; + } + + public boolean hasFriendlyDateTimeElement() { + return this.friendlyDateTime != null && !this.friendlyDateTime.isEmpty(); + } + + public boolean hasFriendlyDateTime() { + return this.friendlyDateTime != null && !this.friendlyDateTime.isEmpty(); + } + + /** + * @param value {@link #friendlyDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getFriendlyDateTime" gives direct access to the value + */ + public Contract setFriendlyDateTimeElement(DateTimeType value) { + this.friendlyDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getFriendlyDateTime() { + return this.friendlyDateTime == null ? null : this.friendlyDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setFriendlyDateTime(Date value) { + if (value == null) + this.friendlyDateTime = null; + else { + if (this.friendlyDateTime == null) + this.friendlyDateTime = new DateTimeType(); + this.friendlyDateTime.setValue(value); + } + return this; + } + + /** + * @return {@link #legal} (Legal text in Human readable form.) + */ + public List getLegal() { + if (this.legal == null) + this.legal = new ArrayList(); + return this.legal; + } + + public boolean hasLegal() { + if (this.legal == null) + return false; + for (Attachment item : this.legal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #legal} (Legal text in Human readable form.) + */ + // syntactic sugar + public Attachment addLegal() { //3 + Attachment t = new Attachment(); + if (this.legal == null) + this.legal = new ArrayList(); + this.legal.add(t); + return t; + } + + /** + * @return {@link #legalDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getLegalDateTime" gives direct access to the value + */ + public DateTimeType getLegalDateTimeElement() { + if (this.legalDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.legalDateTime"); + else if (Configuration.doAutoCreate()) + this.legalDateTime = new DateTimeType(); + return this.legalDateTime; + } + + public boolean hasLegalDateTimeElement() { + return this.legalDateTime != null && !this.legalDateTime.isEmpty(); + } + + public boolean hasLegalDateTime() { + return this.legalDateTime != null && !this.legalDateTime.isEmpty(); + } + + /** + * @param value {@link #legalDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getLegalDateTime" gives direct access to the value + */ + public Contract setLegalDateTimeElement(DateTimeType value) { + this.legalDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getLegalDateTime() { + return this.legalDateTime == null ? null : this.legalDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setLegalDateTime(Date value) { + if (value == null) + this.legalDateTime = null; + else { + if (this.legalDateTime == null) + this.legalDateTime = new DateTimeType(); + this.legalDateTime.setValue(value); + } + return this; + } + + /** + * @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) + */ + public List getRule() { + if (this.rule == null) + this.rule = new ArrayList(); + return this.rule; + } + + public boolean hasRule() { + if (this.rule == null) + return false; + for (Attachment item : this.rule) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) + */ + // syntactic sugar + public Attachment addRule() { //3 + Attachment t = new Attachment(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + /** + * @return {@link #ruleDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getRuleDateTime" gives direct access to the value + */ + public DateTimeType getRuleDateTimeElement() { + if (this.ruleDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.ruleDateTime"); + else if (Configuration.doAutoCreate()) + this.ruleDateTime = new DateTimeType(); + return this.ruleDateTime; + } + + public boolean hasRuleDateTimeElement() { + return this.ruleDateTime != null && !this.ruleDateTime.isEmpty(); + } + + public boolean hasRuleDateTime() { + return this.ruleDateTime != null && !this.ruleDateTime.isEmpty(); + } + + /** + * @param value {@link #ruleDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getRuleDateTime" gives direct access to the value + */ + public Contract setRuleDateTimeElement(DateTimeType value) { + this.ruleDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getRuleDateTime() { + return this.ruleDateTime == null ? null : this.ruleDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setRuleDateTime(Date value) { + if (value == null) + this.ruleDateTime = null; + else { + if (this.ruleDateTime == null) + this.ruleDateTime = new DateTimeType(); + this.ruleDateTime.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique Id for this contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Any)", "Who and/or what this is about: typically Patient, Organization, property.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("domain", "Reference(Location)", "A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.", 0, java.lang.Integer.MAX_VALUE, domain)); + childrenList.add(new Property("type", "CodeableConcept", "Type of contract (Privacy-Security, Agreement, Insurance).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("issued", "dateTime", "When this was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The unit price product.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("author", "Reference(Practitioner|RelatedPerson|Organization)", "Contract author or responsible party.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("grantor", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, grantor)); + childrenList.add(new Property("grantee", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated.", 0, java.lang.Integer.MAX_VALUE, grantee)); + childrenList.add(new Property("witness", "Reference(Practitioner|RelatedPerson|Patient)", "Who witnesses the contract.", 0, java.lang.Integer.MAX_VALUE, witness)); + childrenList.add(new Property("executor", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, executor)); + childrenList.add(new Property("notary", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, notary)); + childrenList.add(new Property("signer", "", "List or contract signatures.", 0, java.lang.Integer.MAX_VALUE, signer)); + childrenList.add(new Property("term", "", "The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("binding", "Attachment", "Legally binding contract.", 0, java.lang.Integer.MAX_VALUE, binding)); + childrenList.add(new Property("bindingDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, bindingDateTime)); + childrenList.add(new Property("friendly", "Attachment", "Friendly Human readable form (might be a reference to the UI used to capture the contract).", 0, java.lang.Integer.MAX_VALUE, friendly)); + childrenList.add(new Property("friendlyDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, friendlyDateTime)); + childrenList.add(new Property("legal", "Attachment", "Legal text in Human readable form.", 0, java.lang.Integer.MAX_VALUE, legal)); + childrenList.add(new Property("legalDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, legalDateTime)); + childrenList.add(new Property("rule", "Attachment", "Computable Policy rules (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, rule)); + childrenList.add(new Property("ruleDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, ruleDateTime)); + } + + public Contract copy() { + Contract dst = new Contract(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (subject != null) { + dst.subject = new ArrayList(); + for (Reference i : subject) + dst.subject.add(i.copy()); + }; + if (authority != null) { + dst.authority = new ArrayList(); + for (Reference i : authority) + dst.authority.add(i.copy()); + }; + if (domain != null) { + dst.domain = new ArrayList(); + for (Reference i : domain) + dst.domain.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (subtype != null) { + dst.subtype = new ArrayList(); + for (CodeableConcept i : subtype) + dst.subtype.add(i.copy()); + }; + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + if (grantor != null) { + dst.grantor = new ArrayList(); + for (Reference i : grantor) + dst.grantor.add(i.copy()); + }; + if (grantee != null) { + dst.grantee = new ArrayList(); + for (Reference i : grantee) + dst.grantee.add(i.copy()); + }; + if (witness != null) { + dst.witness = new ArrayList(); + for (Reference i : witness) + dst.witness.add(i.copy()); + }; + if (executor != null) { + dst.executor = new ArrayList(); + for (Reference i : executor) + dst.executor.add(i.copy()); + }; + if (notary != null) { + dst.notary = new ArrayList(); + for (Reference i : notary) + dst.notary.add(i.copy()); + }; + if (signer != null) { + dst.signer = new ArrayList(); + for (ContractSignerComponent i : signer) + dst.signer.add(i.copy()); + }; + if (term != null) { + dst.term = new ArrayList(); + for (ContractTermComponent i : term) + dst.term.add(i.copy()); + }; + dst.binding = binding == null ? null : binding.copy(); + dst.bindingDateTime = bindingDateTime == null ? null : bindingDateTime.copy(); + if (friendly != null) { + dst.friendly = new ArrayList(); + for (Attachment i : friendly) + dst.friendly.add(i.copy()); + }; + dst.friendlyDateTime = friendlyDateTime == null ? null : friendlyDateTime.copy(); + if (legal != null) { + dst.legal = new ArrayList(); + for (Attachment i : legal) + dst.legal.add(i.copy()); + }; + dst.legalDateTime = legalDateTime == null ? null : legalDateTime.copy(); + if (rule != null) { + dst.rule = new ArrayList(); + for (Attachment i : rule) + dst.rule.add(i.copy()); + }; + dst.ruleDateTime = ruleDateTime == null ? null : ruleDateTime.copy(); + return dst; + } + + protected Contract typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (authority == null || authority.isEmpty()) && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) + && (subtype == null || subtype.isEmpty()) && (issued == null || issued.isEmpty()) && (applies == null || applies.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (author == null || author.isEmpty()) && (grantor == null || grantor.isEmpty()) && (grantee == null || grantee.isEmpty()) + && (witness == null || witness.isEmpty()) && (executor == null || executor.isEmpty()) && (notary == null || notary.isEmpty()) + && (signer == null || signer.isEmpty()) && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) + && (bindingDateTime == null || bindingDateTime.isEmpty()) && (friendly == null || friendly.isEmpty()) + && (friendlyDateTime == null || friendlyDateTime.isEmpty()) && (legal == null || legal.isEmpty()) + && (legalDateTime == null || legalDateTime.isEmpty()) && (rule == null || rule.isEmpty()) + && (ruleDateTime == null || ruleDateTime.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Contract; + } + + @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the target of the contract (if a patient)", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="Contract.subject", description="The identity of the target of the contract", type="reference" ) + public static final String SP_SUBJECT = "subject"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java index 3a490e06cab..e4c01abeca3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java @@ -20,783 +20,783 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ -@ResourceDef(name="Contraindication", profile="http://hl7.org/fhir/Profile/Contraindication") -public class Contraindication extends DomainResource { - - @Block() - public static class ContraindicationMitigationComponent extends BackboneElement { - /** - * Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication. - */ - @Child(name="action", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="What mitigation?", formalDefinition="Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication." ) - protected CodeableConcept action; - - /** - * Indicates when the mitigating action was documented. - */ - @Child(name="date", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Date committed", formalDefinition="Indicates when the mitigating action was documented." ) - protected DateTimeType date; - - /** - * Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. - */ - @Child(name="author", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is committing?", formalDefinition="Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - protected Practitioner authorTarget; - - private static final long serialVersionUID = -1994768436L; - - public ContraindicationMitigationComponent() { - super(); - } - - public ContraindicationMitigationComponent(CodeableConcept action) { - super(); - this.action = action; - } - - /** - * @return {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) - */ - public CodeableConcept getAction() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new CodeableConcept(); - return this.action; - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) - */ - public ContraindicationMitigationComponent setAction(CodeableConcept value) { - this.action = value; - return this; - } - - /** - * @return {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ContraindicationMitigationComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Indicates when the mitigating action was documented. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Indicates when the mitigating action was documented. - */ - public ContraindicationMitigationComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public ContraindicationMitigationComponent setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public ContraindicationMitigationComponent setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "CodeableConcept", "Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("date", "dateTime", "Indicates when the mitigating action was documented.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("author", "Reference(Practitioner)", "Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.", 0, java.lang.Integer.MAX_VALUE, author)); - } - - public ContraindicationMitigationComponent copy() { - ContraindicationMitigationComponent dst = new ContraindicationMitigationComponent(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - dst.date = date == null ? null : date.copy(); - dst.author = author == null ? null : author.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (date == null || date.isEmpty()) - && (author == null || author.isEmpty()); - } - - } - - /** - * Indicates the patient whose record the contraindication is associated with. - */ - @Child(name="patient", type={Patient.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Associated patient", formalDefinition="Indicates the patient whose record the contraindication is associated with." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Indicates the patient whose record the contraindication is associated with.) - */ - protected Patient patientTarget; - - /** - * Identifies the general type of issue identified. - */ - @Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="E.g. Drug-drug, duplicate therapy, etc.", formalDefinition="Identifies the general type of issue identified." ) - protected CodeableConcept category; - - /** - * Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - @Child(name="severity", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="high | medium | low", formalDefinition="Indicates the degree of importance associated with the identified issue based on the potential impact on the patient." ) - protected CodeType severity; - - /** - * Indicates the resource representing the current activity or proposed activity that. - */ - @Child(name="implicated", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Problem resource", formalDefinition="Indicates the resource representing the current activity or proposed activity that." ) - protected List implicated; - /** - * The actual objects that are the target of the reference (Indicates the resource representing the current activity or proposed activity that.) - */ - protected List implicatedTarget; - - - /** - * A textual explanation of the contraindication. - */ - @Child(name="detail", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Description and context", formalDefinition="A textual explanation of the contraindication." ) - protected StringType detail; - - /** - * The date or date-time when the contraindication was initially identified. - */ - @Child(name="date", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="When identified", formalDefinition="The date or date-time when the contraindication was initially identified." ) - protected DateTimeType date; - - /** - * Identifies the provider or software that identified the. - */ - @Child(name="author", type={Practitioner.class, Device.class}, order=5, min=0, max=1) - @Description(shortDefinition="Who found issue?", formalDefinition="Identifies the provider or software that identified the." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Identifies the provider or software that identified the.) - */ - protected Resource authorTarget; - - /** - * Business identifier associated with the contraindication record. - */ - @Child(name="identifier", type={Identifier.class}, order=6, min=0, max=1) - @Description(shortDefinition="Unique id for the contraindication", formalDefinition="Business identifier associated with the contraindication record." ) - protected Identifier identifier; - - /** - * The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. - */ - @Child(name="reference", type={UriType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Authority for issue", formalDefinition="The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified." ) - protected UriType reference; - - /** - * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. - */ - @Child(name="mitigation", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Step taken to address", formalDefinition="Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action." ) - protected List mitigation; - - private static final long serialVersionUID = 528603336L; - - public Contraindication() { - super(); - } - - /** - * @return {@link #patient} (Indicates the patient whose record the contraindication is associated with.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.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} (Indicates the patient whose record the contraindication is associated with.) - */ - public Contraindication 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. (Indicates the patient whose record the contraindication is associated with.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.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. (Indicates the patient whose record the contraindication is associated with.) - */ - public Contraindication setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #category} (Identifies the general type of issue identified.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.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} (Identifies the general type of issue identified.) - */ - public Contraindication setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public CodeType getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new CodeType(); - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Contraindication setSeverityElement(CodeType value) { - this.severity = value; - return this; - } - - /** - * @return Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - public String getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - public Contraindication setSeverity(String value) { - if (Utilities.noString(value)) - this.severity = null; - else { - if (this.severity == null) - this.severity = new CodeType(); - this.severity.setValue(value); - } - return this; - } - - /** - * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) - */ - public List getImplicated() { - if (this.implicated == null) - this.implicated = new ArrayList(); - return this.implicated; - } - - public boolean hasImplicated() { - if (this.implicated == null) - return false; - for (Reference item : this.implicated) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) - */ - // syntactic sugar - public Reference addImplicated() { //3 - Reference t = new Reference(); - if (this.implicated == null) - this.implicated = new ArrayList(); - this.implicated.add(t); - return t; - } - - /** - * @return {@link #implicated} (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. Indicates the resource representing the current activity or proposed activity that.) - */ - public List getImplicatedTarget() { - if (this.implicatedTarget == null) - this.implicatedTarget = new ArrayList(); - return this.implicatedTarget; - } - - /** - * @return {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public StringType getDetailElement() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new StringType(); - return this.detail; - } - - public boolean hasDetailElement() { - return this.detail != null && !this.detail.isEmpty(); - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public Contraindication setDetailElement(StringType value) { - this.detail = value; - return this; - } - - /** - * @return A textual explanation of the contraindication. - */ - public String getDetail() { - return this.detail == null ? null : this.detail.getValue(); - } - - /** - * @param value A textual explanation of the contraindication. - */ - public Contraindication setDetail(String value) { - if (Utilities.noString(value)) - this.detail = null; - else { - if (this.detail == null) - this.detail = new StringType(); - this.detail.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Contraindication setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date or date-time when the contraindication was initially identified. - */ - 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(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Identifies the provider or software that identified the.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Identifies the provider or software that identified the.) - */ - public Contraindication setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) - */ - public Contraindication setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Business identifier associated with the contraindication record.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Business identifier associated with the contraindication record.) - */ - public Contraindication setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contraindication.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public Contraindication setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. - */ - public Contraindication setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) - */ - public List getMitigation() { - if (this.mitigation == null) - this.mitigation = new ArrayList(); - return this.mitigation; - } - - public boolean hasMitigation() { - if (this.mitigation == null) - return false; - for (ContraindicationMitigationComponent item : this.mitigation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) - */ - // syntactic sugar - public ContraindicationMitigationComponent addMitigation() { //3 - ContraindicationMitigationComponent t = new ContraindicationMitigationComponent(); - if (this.mitigation == null) - this.mitigation = new ArrayList(); - this.mitigation.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient whose record the contraindication is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("category", "CodeableConcept", "Identifies the general type of issue identified.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("severity", "code", "Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("implicated", "Reference(Any)", "Indicates the resource representing the current activity or proposed activity that.", 0, java.lang.Integer.MAX_VALUE, implicated)); - childrenList.add(new Property("detail", "string", "A textual explanation of the contraindication.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("date", "dateTime", "The date or date-time when the contraindication was initially identified.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("author", "Reference(Practitioner|Device)", "Identifies the provider or software that identified the.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("identifier", "Identifier", "Business identifier associated with the contraindication record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("reference", "uri", "The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("mitigation", "", "Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.", 0, java.lang.Integer.MAX_VALUE, mitigation)); - } - - public Contraindication copy() { - Contraindication dst = new Contraindication(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.category = category == null ? null : category.copy(); - dst.severity = severity == null ? null : severity.copy(); - if (implicated != null) { - dst.implicated = new ArrayList(); - for (Reference i : implicated) - dst.implicated.add(i.copy()); - }; - dst.detail = detail == null ? null : detail.copy(); - dst.date = date == null ? null : date.copy(); - dst.author = author == null ? null : author.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.reference = reference == null ? null : reference.copy(); - if (mitigation != null) { - dst.mitigation = new ArrayList(); - for (ContraindicationMitigationComponent i : mitigation) - dst.mitigation.add(i.copy()); - }; - return dst; - } - - protected Contraindication typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (category == null || category.isEmpty()) - && (severity == null || severity.isEmpty()) && (implicated == null || implicated.isEmpty()) - && (detail == null || detail.isEmpty()) && (date == null || date.isEmpty()) && (author == null || author.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) - && (mitigation == null || mitigation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Contraindication; - } - - @SearchParamDefinition(name="category", path="Contraindication.category", description="E.g. Drug-drug, duplicate therapy, etc.", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="implicated", path="Contraindication.implicated", description="Problem resource", type="reference" ) - public static final String SP_IMPLICATED = "implicated"; - @SearchParamDefinition(name="patient", path="Contraindication.patient", description="Associated patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="date", path="Contraindication.date", description="When identified", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="Contraindication.identifier", description="Unique id for the contraindication", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + */ +@ResourceDef(name="Contraindication", profile="http://hl7.org/fhir/Profile/Contraindication") +public class Contraindication extends DomainResource { + + @Block() + public static class ContraindicationMitigationComponent extends BackboneElement { + /** + * Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication. + */ + @Child(name="action", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="What mitigation?", formalDefinition="Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication." ) + protected CodeableConcept action; + + /** + * Indicates when the mitigating action was documented. + */ + @Child(name="date", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Date committed", formalDefinition="Indicates when the mitigating action was documented." ) + protected DateTimeType date; + + /** + * Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. + */ + @Child(name="author", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is committing?", formalDefinition="Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + protected Practitioner authorTarget; + + private static final long serialVersionUID = -1994768436L; + + public ContraindicationMitigationComponent() { + super(); + } + + public ContraindicationMitigationComponent(CodeableConcept action) { + super(); + this.action = action; + } + + /** + * @return {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) + */ + public CodeableConcept getAction() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new CodeableConcept(); + return this.action; + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.) + */ + public ContraindicationMitigationComponent setAction(CodeableConcept value) { + this.action = value; + return this; + } + + /** + * @return {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ContraindicationMitigationComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Indicates when the mitigating action was documented. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Indicates when the mitigating action was documented. + */ + public ContraindicationMitigationComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public ContraindicationMitigationComponent setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContraindicationMitigationComponent.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) + */ + public ContraindicationMitigationComponent setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("action", "CodeableConcept", "Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("date", "dateTime", "Indicates when the mitigating action was documented.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("author", "Reference(Practitioner)", "Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.", 0, java.lang.Integer.MAX_VALUE, author)); + } + + public ContraindicationMitigationComponent copy() { + ContraindicationMitigationComponent dst = new ContraindicationMitigationComponent(); + copyValues(dst); + dst.action = action == null ? null : action.copy(); + dst.date = date == null ? null : date.copy(); + dst.author = author == null ? null : author.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (action == null || action.isEmpty()) && (date == null || date.isEmpty()) + && (author == null || author.isEmpty()); + } + + } + + /** + * Indicates the patient whose record the contraindication is associated with. + */ + @Child(name="patient", type={Patient.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Associated patient", formalDefinition="Indicates the patient whose record the contraindication is associated with." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Indicates the patient whose record the contraindication is associated with.) + */ + protected Patient patientTarget; + + /** + * Identifies the general type of issue identified. + */ + @Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="E.g. Drug-drug, duplicate therapy, etc.", formalDefinition="Identifies the general type of issue identified." ) + protected CodeableConcept category; + + /** + * Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + @Child(name="severity", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="high | medium | low", formalDefinition="Indicates the degree of importance associated with the identified issue based on the potential impact on the patient." ) + protected CodeType severity; + + /** + * Indicates the resource representing the current activity or proposed activity that. + */ + @Child(name="implicated", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Problem resource", formalDefinition="Indicates the resource representing the current activity or proposed activity that." ) + protected List implicated; + /** + * The actual objects that are the target of the reference (Indicates the resource representing the current activity or proposed activity that.) + */ + protected List implicatedTarget; + + + /** + * A textual explanation of the contraindication. + */ + @Child(name="detail", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Description and context", formalDefinition="A textual explanation of the contraindication." ) + protected StringType detail; + + /** + * The date or date-time when the contraindication was initially identified. + */ + @Child(name="date", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="When identified", formalDefinition="The date or date-time when the contraindication was initially identified." ) + protected DateTimeType date; + + /** + * Identifies the provider or software that identified the. + */ + @Child(name="author", type={Practitioner.class, Device.class}, order=5, min=0, max=1) + @Description(shortDefinition="Who found issue?", formalDefinition="Identifies the provider or software that identified the." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Identifies the provider or software that identified the.) + */ + protected Resource authorTarget; + + /** + * Business identifier associated with the contraindication record. + */ + @Child(name="identifier", type={Identifier.class}, order=6, min=0, max=1) + @Description(shortDefinition="Unique id for the contraindication", formalDefinition="Business identifier associated with the contraindication record." ) + protected Identifier identifier; + + /** + * The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + */ + @Child(name="reference", type={UriType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Authority for issue", formalDefinition="The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified." ) + protected UriType reference; + + /** + * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. + */ + @Child(name="mitigation", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Step taken to address", formalDefinition="Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action." ) + protected List mitigation; + + private static final long serialVersionUID = 528603336L; + + public Contraindication() { + super(); + } + + /** + * @return {@link #patient} (Indicates the patient whose record the contraindication is associated with.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.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} (Indicates the patient whose record the contraindication is associated with.) + */ + public Contraindication 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. (Indicates the patient whose record the contraindication is associated with.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.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. (Indicates the patient whose record the contraindication is associated with.) + */ + public Contraindication setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #category} (Identifies the general type of issue identified.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.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} (Identifies the general type of issue identified.) + */ + public Contraindication setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public CodeType getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new CodeType(); + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Contraindication setSeverityElement(CodeType value) { + this.severity = value; + return this; + } + + /** + * @return Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + public String getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + */ + public Contraindication setSeverity(String value) { + if (Utilities.noString(value)) + this.severity = null; + else { + if (this.severity == null) + this.severity = new CodeType(); + this.severity.setValue(value); + } + return this; + } + + /** + * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) + */ + public List getImplicated() { + if (this.implicated == null) + this.implicated = new ArrayList(); + return this.implicated; + } + + public boolean hasImplicated() { + if (this.implicated == null) + return false; + for (Reference item : this.implicated) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that.) + */ + // syntactic sugar + public Reference addImplicated() { //3 + Reference t = new Reference(); + if (this.implicated == null) + this.implicated = new ArrayList(); + this.implicated.add(t); + return t; + } + + /** + * @return {@link #implicated} (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. Indicates the resource representing the current activity or proposed activity that.) + */ + public List getImplicatedTarget() { + if (this.implicatedTarget == null) + this.implicatedTarget = new ArrayList(); + return this.implicatedTarget; + } + + /** + * @return {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public StringType getDetailElement() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new StringType(); + return this.detail; + } + + public boolean hasDetailElement() { + return this.detail != null && !this.detail.isEmpty(); + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (A textual explanation of the contraindication.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value + */ + public Contraindication setDetailElement(StringType value) { + this.detail = value; + return this; + } + + /** + * @return A textual explanation of the contraindication. + */ + public String getDetail() { + return this.detail == null ? null : this.detail.getValue(); + } + + /** + * @param value A textual explanation of the contraindication. + */ + public Contraindication setDetail(String value) { + if (Utilities.noString(value)) + this.detail = null; + else { + if (this.detail == null) + this.detail = new StringType(); + this.detail.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date or date-time when the contraindication was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Contraindication setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date or date-time when the contraindication was initially identified. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Identifies the provider or software that identified the.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Identifies the provider or software that identified the.) + */ + public Contraindication setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the provider or software that identified the.) + */ + public Contraindication setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Business identifier associated with the contraindication record.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Business identifier associated with the contraindication record.) + */ + public Contraindication setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contraindication.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public Contraindication setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + */ + public Contraindication setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) + */ + public List getMitigation() { + if (this.mitigation == null) + this.mitigation = new ArrayList(); + return this.mitigation; + } + + public boolean hasMitigation() { + if (this.mitigation == null) + return false; + for (ContraindicationMitigationComponent item : this.mitigation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) + */ + // syntactic sugar + public ContraindicationMitigationComponent addMitigation() { //3 + ContraindicationMitigationComponent t = new ContraindicationMitigationComponent(); + if (this.mitigation == null) + this.mitigation = new ArrayList(); + this.mitigation.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient whose record the contraindication is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("category", "CodeableConcept", "Identifies the general type of issue identified.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("severity", "code", "Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("implicated", "Reference(Any)", "Indicates the resource representing the current activity or proposed activity that.", 0, java.lang.Integer.MAX_VALUE, implicated)); + childrenList.add(new Property("detail", "string", "A textual explanation of the contraindication.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("date", "dateTime", "The date or date-time when the contraindication was initially identified.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("author", "Reference(Practitioner|Device)", "Identifies the provider or software that identified the.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("identifier", "Identifier", "Business identifier associated with the contraindication record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("reference", "uri", "The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("mitigation", "", "Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.", 0, java.lang.Integer.MAX_VALUE, mitigation)); + } + + public Contraindication copy() { + Contraindication dst = new Contraindication(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.category = category == null ? null : category.copy(); + dst.severity = severity == null ? null : severity.copy(); + if (implicated != null) { + dst.implicated = new ArrayList(); + for (Reference i : implicated) + dst.implicated.add(i.copy()); + }; + dst.detail = detail == null ? null : detail.copy(); + dst.date = date == null ? null : date.copy(); + dst.author = author == null ? null : author.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.reference = reference == null ? null : reference.copy(); + if (mitigation != null) { + dst.mitigation = new ArrayList(); + for (ContraindicationMitigationComponent i : mitigation) + dst.mitigation.add(i.copy()); + }; + return dst; + } + + protected Contraindication typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (category == null || category.isEmpty()) + && (severity == null || severity.isEmpty()) && (implicated == null || implicated.isEmpty()) + && (detail == null || detail.isEmpty()) && (date == null || date.isEmpty()) && (author == null || author.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) + && (mitigation == null || mitigation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Contraindication; + } + + @SearchParamDefinition(name="category", path="Contraindication.category", description="E.g. Drug-drug, duplicate therapy, etc.", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="implicated", path="Contraindication.implicated", description="Problem resource", type="reference" ) + public static final String SP_IMPLICATED = "implicated"; + @SearchParamDefinition(name="patient", path="Contraindication.patient", description="Associated patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="date", path="Contraindication.date", description="When identified", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Contraindication.identifier", description="Unique id for the contraindication", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java index b057042ea5d..47dee075d74 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java @@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Count") -public class Count extends Quantity { - - private static final long serialVersionUID = -483422721L; - - public Count copy() { - Count dst = new Count(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.units = units == null ? null : units.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Count typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - + +/* + 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Count") +public class Count extends Quantity { + + private static final long serialVersionUID = -483422721L; + + public Count copy() { + Count dst = new Count(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.units = units == null ? null : units.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Count typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java index 24deec6055b..f2eb27e85b8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java @@ -20,718 +20,718 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Financial instrument which may be used to pay for or reimburse for health care products and services. - */ -@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/Profile/Coverage") -public class Coverage extends DomainResource { - - /** - * The program or plan underwriter or payor. - */ - @Child(name="issuer", type={Organization.class}, order=-1, min=0, max=1) - @Description(shortDefinition="An identifier for the plan issuer", formalDefinition="The program or plan underwriter or payor." ) - protected Reference issuer; - - /** - * The actual object that is the target of the reference (The program or plan underwriter or payor.) - */ - protected Organization issuerTarget; - - /** - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - */ - @Child(name="period", type={Period.class}, order=0, min=0, max=1) - @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) - protected Period period; - - /** - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) - protected Coding type; - - /** - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - */ - @Child(name="identifier", type={Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID." ) - protected List identifier; - - /** - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - @Child(name="group", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="An identifier for the group", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) - protected StringType group; - - /** - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - @Child(name="plan", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="An identifier for the plan", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) - protected StringType plan; - - /** - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - */ - @Child(name="subplan", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="An identifier for the subsection of the plan", formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." ) - protected StringType subplan; - - /** - * A unique identifier for a dependent under the coverage. - */ - @Child(name="dependent", type={IntegerType.class}, order=6, min=0, max=1) - @Description(shortDefinition="The dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) - protected IntegerType dependent; - - /** - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - @Child(name="sequence", type={IntegerType.class}, order=7, min=0, max=1) - @Description(shortDefinition="The plan instance or sequence counter", formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." ) - protected IntegerType sequence; - - /** - * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. - */ - @Child(name="subscriber", type={Patient.class}, order=8, min=0, max=1) - @Description(shortDefinition="Planholder information", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) - protected Reference subscriber; - - /** - * The actual object that is the target of the reference (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - protected Patient subscriberTarget; - - /** - * The identifier for a community of providers. - */ - @Child(name="network", type={Identifier.class}, order=9, min=0, max=1) - @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) - protected Identifier network; - - /** - * The policy(s) which constitute this insurance coverage. - */ - @Child(name="contract", type={Contract.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) - protected List contract; - /** - * The actual objects that are the target of the reference (The policy(s) which constitute this insurance coverage.) - */ - protected List contractTarget; - - - private static final long serialVersionUID = 1420850573L; - - public Coverage() { - super(); - } - - /** - * @return {@link #issuer} (The program or plan underwriter or payor.) - */ - public Reference getIssuer() { - if (this.issuer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.issuer"); - else if (Configuration.doAutoCreate()) - this.issuer = new Reference(); - return this.issuer; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (The program or plan underwriter or payor.) - */ - public Coverage setIssuer(Reference value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #issuer} 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 program or plan underwriter or payor.) - */ - public Organization getIssuerTarget() { - if (this.issuerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.issuer"); - else if (Configuration.doAutoCreate()) - this.issuerTarget = new Organization(); - return this.issuerTarget; - } - - /** - * @param value {@link #issuer} 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 program or plan underwriter or payor.) - */ - public Coverage setIssuerTarget(Organization value) { - this.issuerTarget = value; - return this; - } - - /** - * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.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} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) - */ - public Coverage setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coverage setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value - */ - public StringType getGroupElement() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.group"); - else if (Configuration.doAutoCreate()) - this.group = new StringType(); - return this.group; - } - - public boolean hasGroupElement() { - return this.group != null && !this.group.isEmpty(); - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value - */ - public Coverage setGroupElement(StringType value) { - this.group = value; - return this; - } - - /** - * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public String getGroup() { - return this.group == null ? null : this.group.getValue(); - } - - /** - * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public Coverage setGroup(String value) { - if (Utilities.noString(value)) - this.group = null; - else { - if (this.group == null) - this.group = new StringType(); - this.group.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value - */ - public StringType getPlanElement() { - if (this.plan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.plan"); - else if (Configuration.doAutoCreate()) - this.plan = new StringType(); - return this.plan; - } - - public boolean hasPlanElement() { - return this.plan != null && !this.plan.isEmpty(); - } - - public boolean hasPlan() { - return this.plan != null && !this.plan.isEmpty(); - } - - /** - * @param value {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value - */ - public Coverage setPlanElement(StringType value) { - this.plan = value; - return this; - } - - /** - * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public String getPlan() { - return this.plan == null ? null : this.plan.getValue(); - } - - /** - * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - */ - public Coverage setPlan(String value) { - if (Utilities.noString(value)) - this.plan = null; - else { - if (this.plan == null) - this.plan = new StringType(); - this.plan.setValue(value); - } - return this; - } - - /** - * @return {@link #subplan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubplan" gives direct access to the value - */ - public StringType getSubplanElement() { - if (this.subplan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subplan"); - else if (Configuration.doAutoCreate()) - this.subplan = new StringType(); - return this.subplan; - } - - public boolean hasSubplanElement() { - return this.subplan != null && !this.subplan.isEmpty(); - } - - public boolean hasSubplan() { - return this.subplan != null && !this.subplan.isEmpty(); - } - - /** - * @param value {@link #subplan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubplan" gives direct access to the value - */ - public Coverage setSubplanElement(StringType value) { - this.subplan = value; - return this; - } - - /** - * @return Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - */ - public String getSubplan() { - return this.subplan == null ? null : this.subplan.getValue(); - } - - /** - * @param value Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - */ - public Coverage setSubplan(String value) { - if (Utilities.noString(value)) - this.subplan = null; - else { - if (this.subplan == null) - this.subplan = new StringType(); - this.subplan.setValue(value); - } - return this; - } - - /** - * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value - */ - public IntegerType getDependentElement() { - if (this.dependent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.dependent"); - else if (Configuration.doAutoCreate()) - this.dependent = new IntegerType(); - return this.dependent; - } - - public boolean hasDependentElement() { - return this.dependent != null && !this.dependent.isEmpty(); - } - - public boolean hasDependent() { - return this.dependent != null && !this.dependent.isEmpty(); - } - - /** - * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value - */ - public Coverage setDependentElement(IntegerType value) { - this.dependent = value; - return this; - } - - /** - * @return A unique identifier for a dependent under the coverage. - */ - public int getDependent() { - return this.dependent == null ? null : this.dependent.getValue(); - } - - /** - * @param value A unique identifier for a dependent under the coverage. - */ - public Coverage setDependent(int value) { - if (value == -1) - this.dependent = null; - else { - if (this.dependent == null) - this.dependent = new IntegerType(); - this.dependent.setValue(value); - } - return this; - } - - /** - * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public Coverage setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - public Coverage setSequence(int value) { - if (value == -1) - this.sequence = null; - else { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - } - return this; - } - - /** - * @return {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Reference getSubscriber() { - if (this.subscriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subscriber"); - else if (Configuration.doAutoCreate()) - this.subscriber = new Reference(); - return this.subscriber; - } - - public boolean hasSubscriber() { - return this.subscriber != null && !this.subscriber.isEmpty(); - } - - /** - * @param value {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setSubscriber(Reference value) { - this.subscriber = value; - return this; - } - - /** - * @return {@link #subscriber} 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Patient getSubscriberTarget() { - if (this.subscriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subscriber"); - else if (Configuration.doAutoCreate()) - this.subscriberTarget = new Patient(); - return this.subscriberTarget; - } - - /** - * @param value {@link #subscriber} 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setSubscriberTarget(Patient value) { - this.subscriberTarget = value; - return this; - } - - /** - * @return {@link #network} (The identifier for a community of providers.) - */ - public Identifier getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.network"); - else if (Configuration.doAutoCreate()) - this.network = new Identifier(); - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (The identifier for a community of providers.) - */ - public Coverage setNetwork(Identifier value) { - this.network = value; - return this; - } - - /** - * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) - */ - public List getContract() { - if (this.contract == null) - this.contract = new ArrayList(); - return this.contract; - } - - public boolean hasContract() { - if (this.contract == null) - return false; - for (Reference item : this.contract) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) - */ - // syntactic sugar - public Reference addContract() { //3 - Reference t = new Reference(); - if (this.contract == null) - this.contract = new ArrayList(); - this.contract.add(t); - return t; - } - - /** - * @return {@link #contract} (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 policy(s) which constitute this insurance coverage.) - */ - public List getContractTarget() { - if (this.contractTarget == null) - this.contractTarget = new ArrayList(); - return this.contractTarget; - } - - // syntactic sugar - /** - * @return {@link #contract} (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 policy(s) which constitute this insurance coverage.) - */ - public Contract addContractTarget() { - Contract r = new Contract(); - if (this.contractTarget == null) - this.contractTarget = new ArrayList(); - this.contractTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("issuer", "Reference(Organization)", "The program or plan underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, issuer)); - childrenList.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("group", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("plan", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, plan)); - childrenList.add(new Property("subplan", "string", "Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.", 0, java.lang.Integer.MAX_VALUE, subplan)); - childrenList.add(new Property("dependent", "integer", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); - childrenList.add(new Property("sequence", "integer", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("subscriber", "Reference(Patient)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, subscriber)); - childrenList.add(new Property("network", "Identifier", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); - } - - public Coverage copy() { - Coverage dst = new Coverage(); - copyValues(dst); - dst.issuer = issuer == null ? null : issuer.copy(); - dst.period = period == null ? null : period.copy(); - dst.type = type == null ? null : type.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.group = group == null ? null : group.copy(); - dst.plan = plan == null ? null : plan.copy(); - dst.subplan = subplan == null ? null : subplan.copy(); - dst.dependent = dependent == null ? null : dependent.copy(); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.subscriber = subscriber == null ? null : subscriber.copy(); - dst.network = network == null ? null : network.copy(); - if (contract != null) { - dst.contract = new ArrayList(); - for (Reference i : contract) - dst.contract.add(i.copy()); - }; - return dst; - } - - protected Coverage typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (issuer == null || issuer.isEmpty()) && (period == null || period.isEmpty()) - && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) - && (plan == null || plan.isEmpty()) && (subplan == null || subplan.isEmpty()) && (dependent == null || dependent.isEmpty()) - && (sequence == null || sequence.isEmpty()) && (subscriber == null || subscriber.isEmpty()) - && (network == null || network.isEmpty()) && (contract == null || contract.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Coverage; - } - - @SearchParamDefinition(name="plan", path="Coverage.plan", description="A plan or policy identifier", type="token" ) - public static final String SP_PLAN = "plan"; - @SearchParamDefinition(name="issuer", path="Coverage.issuer", description="The identity of the insurer", type="reference" ) - public static final String SP_ISSUER = "issuer"; - @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="token" ) - public static final String SP_SEQUENCE = "sequence"; - @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="token" ) - public static final String SP_DEPENDENT = "dependent"; - @SearchParamDefinition(name="group", path="Coverage.group", description="Group identifier", type="token" ) - public static final String SP_GROUP = "group"; - @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="subplan", path="Coverage.subplan", description="Sub-plan identifier", type="token" ) - public static final String SP_SUBPLAN = "subplan"; - -} - + +/* + 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; +/** + * Financial instrument which may be used to pay for or reimburse for health care products and services. + */ +@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/Profile/Coverage") +public class Coverage extends DomainResource { + + /** + * The program or plan underwriter or payor. + */ + @Child(name="issuer", type={Organization.class}, order=-1, min=0, max=1) + @Description(shortDefinition="An identifier for the plan issuer", formalDefinition="The program or plan underwriter or payor." ) + protected Reference issuer; + + /** + * The actual object that is the target of the reference (The program or plan underwriter or payor.) + */ + protected Organization issuerTarget; + + /** + * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. + */ + @Child(name="period", type={Period.class}, order=0, min=0, max=1) + @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." ) + protected Period period; + + /** + * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) + protected Coding type; + + /** + * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. + */ + @Child(name="identifier", type={Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID." ) + protected List identifier; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name="group", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="An identifier for the group", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) + protected StringType group; + + /** + * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + @Child(name="plan", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="An identifier for the plan", formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." ) + protected StringType plan; + + /** + * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + @Child(name="subplan", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="An identifier for the subsection of the plan", formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." ) + protected StringType subplan; + + /** + * A unique identifier for a dependent under the coverage. + */ + @Child(name="dependent", type={IntegerType.class}, order=6, min=0, max=1) + @Description(shortDefinition="The dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) + protected IntegerType dependent; + + /** + * An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + @Child(name="sequence", type={IntegerType.class}, order=7, min=0, max=1) + @Description(shortDefinition="The plan instance or sequence counter", formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." ) + protected IntegerType sequence; + + /** + * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. + */ + @Child(name="subscriber", type={Patient.class}, order=8, min=0, max=1) + @Description(shortDefinition="Planholder information", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) + protected Reference subscriber; + + /** + * The actual object that is the target of the reference (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + protected Patient subscriberTarget; + + /** + * The identifier for a community of providers. + */ + @Child(name="network", type={Identifier.class}, order=9, min=0, max=1) + @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) + protected Identifier network; + + /** + * The policy(s) which constitute this insurance coverage. + */ + @Child(name="contract", type={Contract.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) + protected List contract; + /** + * The actual objects that are the target of the reference (The policy(s) which constitute this insurance coverage.) + */ + protected List contractTarget; + + + private static final long serialVersionUID = 1420850573L; + + public Coverage() { + super(); + } + + /** + * @return {@link #issuer} (The program or plan underwriter or payor.) + */ + public Reference getIssuer() { + if (this.issuer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.issuer"); + else if (Configuration.doAutoCreate()) + this.issuer = new Reference(); + return this.issuer; + } + + public boolean hasIssuer() { + return this.issuer != null && !this.issuer.isEmpty(); + } + + /** + * @param value {@link #issuer} (The program or plan underwriter or payor.) + */ + public Coverage setIssuer(Reference value) { + this.issuer = value; + return this; + } + + /** + * @return {@link #issuer} 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 program or plan underwriter or payor.) + */ + public Organization getIssuerTarget() { + if (this.issuerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.issuer"); + else if (Configuration.doAutoCreate()) + this.issuerTarget = new Organization(); + return this.issuerTarget; + } + + /** + * @param value {@link #issuer} 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 program or plan underwriter or payor.) + */ + public Coverage setIssuerTarget(Organization value) { + this.issuerTarget = value; + return this; + } + + /** + * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.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} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.) + */ + public Coverage setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) + */ + public Coverage setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public StringType getGroupElement() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.group"); + else if (Configuration.doAutoCreate()) + this.group = new StringType(); + return this.group; + } + + public boolean hasGroupElement() { + return this.group != null && !this.group.isEmpty(); + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value + */ + public Coverage setGroupElement(StringType value) { + this.group = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public String getGroup() { + return this.group == null ? null : this.group.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public Coverage setGroup(String value) { + if (Utilities.noString(value)) + this.group = null; + else { + if (this.group == null) + this.group = new StringType(); + this.group.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public StringType getPlanElement() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new StringType(); + return this.plan; + } + + public boolean hasPlanElement() { + return this.plan != null && !this.plan.isEmpty(); + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value + */ + public Coverage setPlanElement(StringType value) { + this.plan = value; + return this; + } + + /** + * @return Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public String getPlan() { + return this.plan == null ? null : this.plan.getValue(); + } + + /** + * @param value Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + */ + public Coverage setPlan(String value) { + if (Utilities.noString(value)) + this.plan = null; + else { + if (this.plan == null) + this.plan = new StringType(); + this.plan.setValue(value); + } + return this; + } + + /** + * @return {@link #subplan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubplan" gives direct access to the value + */ + public StringType getSubplanElement() { + if (this.subplan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subplan"); + else if (Configuration.doAutoCreate()) + this.subplan = new StringType(); + return this.subplan; + } + + public boolean hasSubplanElement() { + return this.subplan != null && !this.subplan.isEmpty(); + } + + public boolean hasSubplan() { + return this.subplan != null && !this.subplan.isEmpty(); + } + + /** + * @param value {@link #subplan} (Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.). This is the underlying object with id, value and extensions. The accessor "getSubplan" gives direct access to the value + */ + public Coverage setSubplanElement(StringType value) { + this.subplan = value; + return this; + } + + /** + * @return Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + public String getSubplan() { + return this.subplan == null ? null : this.subplan.getValue(); + } + + /** + * @param value Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + */ + public Coverage setSubplan(String value) { + if (Utilities.noString(value)) + this.subplan = null; + else { + if (this.subplan == null) + this.subplan = new StringType(); + this.subplan.setValue(value); + } + return this; + } + + /** + * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value + */ + public IntegerType getDependentElement() { + if (this.dependent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.dependent"); + else if (Configuration.doAutoCreate()) + this.dependent = new IntegerType(); + return this.dependent; + } + + public boolean hasDependentElement() { + return this.dependent != null && !this.dependent.isEmpty(); + } + + public boolean hasDependent() { + return this.dependent != null && !this.dependent.isEmpty(); + } + + /** + * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value + */ + public Coverage setDependentElement(IntegerType value) { + this.dependent = value; + return this; + } + + /** + * @return A unique identifier for a dependent under the coverage. + */ + public int getDependent() { + return this.dependent == null ? null : this.dependent.getValue(); + } + + /** + * @param value A unique identifier for a dependent under the coverage. + */ + public Coverage setDependent(int value) { + if (value == -1) + this.dependent = null; + else { + if (this.dependent == null) + this.dependent = new IntegerType(); + this.dependent.setValue(value); + } + return this; + } + + /** + * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public Coverage setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. + */ + public Coverage setSequence(int value) { + if (value == -1) + this.sequence = null; + else { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + } + return this; + } + + /** + * @return {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Reference getSubscriber() { + if (this.subscriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriber"); + else if (Configuration.doAutoCreate()) + this.subscriber = new Reference(); + return this.subscriber; + } + + public boolean hasSubscriber() { + return this.subscriber != null && !this.subscriber.isEmpty(); + } + + /** + * @param value {@link #subscriber} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Coverage setSubscriber(Reference value) { + this.subscriber = value; + return this; + } + + /** + * @return {@link #subscriber} 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Patient getSubscriberTarget() { + if (this.subscriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.subscriber"); + else if (Configuration.doAutoCreate()) + this.subscriberTarget = new Patient(); + return this.subscriberTarget; + } + + /** + * @param value {@link #subscriber} 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 party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) + */ + public Coverage setSubscriberTarget(Patient value) { + this.subscriberTarget = value; + return this; + } + + /** + * @return {@link #network} (The identifier for a community of providers.) + */ + public Identifier getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Coverage.network"); + else if (Configuration.doAutoCreate()) + this.network = new Identifier(); + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (The identifier for a community of providers.) + */ + public Coverage setNetwork(Identifier value) { + this.network = value; + return this; + } + + /** + * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) + */ + public List getContract() { + if (this.contract == null) + this.contract = new ArrayList(); + return this.contract; + } + + public boolean hasContract() { + if (this.contract == null) + return false; + for (Reference item : this.contract) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) + */ + // syntactic sugar + public Reference addContract() { //3 + Reference t = new Reference(); + if (this.contract == null) + this.contract = new ArrayList(); + this.contract.add(t); + return t; + } + + /** + * @return {@link #contract} (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 policy(s) which constitute this insurance coverage.) + */ + public List getContractTarget() { + if (this.contractTarget == null) + this.contractTarget = new ArrayList(); + return this.contractTarget; + } + + // syntactic sugar + /** + * @return {@link #contract} (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 policy(s) which constitute this insurance coverage.) + */ + public Contract addContractTarget() { + Contract r = new Contract(); + if (this.contractTarget == null) + this.contractTarget = new ArrayList(); + this.contractTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("issuer", "Reference(Organization)", "The program or plan underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, issuer)); + childrenList.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("group", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("plan", "string", "Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("subplan", "string", "Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID.", 0, java.lang.Integer.MAX_VALUE, subplan)); + childrenList.add(new Property("dependent", "integer", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); + childrenList.add(new Property("sequence", "integer", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("subscriber", "Reference(Patient)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, subscriber)); + childrenList.add(new Property("network", "Identifier", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); + childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); + } + + public Coverage copy() { + Coverage dst = new Coverage(); + copyValues(dst); + dst.issuer = issuer == null ? null : issuer.copy(); + dst.period = period == null ? null : period.copy(); + dst.type = type == null ? null : type.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.group = group == null ? null : group.copy(); + dst.plan = plan == null ? null : plan.copy(); + dst.subplan = subplan == null ? null : subplan.copy(); + dst.dependent = dependent == null ? null : dependent.copy(); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.subscriber = subscriber == null ? null : subscriber.copy(); + dst.network = network == null ? null : network.copy(); + if (contract != null) { + dst.contract = new ArrayList(); + for (Reference i : contract) + dst.contract.add(i.copy()); + }; + return dst; + } + + protected Coverage typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (issuer == null || issuer.isEmpty()) && (period == null || period.isEmpty()) + && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) + && (plan == null || plan.isEmpty()) && (subplan == null || subplan.isEmpty()) && (dependent == null || dependent.isEmpty()) + && (sequence == null || sequence.isEmpty()) && (subscriber == null || subscriber.isEmpty()) + && (network == null || network.isEmpty()) && (contract == null || contract.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Coverage; + } + + @SearchParamDefinition(name="plan", path="Coverage.plan", description="A plan or policy identifier", type="token" ) + public static final String SP_PLAN = "plan"; + @SearchParamDefinition(name="issuer", path="Coverage.issuer", description="The identity of the insurer", type="reference" ) + public static final String SP_ISSUER = "issuer"; + @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="token" ) + public static final String SP_SEQUENCE = "sequence"; + @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="token" ) + public static final String SP_DEPENDENT = "dependent"; + @SearchParamDefinition(name="group", path="Coverage.group", description="Group identifier", type="token" ) + public static final String SP_GROUP = "group"; + @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="subplan", path="Coverage.subplan", description="Sub-plan identifier", type="token" ) + public static final String SP_SUBPLAN = "subplan"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java index 4e3d47cf580..64c839dc807 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java @@ -20,1867 +20,1867 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * The formal description of a single piece of information that can be gathered and reported. - */ -@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") -public class DataElement extends DomainResource { - - public enum ResourceObservationDefStatus implements FhirEnum { - /** - * This data element is still under development. - */ - DRAFT, - /** - * This data element is ready for normal use. - */ - ACTIVE, - /** - * This data element has been deprecated, withdrawn or superseded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This data element is still under development."; - case ACTIVE: return "This data element is ready for normal use."; - case RETIRED: return "This data element has been deprecated, withdrawn or superseded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class ResourceObservationDefStatusEnumFactory implements EnumFactory { - public ResourceObservationDefStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ResourceObservationDefStatus.DRAFT; - if ("active".equals(codeString)) - return ResourceObservationDefStatus.ACTIVE; - if ("retired".equals(codeString)) - return ResourceObservationDefStatus.RETIRED; - throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'"); - } - public String toCode(ResourceObservationDefStatus code) throws IllegalArgumentException { - if (code == ResourceObservationDefStatus.DRAFT) - return "draft"; - if (code == ResourceObservationDefStatus.ACTIVE) - return "active"; - if (code == ResourceObservationDefStatus.RETIRED) - return "retired"; - return "?"; - } - } - - 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. - */ - REQUIRED, - /** - * For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant. - */ - PREFERRED, - /** - * The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs. - */ - EXAMPLE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REQUIRED; - if ("preferred".equals(codeString)) - return PREFERRED; - if ("example".equals(codeString)) - return EXAMPLE; - throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case PREFERRED: return "preferred"; - case EXAMPLE: return "example"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return ""; - case PREFERRED: return ""; - case EXAMPLE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "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."; - case PREFERRED: return "For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant."; - case EXAMPLE: return "The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "required"; - case PREFERRED: return "preferred"; - case EXAMPLE: return "example"; - default: return "?"; - } - } - } - - public static class BindingConformanceEnumFactory implements EnumFactory { - public BindingConformance fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return BindingConformance.REQUIRED; - if ("preferred".equals(codeString)) - return BindingConformance.PREFERRED; - if ("example".equals(codeString)) - return BindingConformance.EXAMPLE; - throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); - } - public String toCode(BindingConformance code) throws IllegalArgumentException { - if (code == BindingConformance.REQUIRED) - return "required"; - if (code == BindingConformance.PREFERRED) - return "preferred"; - if (code == BindingConformance.EXAMPLE) - return "example"; - return "?"; - } - } - - @Block() - public static class DataElementBindingComponent extends BackboneElement { - /** - * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. - */ - @Child(name="isExtensible", type={BooleanType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Can additional codes be used?", formalDefinition="If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone." ) - protected BooleanType isExtensible; - - /** - * Indicates the degree of conformance expectations associated with this binding. - */ - @Child(name="conformance", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="required | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding." ) - protected Enumeration conformance; - - /** - * Describes the intended use of this particular set of codes. - */ - @Child(name="description", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) - protected StringType description; - - /** - * Points to the value set that identifies the set of codes to be used. - */ - @Child(name="valueSet", type={ValueSet.class}, order=4, min=0, max=1) - @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set that identifies the set of codes to be used." ) - protected Reference valueSet; - - /** - * The actual object that is the target of the reference (Points to the value set that identifies the set of codes to be used.) - */ - protected ValueSet valueSetTarget; - - private static final long serialVersionUID = -1297440999L; - - public DataElementBindingComponent() { - super(); - } - - public DataElementBindingComponent(BooleanType isExtensible) { - super(); - this.isExtensible = isExtensible; - } - - /** - * @return {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value - */ - public BooleanType getIsExtensibleElement() { - if (this.isExtensible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementBindingComponent.isExtensible"); - else if (Configuration.doAutoCreate()) - this.isExtensible = new BooleanType(); - return this.isExtensible; - } - - public boolean hasIsExtensibleElement() { - return this.isExtensible != null && !this.isExtensible.isEmpty(); - } - - public boolean hasIsExtensible() { - return this.isExtensible != null && !this.isExtensible.isEmpty(); - } - - /** - * @param value {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value - */ - public DataElementBindingComponent setIsExtensibleElement(BooleanType value) { - this.isExtensible = value; - return this; - } - - /** - * @return If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. - */ - public boolean getIsExtensible() { - return this.isExtensible == null ? false : this.isExtensible.getValue(); - } - - /** - * @param value If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. - */ - public DataElementBindingComponent setIsExtensible(boolean value) { - if (this.isExtensible == null) - this.isExtensible = new BooleanType(); - this.isExtensible.setValue(value); - return this; - } - - /** - * @return {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value - */ - public Enumeration getConformanceElement() { - if (this.conformance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementBindingComponent.conformance"); - else if (Configuration.doAutoCreate()) - this.conformance = new Enumeration(); - return this.conformance; - } - - public boolean hasConformanceElement() { - return this.conformance != null && !this.conformance.isEmpty(); - } - - public boolean hasConformance() { - return this.conformance != null && !this.conformance.isEmpty(); - } - - /** - * @param value {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value - */ - public DataElementBindingComponent setConformanceElement(Enumeration value) { - this.conformance = value; - return this; - } - - /** - * @return Indicates the degree of conformance expectations associated with this binding. - */ - public BindingConformance getConformance() { - return this.conformance == null ? null : this.conformance.getValue(); - } - - /** - * @param value Indicates the degree of conformance expectations associated with this binding. - */ - public DataElementBindingComponent setConformance(BindingConformance value) { - if (value == null) - this.conformance = null; - else { - if (this.conformance == null) - this.conformance = new Enumeration(BindingConformance.ENUM_FACTORY); - this.conformance.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Describes the intended use of this particular set of codes.). 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 DataElementBindingComponent.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} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DataElementBindingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Describes the intended use of this particular set of codes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Describes the intended use of this particular set of codes. - */ - public DataElementBindingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #valueSet} (Points to the value set that identifies the set of codes to be used.) - */ - public Reference getValueSet() { - if (this.valueSet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementBindingComponent.valueSet"); - else if (Configuration.doAutoCreate()) - this.valueSet = new Reference(); - return this.valueSet; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (Points to the value set that identifies the set of codes to be used.) - */ - public DataElementBindingComponent setValueSet(Reference value) { - this.valueSet = value; - return this; - } - - /** - * @return {@link #valueSet} 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. (Points to the value set that identifies the set of codes to be used.) - */ - public ValueSet getValueSetTarget() { - if (this.valueSetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementBindingComponent.valueSet"); - else if (Configuration.doAutoCreate()) - this.valueSetTarget = new ValueSet(); - return this.valueSetTarget; - } - - /** - * @param value {@link #valueSet} 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. (Points to the value set that identifies the set of codes to be used.) - */ - public DataElementBindingComponent setValueSetTarget(ValueSet value) { - this.valueSetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("isExtensible", "boolean", "If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.", 0, java.lang.Integer.MAX_VALUE, isExtensible)); - childrenList.add(new Property("conformance", "code", "Indicates the degree of conformance expectations associated with this binding.", 0, java.lang.Integer.MAX_VALUE, conformance)); - childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("valueSet", "Reference(ValueSet)", "Points to the value set that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - } - - public DataElementBindingComponent copy() { - DataElementBindingComponent dst = new DataElementBindingComponent(); - copyValues(dst); - dst.isExtensible = isExtensible == null ? null : isExtensible.copy(); - dst.conformance = conformance == null ? null : conformance.copy(); - dst.description = description == null ? null : description.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (isExtensible == null || isExtensible.isEmpty()) && (conformance == null || conformance.isEmpty()) - && (description == null || description.isEmpty()) && (valueSet == null || valueSet.isEmpty()) - ; - } - - } - - @Block() - public static class DataElementMappingComponent extends BackboneElement { - /** - * A URI that identifies the specification that this mapping is expressed to. - */ - @Child(name="uri", type={UriType.class}, order=1, min=0, max=1) - @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=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=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=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 = 797049346L; - - public DataElementMappingComponent() { - super(); - } - - public DataElementMappingComponent(StringType map) { - super(); - this.map = map; - } - - /** - * @return {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public DataElementMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return A URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value A URI that identifies the specification that this mapping is expressed to. - */ - public DataElementMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.setValue(value); - } - 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 - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (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 - */ - public DataElementMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public DataElementMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public DataElementMappingComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public DataElementMappingComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public StringType getMapElement() { - if (this.map == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.map"); - else if (Configuration.doAutoCreate()) - this.map = new StringType(); - return this.map; - } - - public boolean hasMapElement() { - return this.map != null && !this.map.isEmpty(); - } - - public boolean hasMap() { - return this.map != null && !this.map.isEmpty(); - } - - /** - * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public DataElementMappingComponent setMapElement(StringType value) { - this.map = value; - return this; - } - - /** - * @return Expresses what part of the target specification corresponds to this element. - */ - public String getMap() { - return this.map == null ? null : this.map.getValue(); - } - - /** - * @param value Expresses what part of the target specification corresponds to this element. - */ - public DataElementMappingComponent setMap(String value) { - if (this.map == null) - this.map = new StringType(); - this.map.setValue(value); - return this; - } - - protected void listChildren(List 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)); - } - - public DataElementMappingComponent copy() { - 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(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (uri == null || uri.isEmpty()) && (definitional == null || definitional.isEmpty()) - && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()) && (map == null || map.isEmpty()) - ; - } - - } - - /** - * The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Logical id to reference this data element", formalDefinition="The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance." ) - protected Identifier identifier; - - /** - * The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the data element", formalDefinition="The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually." ) - protected StringType version; - - /** - * Details of the individual or organization who accepts responsibility for publishing the data element. - */ - @Child(name="publisher", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the data element." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * The status of the data element. - */ - @Child(name="status", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the data element." ) - protected Enumeration status; - - /** - * The date that this version of the data element was published. - */ - @Child(name="date", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Date for this version of the data element", formalDefinition="The date that this version of the data element was published." ) - protected DateTimeType date; - - /** - * The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - @Child(name="name", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Descriptive label for this element definition", formalDefinition="The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used." ) - protected StringType name; - - /** - * A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions. - */ - @Child(name="category", type={CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions." ) - protected List category; - - /** - * A code that provides the meaning for a data element according to a particular terminology. - */ - @Child(name="code", type={Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifying concept", formalDefinition="A code that provides the meaning for a data element according to a particular terminology." ) - protected List code; - - /** - * The default/suggested phrasing to use when prompting a human to capture the data element. - */ - @Child(name="question", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="How to ask for element", formalDefinition="The default/suggested phrasing to use when prompting a human to capture the data element." ) - protected StringType question; - - /** - * 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="Definition/description as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability." ) - protected StringType definition; - - /** - * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - @Child(name="comments", type={StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Comments about the use of this element", formalDefinition="Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc." ) - protected StringType comments; - - /** - * Explains why this element is needed and why it's been constrained as it has. - */ - @Child(name="requirements", type={StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this element is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * Identifies additional names by which this element might also be known. - */ - @Child(name="synonym", type={StringType.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) - protected List synonym; - - /** - * The FHIR data type that is the type for this element. - */ - @Child(name="type", type={CodeType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Name of Data type", formalDefinition="The FHIR data type that is the type for this element." ) - protected CodeType type; - - /** - * 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 sample value for this element demonstrating the type of information that would typically be captured." ) - protected org.hl7.fhir.instance.model.Type example; - - /** - * Indicates the shortest length that SHALL be supported by conformant instances without truncation. - */ - @Child(name="maxLength", type={IntegerType.class}, order=15, min=0, max=1) - @Description(shortDefinition="Length for strings", formalDefinition="Indicates the shortest length that SHALL be supported by conformant instances without truncation." ) - protected IntegerType maxLength; - - /** - * Identifies the units of measure in which the data element should be captured or expressed. - */ - @Child(name="units", type={CodeableConcept.class}, order=16, min=0, max=1) - @Description(shortDefinition="Units to use for measured value", formalDefinition="Identifies the units of measure in which the data element should be captured or expressed." ) - protected CodeableConcept units; - - /** - * Binds to a value set if this element is coded (code, Coding, CodeableConcept). - */ - @Child(name="binding", type={}, order=17, min=0, max=1) - @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) - protected DataElementBindingComponent binding; - - /** - * Identifies a concept from an external specification that roughly corresponds to this element. - */ - @Child(name="mapping", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) - protected List mapping; - - private static final long serialVersionUID = 692149082L; - - public DataElement() { - super(); - } - - public DataElement(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.) - */ - public DataElement setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public DataElement setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - public DataElement setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public DataElement setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Details of the individual or organization who accepts responsibility for publishing the data element. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Details of the individual or organization who accepts responsibility for publishing the data element. - */ - public DataElement setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DataElement setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the data element. - */ - public ResourceObservationDefStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the data element. - */ - public DataElement setStatus(ResourceObservationDefStatus value) { - if (this.status == null) - this.status = new Enumeration(ResourceObservationDefStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that this version of the data element was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this version of the data element was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DataElement setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this version of the data element was published. - */ - 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(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElement setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - public DataElement setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.) - */ - public List getCategory() { - if (this.category == null) - this.category = new ArrayList(); - return this.category; - } - - public boolean hasCategory() { - if (this.category == null) - return false; - for (CodeableConcept item : this.category) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #category} (A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.) - */ - // syntactic sugar - public CodeableConcept addCategory() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return t; - } - - /** - * @return {@link #code} (A code that provides the meaning for a data element according to a particular terminology.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A code that provides the meaning for a data element according to a particular terminology.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - /** - * @return {@link #question} (The default/suggested phrasing to use when prompting a human to capture the data element.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value - */ - public StringType getQuestionElement() { - if (this.question == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.question"); - else if (Configuration.doAutoCreate()) - this.question = new StringType(); - return this.question; - } - - public boolean hasQuestionElement() { - return this.question != null && !this.question.isEmpty(); - } - - public boolean hasQuestion() { - return this.question != null && !this.question.isEmpty(); - } - - /** - * @param value {@link #question} (The default/suggested phrasing to use when prompting a human to capture the data element.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value - */ - public DataElement setQuestionElement(StringType value) { - this.question = value; - return this; - } - - /** - * @return The default/suggested phrasing to use when prompting a human to capture the data element. - */ - public String getQuestion() { - return this.question == null ? null : this.question.getValue(); - } - - /** - * @param value The default/suggested phrasing to use when prompting a human to capture the data element. - */ - public DataElement setQuestion(String value) { - if (Utilities.noString(value)) - this.question = null; - else { - if (this.question == null) - this.question = new StringType(); - this.question.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public StringType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new StringType(); - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public DataElement setDefinitionElement(StringType value) { - this.definition = value; - return this; - } - - /** - * @return Provides a complete explanation of the meaning of the data element for human readability. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value Provides a complete explanation of the meaning of the data element for human readability. - */ - public DataElement setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new StringType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public DataElement setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public DataElement setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public DataElement setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this element is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this element is needed and why it's been constrained as it has. - */ - public DataElement setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - public List getSynonym() { - if (this.synonym == null) - this.synonym = new ArrayList(); - return this.synonym; - } - - public boolean hasSynonym() { - if (this.synonym == null) - return false; - for (StringType item : this.synonym) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - // syntactic sugar - public StringType addSynonymElement() {//2 - StringType t = new StringType(); - if (this.synonym == null) - this.synonym = new ArrayList(); - this.synonym.add(t); - return t; - } - - /** - * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - public DataElement addSynonym(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.synonym == null) - this.synonym = new ArrayList(); - this.synonym.add(t); - return this; - } - - /** - * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - public boolean hasSynonym(String value) { - if (this.synonym == null) - return false; - for (StringType v : this.synonym) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #type} (The FHIR data type that is the type for this element.). 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 DataElement.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 FHIR data type that is the type for this element.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public DataElement setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The FHIR data type that is the type for this element. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The FHIR data type that is the type for this element. - */ - public DataElement 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 #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; - } - - public boolean hasExample() { - return this.example != null && !this.example.isEmpty(); - } - - /** - * @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; - return this; - } - - /** - * @return {@link #maxLength} (Indicates the shortest length that SHALL be supported by conformant instances without truncation.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public IntegerType getMaxLengthElement() { - if (this.maxLength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.maxLength"); - else if (Configuration.doAutoCreate()) - this.maxLength = new IntegerType(); - return this.maxLength; - } - - public boolean hasMaxLengthElement() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - public boolean hasMaxLength() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - /** - * @param value {@link #maxLength} (Indicates the shortest length that SHALL be supported by conformant instances without truncation.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public DataElement setMaxLengthElement(IntegerType value) { - this.maxLength = value; - return this; - } - - /** - * @return Indicates the shortest length that SHALL be supported by conformant instances without truncation. - */ - public int getMaxLength() { - return this.maxLength == null ? null : this.maxLength.getValue(); - } - - /** - * @param value Indicates the shortest length that SHALL be supported by conformant instances without truncation. - */ - public DataElement setMaxLength(int value) { - if (value == -1) - this.maxLength = null; - else { - if (this.maxLength == null) - this.maxLength = new IntegerType(); - this.maxLength.setValue(value); - } - return this; - } - - /** - * @return {@link #units} (Identifies the units of measure in which the data element should be captured or expressed.) - */ - public CodeableConcept getUnits() { - if (this.units == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.units"); - else if (Configuration.doAutoCreate()) - this.units = new CodeableConcept(); - return this.units; - } - - public boolean hasUnits() { - return this.units != null && !this.units.isEmpty(); - } - - /** - * @param value {@link #units} (Identifies the units of measure in which the data element should be captured or expressed.) - */ - public DataElement setUnits(CodeableConcept value) { - this.units = value; - return this; - } - - /** - * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public DataElementBindingComponent getBinding() { - if (this.binding == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.binding"); - else if (Configuration.doAutoCreate()) - this.binding = new DataElementBindingComponent(); - return this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public DataElement setBinding(DataElementBindingComponent value) { - this.binding = value; - return this; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (DataElementMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - // syntactic sugar - public DataElementMappingComponent addMapping() { //3 - DataElementMappingComponent t = new DataElementMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the data element.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("status", "code", "The status of the data element.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the data element was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("name", "string", "The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("category", "CodeableConcept", "A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "Coding", "A code that provides the meaning for a data element according to a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("question", "string", "The default/suggested phrasing to use when prompting a human to capture the data element.", 0, java.lang.Integer.MAX_VALUE, question)); - childrenList.add(new Property("definition", "string", "Provides a complete explanation of the meaning of the data element for human readability.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("comments", "string", "Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); - 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 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)); - childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); - } - - public DataElement copy() { - DataElement dst = new DataElement(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.name = name == null ? null : name.copy(); - if (category != null) { - dst.category = new ArrayList(); - for (CodeableConcept i : category) - dst.category.add(i.copy()); - }; - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.question = question == null ? null : question.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.comments = comments == null ? null : comments.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - if (synonym != null) { - dst.synonym = new ArrayList(); - for (StringType i : synonym) - dst.synonym.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.example = example == null ? null : example.copy(); - dst.maxLength = maxLength == null ? null : maxLength.copy(); - dst.units = units == null ? null : units.copy(); - dst.binding = binding == null ? null : binding.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (DataElementMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - return dst; - } - - protected DataElement typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (status == null || status.isEmpty()) - && (date == null || date.isEmpty()) && (name == null || name.isEmpty()) && (category == null || category.isEmpty()) - && (code == null || code.isEmpty()) && (question == null || question.isEmpty()) && (definition == null || definition.isEmpty()) - && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (synonym == null || synonym.isEmpty()) && (type == null || type.isEmpty()) && (example == null || example.isEmpty()) - && (maxLength == null || maxLength.isEmpty()) && (units == null || units.isEmpty()) && (binding == null || binding.isEmpty()) - && (mapping == null || mapping.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DataElement; - } - - @SearchParamDefinition(name="category", path="DataElement.category", description="A category assigned to the data element (server may choose to do subsumption)", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="status", path="DataElement.status", description="The current status of the data element", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="DataElement.definition", description="Text search in the description of the data element", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="DataElement.name", description="Name of the data element", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="code", path="DataElement.code", description="A code for the data element (server may choose to do subsumption)", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="DataElement.date", description="The data element publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="The identifier of the data element", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="version", path="DataElement.version", description="The version identifier of the data element", type="string" ) - public static final String SP_VERSION = "version"; - -} - + +/* + 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; +/** + * The formal description of a single piece of information that can be gathered and reported. + */ +@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") +public class DataElement extends DomainResource { + + public enum ResourceObservationDefStatus implements FhirEnum { + /** + * This data element is still under development. + */ + DRAFT, + /** + * This data element is ready for normal use. + */ + ACTIVE, + /** + * This data element has been deprecated, withdrawn or superseded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This data element is still under development."; + case ACTIVE: return "This data element is ready for normal use."; + case RETIRED: return "This data element has been deprecated, withdrawn or superseded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class ResourceObservationDefStatusEnumFactory implements EnumFactory { + public ResourceObservationDefStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ResourceObservationDefStatus.DRAFT; + if ("active".equals(codeString)) + return ResourceObservationDefStatus.ACTIVE; + if ("retired".equals(codeString)) + return ResourceObservationDefStatus.RETIRED; + throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'"); + } + public String toCode(ResourceObservationDefStatus code) throws IllegalArgumentException { + if (code == ResourceObservationDefStatus.DRAFT) + return "draft"; + if (code == ResourceObservationDefStatus.ACTIVE) + return "active"; + if (code == ResourceObservationDefStatus.RETIRED) + return "retired"; + return "?"; + } + } + + 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. + */ + REQUIRED, + /** + * For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant. + */ + PREFERRED, + /** + * The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs. + */ + EXAMPLE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REQUIRED; + if ("preferred".equals(codeString)) + return PREFERRED; + if ("example".equals(codeString)) + return EXAMPLE; + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case PREFERRED: return "preferred"; + case EXAMPLE: return "example"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return ""; + case PREFERRED: return ""; + case EXAMPLE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "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."; + case PREFERRED: return "For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant."; + case EXAMPLE: return "The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "required"; + case PREFERRED: return "preferred"; + case EXAMPLE: return "example"; + default: return "?"; + } + } + } + + public static class BindingConformanceEnumFactory implements EnumFactory { + public BindingConformance fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return BindingConformance.REQUIRED; + if ("preferred".equals(codeString)) + return BindingConformance.PREFERRED; + if ("example".equals(codeString)) + return BindingConformance.EXAMPLE; + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); + } + public String toCode(BindingConformance code) throws IllegalArgumentException { + if (code == BindingConformance.REQUIRED) + return "required"; + if (code == BindingConformance.PREFERRED) + return "preferred"; + if (code == BindingConformance.EXAMPLE) + return "example"; + return "?"; + } + } + + @Block() + public static class DataElementBindingComponent extends BackboneElement { + /** + * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. + */ + @Child(name="isExtensible", type={BooleanType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Can additional codes be used?", formalDefinition="If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone." ) + protected BooleanType isExtensible; + + /** + * Indicates the degree of conformance expectations associated with this binding. + */ + @Child(name="conformance", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="required | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding." ) + protected Enumeration conformance; + + /** + * Describes the intended use of this particular set of codes. + */ + @Child(name="description", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) + protected StringType description; + + /** + * Points to the value set that identifies the set of codes to be used. + */ + @Child(name="valueSet", type={ValueSet.class}, order=4, min=0, max=1) + @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set that identifies the set of codes to be used." ) + protected Reference valueSet; + + /** + * The actual object that is the target of the reference (Points to the value set that identifies the set of codes to be used.) + */ + protected ValueSet valueSetTarget; + + private static final long serialVersionUID = -1297440999L; + + public DataElementBindingComponent() { + super(); + } + + public DataElementBindingComponent(BooleanType isExtensible) { + super(); + this.isExtensible = isExtensible; + } + + /** + * @return {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value + */ + public BooleanType getIsExtensibleElement() { + if (this.isExtensible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementBindingComponent.isExtensible"); + else if (Configuration.doAutoCreate()) + this.isExtensible = new BooleanType(); + return this.isExtensible; + } + + public boolean hasIsExtensibleElement() { + return this.isExtensible != null && !this.isExtensible.isEmpty(); + } + + public boolean hasIsExtensible() { + return this.isExtensible != null && !this.isExtensible.isEmpty(); + } + + /** + * @param value {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value + */ + public DataElementBindingComponent setIsExtensibleElement(BooleanType value) { + this.isExtensible = value; + return this; + } + + /** + * @return If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. + */ + public boolean getIsExtensible() { + return this.isExtensible == null ? false : this.isExtensible.getValue(); + } + + /** + * @param value If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. + */ + public DataElementBindingComponent setIsExtensible(boolean value) { + if (this.isExtensible == null) + this.isExtensible = new BooleanType(); + this.isExtensible.setValue(value); + return this; + } + + /** + * @return {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value + */ + public Enumeration getConformanceElement() { + if (this.conformance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementBindingComponent.conformance"); + else if (Configuration.doAutoCreate()) + this.conformance = new Enumeration(); + return this.conformance; + } + + public boolean hasConformanceElement() { + return this.conformance != null && !this.conformance.isEmpty(); + } + + public boolean hasConformance() { + return this.conformance != null && !this.conformance.isEmpty(); + } + + /** + * @param value {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value + */ + public DataElementBindingComponent setConformanceElement(Enumeration value) { + this.conformance = value; + return this; + } + + /** + * @return Indicates the degree of conformance expectations associated with this binding. + */ + public BindingConformance getConformance() { + return this.conformance == null ? null : this.conformance.getValue(); + } + + /** + * @param value Indicates the degree of conformance expectations associated with this binding. + */ + public DataElementBindingComponent setConformance(BindingConformance value) { + if (value == null) + this.conformance = null; + else { + if (this.conformance == null) + this.conformance = new Enumeration(BindingConformance.ENUM_FACTORY); + this.conformance.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Describes the intended use of this particular set of codes.). 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 DataElementBindingComponent.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} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DataElementBindingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Describes the intended use of this particular set of codes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Describes the intended use of this particular set of codes. + */ + public DataElementBindingComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #valueSet} (Points to the value set that identifies the set of codes to be used.) + */ + public Reference getValueSet() { + if (this.valueSet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementBindingComponent.valueSet"); + else if (Configuration.doAutoCreate()) + this.valueSet = new Reference(); + return this.valueSet; + } + + public boolean hasValueSet() { + return this.valueSet != null && !this.valueSet.isEmpty(); + } + + /** + * @param value {@link #valueSet} (Points to the value set that identifies the set of codes to be used.) + */ + public DataElementBindingComponent setValueSet(Reference value) { + this.valueSet = value; + return this; + } + + /** + * @return {@link #valueSet} 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. (Points to the value set that identifies the set of codes to be used.) + */ + public ValueSet getValueSetTarget() { + if (this.valueSetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementBindingComponent.valueSet"); + else if (Configuration.doAutoCreate()) + this.valueSetTarget = new ValueSet(); + return this.valueSetTarget; + } + + /** + * @param value {@link #valueSet} 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. (Points to the value set that identifies the set of codes to be used.) + */ + public DataElementBindingComponent setValueSetTarget(ValueSet value) { + this.valueSetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("isExtensible", "boolean", "If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.", 0, java.lang.Integer.MAX_VALUE, isExtensible)); + childrenList.add(new Property("conformance", "code", "Indicates the degree of conformance expectations associated with this binding.", 0, java.lang.Integer.MAX_VALUE, conformance)); + childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("valueSet", "Reference(ValueSet)", "Points to the value set that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); + } + + public DataElementBindingComponent copy() { + DataElementBindingComponent dst = new DataElementBindingComponent(); + copyValues(dst); + dst.isExtensible = isExtensible == null ? null : isExtensible.copy(); + dst.conformance = conformance == null ? null : conformance.copy(); + dst.description = description == null ? null : description.copy(); + dst.valueSet = valueSet == null ? null : valueSet.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (isExtensible == null || isExtensible.isEmpty()) && (conformance == null || conformance.isEmpty()) + && (description == null || description.isEmpty()) && (valueSet == null || valueSet.isEmpty()) + ; + } + + } + + @Block() + public static class DataElementMappingComponent extends BackboneElement { + /** + * A URI that identifies the specification that this mapping is expressed to. + */ + @Child(name="uri", type={UriType.class}, order=1, min=0, max=1) + @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=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=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=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 = 797049346L; + + public DataElementMappingComponent() { + super(); + } + + public DataElementMappingComponent(StringType map) { + super(); + this.map = map; + } + + /** + * @return {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public DataElementMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return A URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value A URI that identifies the specification that this mapping is expressed to. + */ + public DataElementMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.setValue(value); + } + 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 + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (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 + */ + public DataElementMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public DataElementMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public DataElementMappingComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public DataElementMappingComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public StringType getMapElement() { + if (this.map == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.map"); + else if (Configuration.doAutoCreate()) + this.map = new StringType(); + return this.map; + } + + public boolean hasMapElement() { + return this.map != null && !this.map.isEmpty(); + } + + public boolean hasMap() { + return this.map != null && !this.map.isEmpty(); + } + + /** + * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public DataElementMappingComponent setMapElement(StringType value) { + this.map = value; + return this; + } + + /** + * @return Expresses what part of the target specification corresponds to this element. + */ + public String getMap() { + return this.map == null ? null : this.map.getValue(); + } + + /** + * @param value Expresses what part of the target specification corresponds to this element. + */ + public DataElementMappingComponent setMap(String value) { + if (this.map == null) + this.map = new StringType(); + this.map.setValue(value); + return this; + } + + protected void listChildren(List 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)); + } + + public DataElementMappingComponent copy() { + 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(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (uri == null || uri.isEmpty()) && (definitional == null || definitional.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()) && (map == null || map.isEmpty()) + ; + } + + } + + /** + * The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Logical id to reference this data element", formalDefinition="The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance." ) + protected Identifier identifier; + + /** + * The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the data element", formalDefinition="The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually." ) + protected StringType version; + + /** + * Details of the individual or organization who accepts responsibility for publishing the data element. + */ + @Child(name="publisher", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the data element." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * The status of the data element. + */ + @Child(name="status", type={CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the data element." ) + protected Enumeration status; + + /** + * The date that this version of the data element was published. + */ + @Child(name="date", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Date for this version of the data element", formalDefinition="The date that this version of the data element was published." ) + protected DateTimeType date; + + /** + * The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + @Child(name="name", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Descriptive label for this element definition", formalDefinition="The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used." ) + protected StringType name; + + /** + * A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions. + */ + @Child(name="category", type={CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions." ) + protected List category; + + /** + * A code that provides the meaning for a data element according to a particular terminology. + */ + @Child(name="code", type={Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifying concept", formalDefinition="A code that provides the meaning for a data element according to a particular terminology." ) + protected List code; + + /** + * The default/suggested phrasing to use when prompting a human to capture the data element. + */ + @Child(name="question", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="How to ask for element", formalDefinition="The default/suggested phrasing to use when prompting a human to capture the data element." ) + protected StringType question; + + /** + * 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="Definition/description as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability." ) + protected StringType definition; + + /** + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + @Child(name="comments", type={StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Comments about the use of this element", formalDefinition="Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc." ) + protected StringType comments; + + /** + * Explains why this element is needed and why it's been constrained as it has. + */ + @Child(name="requirements", type={StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this element is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * Identifies additional names by which this element might also be known. + */ + @Child(name="synonym", type={StringType.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) + protected List synonym; + + /** + * The FHIR data type that is the type for this element. + */ + @Child(name="type", type={CodeType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Name of Data type", formalDefinition="The FHIR data type that is the type for this element." ) + protected CodeType type; + + /** + * 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 sample value for this element demonstrating the type of information that would typically be captured." ) + protected org.hl7.fhir.instance.model.Type example; + + /** + * Indicates the shortest length that SHALL be supported by conformant instances without truncation. + */ + @Child(name="maxLength", type={IntegerType.class}, order=15, min=0, max=1) + @Description(shortDefinition="Length for strings", formalDefinition="Indicates the shortest length that SHALL be supported by conformant instances without truncation." ) + protected IntegerType maxLength; + + /** + * Identifies the units of measure in which the data element should be captured or expressed. + */ + @Child(name="units", type={CodeableConcept.class}, order=16, min=0, max=1) + @Description(shortDefinition="Units to use for measured value", formalDefinition="Identifies the units of measure in which the data element should be captured or expressed." ) + protected CodeableConcept units; + + /** + * Binds to a value set if this element is coded (code, Coding, CodeableConcept). + */ + @Child(name="binding", type={}, order=17, min=0, max=1) + @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) + protected DataElementBindingComponent binding; + + /** + * Identifies a concept from an external specification that roughly corresponds to this element. + */ + @Child(name="mapping", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) + protected List mapping; + + private static final long serialVersionUID = 692149082L; + + public DataElement() { + super(); + } + + public DataElement(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.) + */ + public DataElement setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public DataElement setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + */ + public DataElement setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public DataElement setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Details of the individual or organization who accepts responsibility for publishing the data element. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Details of the individual or organization who accepts responsibility for publishing the data element. + */ + public DataElement setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DataElement setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the data element. + */ + public ResourceObservationDefStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the data element. + */ + public DataElement setStatus(ResourceObservationDefStatus value) { + if (this.status == null) + this.status = new Enumeration(ResourceObservationDefStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that this version of the data element was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this version of the data element was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DataElement setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this version of the data element was published. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DataElement setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + */ + public DataElement setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.) + */ + public List getCategory() { + if (this.category == null) + this.category = new ArrayList(); + return this.category; + } + + public boolean hasCategory() { + if (this.category == null) + return false; + for (CodeableConcept item : this.category) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #category} (A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.) + */ + // syntactic sugar + public CodeableConcept addCategory() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.category == null) + this.category = new ArrayList(); + this.category.add(t); + return t; + } + + /** + * @return {@link #code} (A code that provides the meaning for a data element according to a particular terminology.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A code that provides the meaning for a data element according to a particular terminology.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + /** + * @return {@link #question} (The default/suggested phrasing to use when prompting a human to capture the data element.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value + */ + public StringType getQuestionElement() { + if (this.question == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.question"); + else if (Configuration.doAutoCreate()) + this.question = new StringType(); + return this.question; + } + + public boolean hasQuestionElement() { + return this.question != null && !this.question.isEmpty(); + } + + public boolean hasQuestion() { + return this.question != null && !this.question.isEmpty(); + } + + /** + * @param value {@link #question} (The default/suggested phrasing to use when prompting a human to capture the data element.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value + */ + public DataElement setQuestionElement(StringType value) { + this.question = value; + return this; + } + + /** + * @return The default/suggested phrasing to use when prompting a human to capture the data element. + */ + public String getQuestion() { + return this.question == null ? null : this.question.getValue(); + } + + /** + * @param value The default/suggested phrasing to use when prompting a human to capture the data element. + */ + public DataElement setQuestion(String value) { + if (Utilities.noString(value)) + this.question = null; + else { + if (this.question == null) + this.question = new StringType(); + this.question.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public StringType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new StringType(); + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public DataElement setDefinitionElement(StringType value) { + this.definition = value; + return this; + } + + /** + * @return Provides a complete explanation of the meaning of the data element for human readability. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value Provides a complete explanation of the meaning of the data element for human readability. + */ + public DataElement setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new StringType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public DataElement setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public DataElement setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public DataElement setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this element is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this element is needed and why it's been constrained as it has. + */ + public DataElement setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + public List getSynonym() { + if (this.synonym == null) + this.synonym = new ArrayList(); + return this.synonym; + } + + public boolean hasSynonym() { + if (this.synonym == null) + return false; + for (StringType item : this.synonym) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + // syntactic sugar + public StringType addSynonymElement() {//2 + StringType t = new StringType(); + if (this.synonym == null) + this.synonym = new ArrayList(); + this.synonym.add(t); + return t; + } + + /** + * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + public DataElement addSynonym(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.synonym == null) + this.synonym = new ArrayList(); + this.synonym.add(t); + return this; + } + + /** + * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + public boolean hasSynonym(String value) { + if (this.synonym == null) + return false; + for (StringType v : this.synonym) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #type} (The FHIR data type that is the type for this element.). 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 DataElement.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 FHIR data type that is the type for this element.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public DataElement setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The FHIR data type that is the type for this element. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The FHIR data type that is the type for this element. + */ + public DataElement 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 #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; + } + + public boolean hasExample() { + return this.example != null && !this.example.isEmpty(); + } + + /** + * @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; + return this; + } + + /** + * @return {@link #maxLength} (Indicates the shortest length that SHALL be supported by conformant instances without truncation.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public IntegerType getMaxLengthElement() { + if (this.maxLength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.maxLength"); + else if (Configuration.doAutoCreate()) + this.maxLength = new IntegerType(); + return this.maxLength; + } + + public boolean hasMaxLengthElement() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + public boolean hasMaxLength() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + /** + * @param value {@link #maxLength} (Indicates the shortest length that SHALL be supported by conformant instances without truncation.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public DataElement setMaxLengthElement(IntegerType value) { + this.maxLength = value; + return this; + } + + /** + * @return Indicates the shortest length that SHALL be supported by conformant instances without truncation. + */ + public int getMaxLength() { + return this.maxLength == null ? null : this.maxLength.getValue(); + } + + /** + * @param value Indicates the shortest length that SHALL be supported by conformant instances without truncation. + */ + public DataElement setMaxLength(int value) { + if (value == -1) + this.maxLength = null; + else { + if (this.maxLength == null) + this.maxLength = new IntegerType(); + this.maxLength.setValue(value); + } + return this; + } + + /** + * @return {@link #units} (Identifies the units of measure in which the data element should be captured or expressed.) + */ + public CodeableConcept getUnits() { + if (this.units == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.units"); + else if (Configuration.doAutoCreate()) + this.units = new CodeableConcept(); + return this.units; + } + + public boolean hasUnits() { + return this.units != null && !this.units.isEmpty(); + } + + /** + * @param value {@link #units} (Identifies the units of measure in which the data element should be captured or expressed.) + */ + public DataElement setUnits(CodeableConcept value) { + this.units = value; + return this; + } + + /** + * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public DataElementBindingComponent getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElement.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new DataElementBindingComponent(); + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public DataElement setBinding(DataElementBindingComponent value) { + this.binding = value; + return this; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (DataElementMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + // syntactic sugar + public DataElementMappingComponent addMapping() { //3 + DataElementMappingComponent t = new DataElementMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The identifier that is used to identify this data element when it is referenced in a Profile, Questionnaire or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a Profile, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the data element.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("status", "code", "The status of the data element.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The date that this version of the data element was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("name", "string", "The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("category", "CodeableConcept", "A set of terms from external terminologies that may be used to assist with indexing and searching of data element definitions.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "Coding", "A code that provides the meaning for a data element according to a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("question", "string", "The default/suggested phrasing to use when prompting a human to capture the data element.", 0, java.lang.Integer.MAX_VALUE, question)); + childrenList.add(new Property("definition", "string", "Provides a complete explanation of the meaning of the data element for human readability.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("comments", "string", "Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); + 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 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)); + childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); + } + + public DataElement copy() { + DataElement dst = new DataElement(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.name = name == null ? null : name.copy(); + if (category != null) { + dst.category = new ArrayList(); + for (CodeableConcept i : category) + dst.category.add(i.copy()); + }; + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.question = question == null ? null : question.copy(); + dst.definition = definition == null ? null : definition.copy(); + dst.comments = comments == null ? null : comments.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + if (synonym != null) { + dst.synonym = new ArrayList(); + for (StringType i : synonym) + dst.synonym.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.example = example == null ? null : example.copy(); + dst.maxLength = maxLength == null ? null : maxLength.copy(); + dst.units = units == null ? null : units.copy(); + dst.binding = binding == null ? null : binding.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (DataElementMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + return dst; + } + + protected DataElement typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (status == null || status.isEmpty()) + && (date == null || date.isEmpty()) && (name == null || name.isEmpty()) && (category == null || category.isEmpty()) + && (code == null || code.isEmpty()) && (question == null || question.isEmpty()) && (definition == null || definition.isEmpty()) + && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (synonym == null || synonym.isEmpty()) && (type == null || type.isEmpty()) && (example == null || example.isEmpty()) + && (maxLength == null || maxLength.isEmpty()) && (units == null || units.isEmpty()) && (binding == null || binding.isEmpty()) + && (mapping == null || mapping.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DataElement; + } + + @SearchParamDefinition(name="category", path="DataElement.category", description="A category assigned to the data element (server may choose to do subsumption)", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="status", path="DataElement.status", description="The current status of the data element", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="description", path="DataElement.definition", description="Text search in the description of the data element", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="name", path="DataElement.name", description="Name of the data element", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="code", path="DataElement.code", description="A code for the data element (server may choose to do subsumption)", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="DataElement.date", description="The data element publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="The identifier of the data element", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="version", path="DataElement.version", description="The version identifier of the data element", type="string" ) + public static final String SP_VERSION = "version"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java index d58abe5410c..ba17c393fe6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java @@ -20,592 +20,592 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.text.ParseException; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import org.hl7.fhir.utilities.Utilities; - -// java 1.7 can parse xml date/times, but going java 1.7 is too hard for implementers -// javax.xml.bind.DatatypeConverter can parse xml date/times, but is not available on android. (and it's error message sucks) -// anyway, the underlying date/time concept has variable precision, and timezone, and neither Date nor Calendar real with -// that nicely. So we parse the date directly - -public class DateAndTime { - - private int year; - private int month; - private int day; - private boolean time; - private int hour; - private int minute; - private boolean seconds; - private int second; - private int fractions; - private int fraction; - private java.lang.Boolean timezone; - private boolean positiveOffset; //needed to represent negative offset of less than an hour (for example -00:00 or -00:30) - private int tzHour; - private int tzMin; - - public DateAndTime(String xDate) throws ParseException { - - String s; - String t = null; - if (xDate.endsWith("Z")) { - s = xDate.substring(0, xDate.length()-1); - timezone = false; - } else if (xDate.lastIndexOf("-") > 8) { - s = xDate.substring(0, xDate.lastIndexOf("-")); - t = xDate.substring(xDate.lastIndexOf("-")); - setTzSign(false); - } else if (xDate.lastIndexOf("+") > 8) { - s = xDate.substring(0, xDate.lastIndexOf("+")); - t = xDate.substring(xDate.lastIndexOf("+")); - setTzSign(true); - } else { // no timezone - s = xDate; - t = null; - timezone = null; - } - - int offset = 0; - try { - int yearlength = s.startsWith("-") ? s.substring(1).indexOf("-") + 1 : s.indexOf("-"); - if (yearlength == -1) { - yearlength = 4; - } - setYear(readField(s, 0, yearlength)); - offset = yearlength; - if (s.length() >= yearlength + 3) - setMonth(readField(s, yearlength + 1, 2)); - offset = yearlength + 4; - if (s.length() >= yearlength + 6) - setDay(readField(s, yearlength + 4, 2)); - offset = yearlength + 7; - if (s.length() >= yearlength + 9) - setHour(readField(s, yearlength + 7, 2)); - offset = yearlength + 10; - if (s.length() >= yearlength + 12) - setMinute(readField(s, yearlength + 10, 2)); - offset = yearlength + 13; - if (s.length() >= yearlength + 15) - setSecond(readField(s, yearlength + 13, 2)); - offset = yearlength + 16; - if (s.length() >= yearlength + 17) { - setFractions(s.length() - (yearlength + 16)); - setFraction(readField(s, yearlength + 16, fractions)); - } - if (t != null) { - setTzHour(readField(t, 1, 2)); - setTzMin(readField(t, 4, 2)); - } - } catch (Exception e) { - throw new ParseException("The date '"+xDate+"' is not a valid Date Time Format at character "+java.lang.Integer.toString(offset), offset); - } - } - - private static int readField(String date, int i, int j) { - String s = date.substring(i, i+j); - if (s.startsWith("+")) - s = s.substring(1); - return java.lang.Integer.parseInt(s); - } - - - public DateAndTime(Calendar date) { - setCalendar(date); - } - - private void setCalendar(Calendar date) { - setYear(date.get(Calendar.YEAR)); - setMonth(date.get(Calendar.MONTH)+1); - setDay(date.get(Calendar.DAY_OF_MONTH)); - setHour(date.get(Calendar.HOUR_OF_DAY)); - setMinute(date.get(Calendar.MINUTE)); - setSecond(date.get(Calendar.SECOND)); - if (date.get(Calendar.MILLISECOND) > 0) { - setFractions(3); - try { - setFraction(date.get(Calendar.MILLISECOND)); - } catch (Exception e) { - // can't happen - } - } - if (date.getTimeZone() != null) { - int offset = date.getTimeZone().getOffset(date.getTime().getTime()); - setOffsetMinutes(offset / 1000 / 60); - } - } - - public DateAndTime(java.util.Date date) { - Calendar cal = new GregorianCalendar(); - cal.setTime(date); - setCalendar(cal); - } - - private DateAndTime() { - } - - @Override - public String toString() { - StringBuilder b = new StringBuilder(); - b.append(Utilities.padLeft(java.lang.Integer.toString(year), '0', 4)); - if (month != 0) { - b.append("-"); - b.append(Utilities.padLeft(java.lang.Integer.toString(month), '0', 2)); - if (day != 0) { - b.append("-"); - b.append(Utilities.padLeft(java.lang.Integer.toString(day), '0', 2)); - if (time) { - b.append("T"); - b.append(Utilities.padLeft(java.lang.Integer.toString(hour), '0', 2)); - b.append(":"); - b.append(Utilities.padLeft(java.lang.Integer.toString(minute), '0', 2)); - if (seconds) { - b.append(":"); - b.append(Utilities.padLeft(java.lang.Integer.toString(second), '0', 2)); - if (fractions > 0) { - b.append("."); - b.append(Utilities.padLeft(java.lang.Integer.toString(fraction), '0', fractions)); - } - } - } - if (timezone != null) { - if (!timezone) { - b.append("Z"); - } else { - if (positiveOffset) { - b.append("+"); - } else { - b.append("-"); - } - b.append(Utilities.padLeft(java.lang.Integer.toString(tzHour), '0', 2)); - b.append(":"); - b.append(Utilities.padLeft(java.lang.Integer.toString(tzMin), '0', 2)); - } - } - } - } - return b.toString(); - } - - public Calendar toCalendar() { - Calendar cal = null; - if (timezone == null) { - cal = Calendar.getInstance(); - } else { - TimeZone tz; - if (!timezone) { - 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); - } - - //default to 0 if unset - cal.set(Calendar.MONTH, 0); - cal.set(Calendar.DAY_OF_MONTH, 1); - cal.set(Calendar.HOUR_OF_DAY, 0); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - cal.set(Calendar.MILLISECOND, 0); - - cal.set(Calendar.YEAR, year); - if (month > 0) { - cal.set(Calendar.MONTH, month - 1); - if (day > 0) { - cal.set(Calendar.DAY_OF_MONTH, day); - if (time) { - cal.set(Calendar.HOUR_OF_DAY, hour); - cal.set(Calendar.MINUTE, minute); - if (seconds) { - cal.set(Calendar.SECOND, second); - if (fractions > 0) { - cal.set(Calendar.MILLISECOND, (int)((double) fraction / Math.pow(10, fractions) * 1000.0)); - } - } - } - } - } - return cal; - } - - public DateType toDate() { - return null; - } - - public int getYear() { - return year; - } - - public void setYear(int year) { - this.year = year; - } - - public int getMonth() { - return month; - } - - public void setMonth(int month) { - this.month = month; - } - - public int getDay() { - return day; - } - - public void setDay(int day) { - this.day = day; - } - - public boolean isTime() { - return time; - } - - public void setTime(boolean time) { - this.time = time; - if (!time) - setSeconds(false); - } - - public int getHour() { - return hour; - } - - public void setHour(int hour) { - this.time = true; - this.hour = hour; - } - - public int getMinute() { - return minute; - } - - public void setMinute(int minute) { - this.time = true; - this.minute = minute; - } - - public boolean isSeconds() { - return seconds; - } - - public void setSeconds(boolean seconds) { - this.seconds = seconds; - if (!seconds) - setFractions(0); - } - - public int getSecond() { - return second; - } - - public void setSecond(int second) { - this.time = true; - this.seconds = true; - this.second = second; - } - - public int getFractions() { - return fractions; - } - - public void setFractions(int fractions) { - this.fractions = fractions; - } - - public int getFraction() { - return fraction; - } - - public void setFraction(int fraction) throws Exception { - if (this.fractions == 0) - throw new Exception("set 'fractions' before setting 'fraction'"); - - this.fraction = fraction; - } - - public java.lang.Boolean getTimezone() { - return timezone; - } - - public void setTimezone(java.lang.Boolean timezone) { - this.timezone = timezone; - } - - public int getTzHour() { - return tzHour; - } - - public void setTzHour(int tzHour) { - this.tzHour = Math.abs(tzHour); - this.timezone = true; - } - - /** - * @param isPositiveOffset - true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) - */ - public void setTzSign(boolean isPositiveOffset) { - positiveOffset = isPositiveOffset; - this.timezone = true; - } - - /** - * @return true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) - */ - public boolean getTzSign() { - return positiveOffset; - } - - /** - * @param offset in minutes - */ - public void setOffsetMinutes(int offset) { - boolean positive = (offset >= 0); - offset = Math.abs(offset); - setTzHour(offset / 60); - setTzMin(offset % 60); - setTzSign(positive); - } - - /** - * @return offset in minutes - */ - public int getOffsetMinutes() { - if(timezone == null || !timezone) { - return 0; - } else { - return (positiveOffset ? 1 : -1) * (tzHour * 60 + tzMin); - } - } - - public int getTzMin() { - return tzMin; - } - - public void setTzMin(int tzMin) { - this.tzMin = Math.abs(tzMin); - this.timezone = true; - } - - public static DateAndTime now() { - return new DateAndTime(Calendar.getInstance()); - } - - public static DateAndTime today() { - DateAndTime dt = new DateAndTime(Calendar.getInstance()); - dt.setTime(false); - return dt; - } - - public static DateAndTime parseV3(String xDate) throws ParseException { - - DateAndTime res = new DateAndTime(); - String s; - String t = null; - if (xDate.endsWith("Z")) { - s = xDate.substring(0, xDate.length()-1); - res.timezone = false; - } else if (xDate.lastIndexOf("-") > 0) { - s = xDate.substring(0, xDate.lastIndexOf("-")); - t = xDate.substring(xDate.lastIndexOf("-")); - res.setTzSign(false); - } else if (xDate.lastIndexOf("+") > 0) { - s = xDate.substring(0, xDate.lastIndexOf("+")); - t = xDate.substring(xDate.lastIndexOf("+")); - res.setTzSign(true); - } else { // no timezone - s = xDate; - t = null; - res.timezone = null; - } - - int offset = 0; - try { - res.setYear(readField(s, 0, 4)); - offset = 4; - if (s.length() >= 6) - res.setMonth(readField(s, 4, 2)); - offset = 6; - if (s.length() >= 8) - res.setDay(readField(s, 6, 2)); - offset = 8; - if (s.length() >= 10) - res.setHour(readField(s, 8, 2)); - offset = 10; - if (s.length() >= 12) - res.setMinute(readField(s, 10, 2)); - offset = 12; - if (s.length() >= 14) - res.setSecond(readField(s, 12, 2)); - offset = 15; - if (s.length() >= 16) { - res.setFractions(s.length() - (15)); - res.setFraction(readField(s, 15, res.fractions)); - } - if (t != null) { - res.setTzHour(readField(t, 1, 2)); - res.setTzMin(readField(t, 3, 2)); - } - } catch (Exception e) { - throw new ParseException("The date '"+xDate+"' is not a valid Date Time Format at character "+java.lang.Integer.toString(offset), offset); - } - return res; - } - - public DateAndTime expandTime() { - time = true; - seconds = true; - timezone = true; - TimeZone tz = TimeZone.getDefault(); - - int offset = tz.getOffset(new java.util.Date().getTime()); - setOffsetMinutes(offset / (60 * 1000)); - return this; - } - - public String toHumanDisplay() { - if (isTime()) - return java.lang.Integer.toString(this.day)+"-"+this.getMonthCode()+" "+java.lang.Integer.toString(this.getYear()) +" "+java.lang.Integer.toString(this.hour)+":"+java.lang.Integer.toString(this.minute); - else - return java.lang.Integer.toString(this.day)+"-"+this.getMonthCode()+" "+java.lang.Integer.toString(this.getYear()); - } - - private String getMonthCode() { - switch (month) { - case 1: return "Jan"; - case 2: return "Feb"; - case 3: return "Mar"; - case 4: return "Apr"; - case 5: return "May"; - case 6: return "Jun"; - case 7: return "Jul"; - case 8: return "Aug"; - case 9: return "Sep"; - case 10: return "Oct"; - case 11: return "Nov"; - case 12: return "Dec"; - - } - return null; - } - - /** - * Add a duration to the DateAndTime. See documentation for Calendar.add - * - * @param field - Calendar constants for field - * @param value - value to add - can be positive or negative - * @throws Exception - */ - public void add(int field, int value) throws Exception { - switch (field) { - case Calendar.YEAR: - year = year + value; - break; - case Calendar.MONTH: - month = month + (value == 0 ? 1 : value); - while (month <= 0) { - add(Calendar.YEAR, -1); - month = month + 12; - } - while (month > 12) { - add(Calendar.YEAR, 1); - month = month - 12; - } - break; - case Calendar.DAY_OF_YEAR: - day = day + (value == 0 ? 1 : value); - while (day <= 0) { - add(Calendar.MONTH, -1); - day = day + daysInMonth(year, month); - } - int days = daysInMonth(year, month); - while (day > days) { - add(Calendar.MONTH, 1); - day = day - days; - days = daysInMonth(year, month); - } - break; - case Calendar.HOUR: - hour = hour + value; - time = true; - while (hour < 0) { - add(Calendar.DAY_OF_YEAR, -1); - hour = hour + 24; - } - while (hour >= 24) { - add(Calendar.DAY_OF_YEAR, 1); - hour = hour - 24; - } - break; - case Calendar.MINUTE: - minute = minute + value; - time = true; - while (minute < 0) { - add(Calendar.HOUR, -1); - minute = minute + 60; - } - while (minute >= 60) { - add(Calendar.HOUR, 1); - minute = minute - 60; - } - break; - case Calendar.SECOND: - second = second + value; - seconds = true; - while (second < 0) { - add(Calendar.MINUTE, -1); - second = second + 60; - } - while (second >= 60) { - add(Calendar.MINUTE, 1); - second = second - 60; - } - break; - default: - throw new Exception("Unknown field"); - } - } - - private int daysInMonth(int aYear, int aMonth) { - switch (aMonth) { - case 1: return 31; - case 2: return isleapYear(aYear) ? 29 : 28; - case 3: return 31; - case 4: return 30; - case 5: return 31; - case 6: return 30; - case 7: return 31; - case 8: return 31; - case 9: return 30; - case 10: return 31; - case 11: return 30; - case 12: return 31; - default: - throw new Error("illegal month "+java.lang.Integer.toString(aMonth)); - } - } - - private boolean isleapYear(int aYear) { - return (aYear % 4 == 0) && !((aYear % 100 == 0) && (aYear % 400 != 0)); - } - - public boolean before(DateAndTime other) { - - if(this.time && other.time) { - return toCalendar().getTimeInMillis() < other.toCalendar().getTimeInMillis(); - } else if (this.year != other.year) { - return this.year < other.year; - } else if (this.month != other.month) { - return this.month < other.month; - } else if (this.day != other.day) { - return this.day < other.day; - } else - return false; - } - -} + +import java.text.ParseException; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import org.hl7.fhir.utilities.Utilities; + +// java 1.7 can parse xml date/times, but going java 1.7 is too hard for implementers +// javax.xml.bind.DatatypeConverter can parse xml date/times, but is not available on android. (and it's error message sucks) +// anyway, the underlying date/time concept has variable precision, and timezone, and neither Date nor Calendar real with +// that nicely. So we parse the date directly + +public class DateAndTime { + + private int year; + private int month; + private int day; + private boolean time; + private int hour; + private int minute; + private boolean seconds; + private int second; + private int fractions; + private int fraction; + private java.lang.Boolean timezone; + private boolean positiveOffset; //needed to represent negative offset of less than an hour (for example -00:00 or -00:30) + private int tzHour; + private int tzMin; + + public DateAndTime(String xDate) throws ParseException { + + String s; + String t = null; + if (xDate.endsWith("Z")) { + s = xDate.substring(0, xDate.length()-1); + timezone = false; + } else if (xDate.lastIndexOf("-") > 8) { + s = xDate.substring(0, xDate.lastIndexOf("-")); + t = xDate.substring(xDate.lastIndexOf("-")); + setTzSign(false); + } else if (xDate.lastIndexOf("+") > 8) { + s = xDate.substring(0, xDate.lastIndexOf("+")); + t = xDate.substring(xDate.lastIndexOf("+")); + setTzSign(true); + } else { // no timezone + s = xDate; + t = null; + timezone = null; + } + + int offset = 0; + try { + int yearlength = s.startsWith("-") ? s.substring(1).indexOf("-") + 1 : s.indexOf("-"); + if (yearlength == -1) { + yearlength = 4; + } + setYear(readField(s, 0, yearlength)); + offset = yearlength; + if (s.length() >= yearlength + 3) + setMonth(readField(s, yearlength + 1, 2)); + offset = yearlength + 4; + if (s.length() >= yearlength + 6) + setDay(readField(s, yearlength + 4, 2)); + offset = yearlength + 7; + if (s.length() >= yearlength + 9) + setHour(readField(s, yearlength + 7, 2)); + offset = yearlength + 10; + if (s.length() >= yearlength + 12) + setMinute(readField(s, yearlength + 10, 2)); + offset = yearlength + 13; + if (s.length() >= yearlength + 15) + setSecond(readField(s, yearlength + 13, 2)); + offset = yearlength + 16; + if (s.length() >= yearlength + 17) { + setFractions(s.length() - (yearlength + 16)); + setFraction(readField(s, yearlength + 16, fractions)); + } + if (t != null) { + setTzHour(readField(t, 1, 2)); + setTzMin(readField(t, 4, 2)); + } + } catch (Exception e) { + throw new ParseException("The date '"+xDate+"' is not a valid Date Time Format at character "+java.lang.Integer.toString(offset), offset); + } + } + + private static int readField(String date, int i, int j) { + String s = date.substring(i, i+j); + if (s.startsWith("+")) + s = s.substring(1); + return java.lang.Integer.parseInt(s); + } + + + public DateAndTime(Calendar date) { + setCalendar(date); + } + + private void setCalendar(Calendar date) { + setYear(date.get(Calendar.YEAR)); + setMonth(date.get(Calendar.MONTH)+1); + setDay(date.get(Calendar.DAY_OF_MONTH)); + setHour(date.get(Calendar.HOUR_OF_DAY)); + setMinute(date.get(Calendar.MINUTE)); + setSecond(date.get(Calendar.SECOND)); + if (date.get(Calendar.MILLISECOND) > 0) { + setFractions(3); + try { + setFraction(date.get(Calendar.MILLISECOND)); + } catch (Exception e) { + // can't happen + } + } + if (date.getTimeZone() != null) { + int offset = date.getTimeZone().getOffset(date.getTime().getTime()); + setOffsetMinutes(offset / 1000 / 60); + } + } + + public DateAndTime(java.util.Date date) { + Calendar cal = new GregorianCalendar(); + cal.setTime(date); + setCalendar(cal); + } + + private DateAndTime() { + } + + @Override + public String toString() { + StringBuilder b = new StringBuilder(); + b.append(Utilities.padLeft(java.lang.Integer.toString(year), '0', 4)); + if (month != 0) { + b.append("-"); + b.append(Utilities.padLeft(java.lang.Integer.toString(month), '0', 2)); + if (day != 0) { + b.append("-"); + b.append(Utilities.padLeft(java.lang.Integer.toString(day), '0', 2)); + if (time) { + b.append("T"); + b.append(Utilities.padLeft(java.lang.Integer.toString(hour), '0', 2)); + b.append(":"); + b.append(Utilities.padLeft(java.lang.Integer.toString(minute), '0', 2)); + if (seconds) { + b.append(":"); + b.append(Utilities.padLeft(java.lang.Integer.toString(second), '0', 2)); + if (fractions > 0) { + b.append("."); + b.append(Utilities.padLeft(java.lang.Integer.toString(fraction), '0', fractions)); + } + } + } + if (timezone != null) { + if (!timezone) { + b.append("Z"); + } else { + if (positiveOffset) { + b.append("+"); + } else { + b.append("-"); + } + b.append(Utilities.padLeft(java.lang.Integer.toString(tzHour), '0', 2)); + b.append(":"); + b.append(Utilities.padLeft(java.lang.Integer.toString(tzMin), '0', 2)); + } + } + } + } + return b.toString(); + } + + public Calendar toCalendar() { + Calendar cal = null; + if (timezone == null) { + cal = Calendar.getInstance(); + } else { + TimeZone tz; + if (!timezone) { + 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); + } + + //default to 0 if unset + cal.set(Calendar.MONTH, 0); + cal.set(Calendar.DAY_OF_MONTH, 1); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + + cal.set(Calendar.YEAR, year); + if (month > 0) { + cal.set(Calendar.MONTH, month - 1); + if (day > 0) { + cal.set(Calendar.DAY_OF_MONTH, day); + if (time) { + cal.set(Calendar.HOUR_OF_DAY, hour); + cal.set(Calendar.MINUTE, minute); + if (seconds) { + cal.set(Calendar.SECOND, second); + if (fractions > 0) { + cal.set(Calendar.MILLISECOND, (int)((double) fraction / Math.pow(10, fractions) * 1000.0)); + } + } + } + } + } + return cal; + } + + public DateType toDate() { + return null; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public int getMonth() { + return month; + } + + public void setMonth(int month) { + this.month = month; + } + + public int getDay() { + return day; + } + + public void setDay(int day) { + this.day = day; + } + + public boolean isTime() { + return time; + } + + public void setTime(boolean time) { + this.time = time; + if (!time) + setSeconds(false); + } + + public int getHour() { + return hour; + } + + public void setHour(int hour) { + this.time = true; + this.hour = hour; + } + + public int getMinute() { + return minute; + } + + public void setMinute(int minute) { + this.time = true; + this.minute = minute; + } + + public boolean isSeconds() { + return seconds; + } + + public void setSeconds(boolean seconds) { + this.seconds = seconds; + if (!seconds) + setFractions(0); + } + + public int getSecond() { + return second; + } + + public void setSecond(int second) { + this.time = true; + this.seconds = true; + this.second = second; + } + + public int getFractions() { + return fractions; + } + + public void setFractions(int fractions) { + this.fractions = fractions; + } + + public int getFraction() { + return fraction; + } + + public void setFraction(int fraction) throws Exception { + if (this.fractions == 0) + throw new Exception("set 'fractions' before setting 'fraction'"); + + this.fraction = fraction; + } + + public java.lang.Boolean getTimezone() { + return timezone; + } + + public void setTimezone(java.lang.Boolean timezone) { + this.timezone = timezone; + } + + public int getTzHour() { + return tzHour; + } + + public void setTzHour(int tzHour) { + this.tzHour = Math.abs(tzHour); + this.timezone = true; + } + + /** + * @param isPositiveOffset - true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) + */ + public void setTzSign(boolean isPositiveOffset) { + positiveOffset = isPositiveOffset; + this.timezone = true; + } + + /** + * @return true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) + */ + public boolean getTzSign() { + return positiveOffset; + } + + /** + * @param offset in minutes + */ + public void setOffsetMinutes(int offset) { + boolean positive = (offset >= 0); + offset = Math.abs(offset); + setTzHour(offset / 60); + setTzMin(offset % 60); + setTzSign(positive); + } + + /** + * @return offset in minutes + */ + public int getOffsetMinutes() { + if(timezone == null || !timezone) { + return 0; + } else { + return (positiveOffset ? 1 : -1) * (tzHour * 60 + tzMin); + } + } + + public int getTzMin() { + return tzMin; + } + + public void setTzMin(int tzMin) { + this.tzMin = Math.abs(tzMin); + this.timezone = true; + } + + public static DateAndTime now() { + return new DateAndTime(Calendar.getInstance()); + } + + public static DateAndTime today() { + DateAndTime dt = new DateAndTime(Calendar.getInstance()); + dt.setTime(false); + return dt; + } + + public static DateAndTime parseV3(String xDate) throws ParseException { + + DateAndTime res = new DateAndTime(); + String s; + String t = null; + if (xDate.endsWith("Z")) { + s = xDate.substring(0, xDate.length()-1); + res.timezone = false; + } else if (xDate.lastIndexOf("-") > 0) { + s = xDate.substring(0, xDate.lastIndexOf("-")); + t = xDate.substring(xDate.lastIndexOf("-")); + res.setTzSign(false); + } else if (xDate.lastIndexOf("+") > 0) { + s = xDate.substring(0, xDate.lastIndexOf("+")); + t = xDate.substring(xDate.lastIndexOf("+")); + res.setTzSign(true); + } else { // no timezone + s = xDate; + t = null; + res.timezone = null; + } + + int offset = 0; + try { + res.setYear(readField(s, 0, 4)); + offset = 4; + if (s.length() >= 6) + res.setMonth(readField(s, 4, 2)); + offset = 6; + if (s.length() >= 8) + res.setDay(readField(s, 6, 2)); + offset = 8; + if (s.length() >= 10) + res.setHour(readField(s, 8, 2)); + offset = 10; + if (s.length() >= 12) + res.setMinute(readField(s, 10, 2)); + offset = 12; + if (s.length() >= 14) + res.setSecond(readField(s, 12, 2)); + offset = 15; + if (s.length() >= 16) { + res.setFractions(s.length() - (15)); + res.setFraction(readField(s, 15, res.fractions)); + } + if (t != null) { + res.setTzHour(readField(t, 1, 2)); + res.setTzMin(readField(t, 3, 2)); + } + } catch (Exception e) { + throw new ParseException("The date '"+xDate+"' is not a valid Date Time Format at character "+java.lang.Integer.toString(offset), offset); + } + return res; + } + + public DateAndTime expandTime() { + time = true; + seconds = true; + timezone = true; + TimeZone tz = TimeZone.getDefault(); + + int offset = tz.getOffset(new java.util.Date().getTime()); + setOffsetMinutes(offset / (60 * 1000)); + return this; + } + + public String toHumanDisplay() { + if (isTime()) + return java.lang.Integer.toString(this.day)+"-"+this.getMonthCode()+" "+java.lang.Integer.toString(this.getYear()) +" "+java.lang.Integer.toString(this.hour)+":"+java.lang.Integer.toString(this.minute); + else + return java.lang.Integer.toString(this.day)+"-"+this.getMonthCode()+" "+java.lang.Integer.toString(this.getYear()); + } + + private String getMonthCode() { + switch (month) { + case 1: return "Jan"; + case 2: return "Feb"; + case 3: return "Mar"; + case 4: return "Apr"; + case 5: return "May"; + case 6: return "Jun"; + case 7: return "Jul"; + case 8: return "Aug"; + case 9: return "Sep"; + case 10: return "Oct"; + case 11: return "Nov"; + case 12: return "Dec"; + + } + return null; + } + + /** + * Add a duration to the DateAndTime. See documentation for Calendar.add + * + * @param field - Calendar constants for field + * @param value - value to add - can be positive or negative + * @throws Exception + */ + public void add(int field, int value) throws Exception { + switch (field) { + case Calendar.YEAR: + year = year + value; + break; + case Calendar.MONTH: + month = month + (value == 0 ? 1 : value); + while (month <= 0) { + add(Calendar.YEAR, -1); + month = month + 12; + } + while (month > 12) { + add(Calendar.YEAR, 1); + month = month - 12; + } + break; + case Calendar.DAY_OF_YEAR: + day = day + (value == 0 ? 1 : value); + while (day <= 0) { + add(Calendar.MONTH, -1); + day = day + daysInMonth(year, month); + } + int days = daysInMonth(year, month); + while (day > days) { + add(Calendar.MONTH, 1); + day = day - days; + days = daysInMonth(year, month); + } + break; + case Calendar.HOUR: + hour = hour + value; + time = true; + while (hour < 0) { + add(Calendar.DAY_OF_YEAR, -1); + hour = hour + 24; + } + while (hour >= 24) { + add(Calendar.DAY_OF_YEAR, 1); + hour = hour - 24; + } + break; + case Calendar.MINUTE: + minute = minute + value; + time = true; + while (minute < 0) { + add(Calendar.HOUR, -1); + minute = minute + 60; + } + while (minute >= 60) { + add(Calendar.HOUR, 1); + minute = minute - 60; + } + break; + case Calendar.SECOND: + second = second + value; + seconds = true; + while (second < 0) { + add(Calendar.MINUTE, -1); + second = second + 60; + } + while (second >= 60) { + add(Calendar.MINUTE, 1); + second = second - 60; + } + break; + default: + throw new Exception("Unknown field"); + } + } + + private int daysInMonth(int aYear, int aMonth) { + switch (aMonth) { + case 1: return 31; + case 2: return isleapYear(aYear) ? 29 : 28; + case 3: return 31; + case 4: return 30; + case 5: return 31; + case 6: return 30; + case 7: return 31; + case 8: return 31; + case 9: return 30; + case 10: return 31; + case 11: return 30; + case 12: return 31; + default: + throw new Error("illegal month "+java.lang.Integer.toString(aMonth)); + } + } + + private boolean isleapYear(int aYear) { + return (aYear % 4 == 0) && !((aYear % 100 == 0) && (aYear % 400 != 0)); + } + + public boolean before(DateAndTime other) { + + if(this.time && other.time) { + return toCalendar().getTimeInMillis() < other.toCalendar().getTimeInMillis(); + } else if (this.year != other.year) { + return this.year < other.year; + } else if (this.month != other.month) { + return this.month < other.month; + } else if (this.day != other.day) { + return this.day < other.day; + } else + return false; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java index 82b2e9ddda1..46087a14311 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java @@ -1,32 +1,32 @@ -/* -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. - -*/ - +/* +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. + +*/ + package org.hl7.fhir.instance.model; /* @@ -49,165 +49,165 @@ package org.hl7.fhir.instance.model; * #L% */ - -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: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ -@DatatypeDef(name = "dateTime") -public class DateTimeType extends BaseDateTimeType { - - private static final long serialVersionUID = 1L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND; - - /** - * Constructor - */ - public DateTimeType() { - super(); - } - - /** - * Create a new DateTimeDt with seconds precision and the local time zone - */ - public DateTimeType(Date theDate) { - super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); - } - - /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { - super(theDate, thePrecision, TimeZone.getDefault()); - } - - /** - * Create a new instance using a string date/time - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public DateTimeType(String theValue) { - super(theValue); - } - - /** - * Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type - * are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ - public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { - 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) { - case YEAR: - case MONTH: - case DAY: - case SECOND: - case MILLI: - return true; - default: - return false; - } - } - - /** - * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time - * zone - */ - public static DateTimeType now() { - return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - @Override - public DateTimeType copy() { - 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; - } - -} + +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: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ +@DatatypeDef(name = "dateTime") +public class DateTimeType extends BaseDateTimeType { + + private static final long serialVersionUID = 1L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND; + + /** + * Constructor + */ + public DateTimeType() { + super(); + } + + /** + * Create a new DateTimeDt with seconds precision and the local time zone + */ + public DateTimeType(Date theDate) { + super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { + super(theDate, thePrecision, TimeZone.getDefault()); + } + + /** + * Create a new instance using a string date/time + * + * @throws DataFormatException + * If the specified precision is not allowed for this type + */ + public DateTimeType(String theValue) { + super(theValue); + } + + /** + * Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type + * are: + *
    + *
  • {@link TemporalPrecisionEnum#YEAR} + *
  • {@link TemporalPrecisionEnum#MONTH} + *
  • {@link TemporalPrecisionEnum#DAY} + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ + public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { + 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) { + case YEAR: + case MONTH: + case DAY: + case SECOND: + case MILLI: + return true; + default: + return false; + } + } + + /** + * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time + * zone + */ + public static DateTimeType now() { + return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + @Override + public DateTimeType copy() { + 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; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java index 4d5dbbbfe87..79b1d6b708e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java @@ -1,32 +1,32 @@ -/* -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. - -*/ - +/* +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. + +*/ + package org.hl7.fhir.instance.model; /* @@ -49,96 +49,96 @@ package org.hl7.fhir.instance.model; * #L% */ - -/** - * Primitive type "date" in FHIR: any day in a gregorian calendar - */ - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -import java.util.Date; - -/** - * Represents a FHIR date datatype. Valid precisions values for this type are: - *
    - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} - *
- */ -@DatatypeDef(name = "date") -public class DateType extends BaseDateTimeType { - - private static final long serialVersionUID = 1L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY; - - /** - * Constructor - */ - public DateType() { - super(); - } - - /** - * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type - */ - public DateType(Date theDate) { - super(theDate, DEFAULT_PRECISION); - } - - /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: - *
    - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} - *
- * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the specified precision is not allowed for this type - */ - public DateType(Date theDate, TemporalPrecisionEnum thePrecision) { - super(theDate, thePrecision); - } - - /** - * Constructor which accepts a date as a string in FHIR format - * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the precision in the date string is not allowed for this type - */ - public DateType(String theDate) { - super(theDate); - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case YEAR: - case MONTH: - case DAY: - return true; - default: - return false; - } - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - @Override - public DateType copy() { - return new DateType(getValue()); - } -} + +/** + * Primitive type "date" in FHIR: any day in a gregorian calendar + */ + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +import java.util.Date; + +/** + * Represents a FHIR date datatype. Valid precisions values for this type are: + *
    + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} + *
+ */ +@DatatypeDef(name = "date") +public class DateType extends BaseDateTimeType { + + private static final long serialVersionUID = 1L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY; + + /** + * Constructor + */ + public DateType() { + super(); + } + + /** + * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type + */ + public DateType(Date theDate) { + super(theDate, DEFAULT_PRECISION); + } + + /** + * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: + *
    + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} + *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} + *
+ * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the specified precision is not allowed for this type + */ + public DateType(Date theDate, TemporalPrecisionEnum thePrecision) { + super(theDate, thePrecision); + } + + /** + * Constructor which accepts a date as a string in FHIR format + * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the precision in the date string is not allowed for this type + */ + public DateType(String theDate) { + super(theDate); + } + + @Override + boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { + switch (thePrecision) { + case YEAR: + case MONTH: + case DAY: + return true; + default: + return false; + } + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + @Override + public DateType copy() { + return new DateType(getValue()); + } +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java index 065bbd4aa46..2cbd97a7d78 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java @@ -1,34 +1,34 @@ -/* -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. - - */ -/** - * - */ +/* +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. + + */ +/** + * + */ package org.hl7.fhir.instance.model; /* @@ -51,128 +51,128 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "decimal" in FHIR: A rational number - */ -@DatatypeDef(name = "decimal") -public class DecimalType extends PrimitiveType implements Comparable { - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public DecimalType() { - super(); - } - - /** - * Constructor - */ - public DecimalType(BigDecimal theValue) { - setValue(theValue); - } - - /** - * Constructor - */ - public DecimalType(double theValue) { - // Use the valueOf here because the constructor gives wacky precision - // changes due to the floating point conversion - setValue(BigDecimal.valueOf(theValue)); - } - - /** - * Constructor - */ - public DecimalType(long theValue) { - setValue(new BigDecimal(theValue)); - } - - /** - * Constructor - */ - public DecimalType(String theValue) { - setValue(new BigDecimal(theValue)); - } - - @Override - public int compareTo(DecimalType theObj) { - if (getValue() == null && theObj.getValue() == null) { - return 0; - } - if (getValue() != null && theObj.getValue() == null) { - return 1; - } - if (getValue() == null && theObj.getValue() != null) { - return -1; - } - return getValue().compareTo(theObj.getValue()); - } - - @Override - protected String encode(BigDecimal theValue) { - return getValue().toPlainString(); - } - - /** - * Gets the value as an integer, using {@link BigDecimal#intValue()} - */ - public int getValueAsInteger() { - return getValue().intValue(); - } - - public Number getValueAsNumber() { - return getValue(); - } - - @Override - protected BigDecimal parse(String theValue) { - return new BigDecimal(theValue); - } - - /** - * Rounds the value to the given prevision - * - * @see MathContext#getPrecision() - */ - public void round(int thePrecision) { - if (getValue() != null) { - BigDecimal newValue = getValue().round(new MathContext(thePrecision)); - setValue(newValue); - } - } - - /** - * Rounds the value to the given prevision - * - * @see MathContext#getPrecision() - * @see MathContext#getRoundingMode() - */ - public void round(int thePrecision, RoundingMode theRoundingMode) { - if (getValue() != null) { - BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); - setValue(newValue); - } - } - - /** - * Sets a new value using an integer - */ - public void setValueAsInteger(int theValue) { - setValue(new BigDecimal(theValue)); - } - - @Override - public DecimalType copy() { - return new DecimalType(getValue()); - } - -} + +import java.math.BigDecimal; +import java.math.MathContext; +import java.math.RoundingMode; + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "decimal" in FHIR: A rational number + */ +@DatatypeDef(name = "decimal") +public class DecimalType extends PrimitiveType implements Comparable { + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public DecimalType() { + super(); + } + + /** + * Constructor + */ + public DecimalType(BigDecimal theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + public DecimalType(double theValue) { + // Use the valueOf here because the constructor gives wacky precision + // changes due to the floating point conversion + setValue(BigDecimal.valueOf(theValue)); + } + + /** + * Constructor + */ + public DecimalType(long theValue) { + setValue(new BigDecimal(theValue)); + } + + /** + * Constructor + */ + public DecimalType(String theValue) { + setValue(new BigDecimal(theValue)); + } + + @Override + public int compareTo(DecimalType theObj) { + if (getValue() == null && theObj.getValue() == null) { + return 0; + } + if (getValue() != null && theObj.getValue() == null) { + return 1; + } + if (getValue() == null && theObj.getValue() != null) { + return -1; + } + return getValue().compareTo(theObj.getValue()); + } + + @Override + protected String encode(BigDecimal theValue) { + return getValue().toPlainString(); + } + + /** + * Gets the value as an integer, using {@link BigDecimal#intValue()} + */ + public int getValueAsInteger() { + return getValue().intValue(); + } + + public Number getValueAsNumber() { + return getValue(); + } + + @Override + protected BigDecimal parse(String theValue) { + return new BigDecimal(theValue); + } + + /** + * Rounds the value to the given prevision + * + * @see MathContext#getPrecision() + */ + public void round(int thePrecision) { + if (getValue() != null) { + BigDecimal newValue = getValue().round(new MathContext(thePrecision)); + setValue(newValue); + } + } + + /** + * Rounds the value to the given prevision + * + * @see MathContext#getPrecision() + * @see MathContext#getRoundingMode() + */ + public void round(int thePrecision, RoundingMode theRoundingMode) { + if (getValue() != null) { + BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); + setValue(newValue); + } + } + + /** + * Sets a new value using an integer + */ + public void setValueAsInteger(int theValue) { + setValue(new BigDecimal(theValue)); + } + + @Override + public DecimalType copy() { + return new DecimalType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java index c105ef7e4d2..ebfc4ccfcd0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java @@ -20,806 +20,806 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. - */ -@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device") -public class Device extends DomainResource { - - /** - * Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Instance id from manufacturer, owner and others", formalDefinition="Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device." ) - protected List identifier; - - /** - * A kind of this device. - */ - @Child(name="type", type={CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="What kind of device this is", formalDefinition="A kind of this device." ) - protected CodeableConcept type; - - /** - * A name of the manufacturer. - */ - @Child(name="manufacturer", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) - protected StringType manufacturer; - - /** - * The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. - */ - @Child(name="model", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type." ) - protected StringType model; - - /** - * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - @Child(name="version", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Version number (i.e. software)", formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware." ) - protected StringType version; - - /** - * Date of expiry of this device (if applicable). - */ - @Child(name="expiry", type={DateType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Date of expiry of this device (if applicable)", formalDefinition="Date of expiry of this device (if applicable)." ) - protected DateType expiry; - - /** - * FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - */ - @Child(name="udi", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="FDA Mandated Unique Device Identifier", formalDefinition="FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm." ) - protected StringType udi; - - /** - * Lot number assigned by the manufacturer. - */ - @Child(name="lotNumber", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." ) - protected StringType lotNumber; - - /** - * An organization that is responsible for the provision and ongoing maintenance of the device. - */ - @Child(name="owner", type={Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) - protected Reference owner; - - /** - * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - protected Organization ownerTarget; - - /** - * The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location. - */ - @Child(name="location", type={Location.class}, order=8, min=0, max=1) - @Description(shortDefinition="Where the resource is found", formalDefinition="The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - protected Location locationTarget; - - /** - * Patient information, if the resource is affixed to a person. - */ - @Child(name="patient", type={Patient.class}, order=9, min=0, max=1) - @Description(shortDefinition="If the resource is affixed to a person", formalDefinition="Patient information, if the resource is affixed to a person." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient information, if the resource is affixed to a person.) - */ - protected Patient patientTarget; - - /** - * Contact details for an organization or a particular human that is responsible for the device. - */ - @Child(name="contact", type={ContactPoint.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) - protected List contact; - - /** - * A network address on which the device may be contacted directly. - */ - @Child(name="url", type={UriType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) - protected UriType url; - - private static final long serialVersionUID = 1190320903L; - - public Device() { - super(); - } - - public Device(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #type} (A kind of this device.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A kind of this device.) - */ - public Device setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value - */ - public StringType getManufacturerElement() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new StringType(); - return this.manufacturer; - } - - public boolean hasManufacturerElement() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value - */ - public Device setManufacturerElement(StringType value) { - this.manufacturer = value; - return this; - } - - /** - * @return A name of the manufacturer. - */ - public String getManufacturer() { - return this.manufacturer == null ? null : this.manufacturer.getValue(); - } - - /** - * @param value A name of the manufacturer. - */ - public Device setManufacturer(String value) { - if (Utilities.noString(value)) - this.manufacturer = null; - else { - if (this.manufacturer == null) - this.manufacturer = new StringType(); - this.manufacturer.setValue(value); - } - return this; - } - - /** - * @return {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value - */ - public StringType getModelElement() { - if (this.model == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.model"); - else if (Configuration.doAutoCreate()) - this.model = new StringType(); - return this.model; - } - - public boolean hasModelElement() { - return this.model != null && !this.model.isEmpty(); - } - - public boolean hasModel() { - return this.model != null && !this.model.isEmpty(); - } - - /** - * @param value {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value - */ - public Device setModelElement(StringType value) { - this.model = value; - return this; - } - - /** - * @return The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. - */ - public String getModel() { - return this.model == null ? null : this.model.getValue(); - } - - /** - * @param value The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. - */ - public Device setModel(String value) { - if (Utilities.noString(value)) - this.model = null; - else { - if (this.model == null) - this.model = new StringType(); - this.model.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Device setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - public Device setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #expiry} (Date of expiry of this device (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public DateType getExpiryElement() { - if (this.expiry == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.expiry"); - else if (Configuration.doAutoCreate()) - this.expiry = new DateType(); - return this.expiry; - } - - public boolean hasExpiryElement() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - public boolean hasExpiry() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - /** - * @param value {@link #expiry} (Date of expiry of this device (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public Device setExpiryElement(DateType value) { - this.expiry = value; - return this; - } - - /** - * @return Date of expiry of this device (if applicable). - */ - public Date getExpiry() { - return this.expiry == null ? null : this.expiry.getValue(); - } - - /** - * @param value Date of expiry of this device (if applicable). - */ - public Device setExpiry(Date value) { - if (value == null) - this.expiry = null; - else { - if (this.expiry == null) - this.expiry = new DateType(); - this.expiry.setValue(value); - } - return this; - } - - /** - * @return {@link #udi} (FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value - */ - public StringType getUdiElement() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new StringType(); - return this.udi; - } - - public boolean hasUdiElement() { - return this.udi != null && !this.udi.isEmpty(); - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value - */ - public Device setUdiElement(StringType value) { - this.udi = value; - return this; - } - - /** - * @return FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - */ - public String getUdi() { - return this.udi == null ? null : this.udi.getValue(); - } - - /** - * @param value FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - */ - public Device setUdi(String value) { - if (Utilities.noString(value)) - this.udi = null; - else { - if (this.udi == null) - this.udi = new StringType(); - this.udi.setValue(value); - } - return this; - } - - /** - * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public Device setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return Lot number assigned by the manufacturer. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value Lot number assigned by the manufacturer. - */ - public Device setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Reference getOwner() { - if (this.owner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.owner"); - else if (Configuration.doAutoCreate()) - this.owner = new Reference(); - return this.owner; - } - - public boolean hasOwner() { - return this.owner != null && !this.owner.isEmpty(); - } - - /** - * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Device setOwner(Reference value) { - this.owner = value; - return this; - } - - /** - * @return {@link #owner} 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. (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Organization getOwnerTarget() { - if (this.ownerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.owner"); - else if (Configuration.doAutoCreate()) - this.ownerTarget = new Organization(); - return this.ownerTarget; - } - - /** - * @param value {@link #owner} 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. (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Device setOwnerTarget(Organization value) { - this.ownerTarget = value; - return this; - } - - /** - * @return {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Device setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) - */ - public Device setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #patient} (Patient information, if the resource is affixed to a person.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.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} (Patient information, if the resource is affixed to a person.) - */ - public Device 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. (Patient information, if the resource is affixed to a person.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.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. (Patient information, if the resource is affixed to a person.) - */ - public Device setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactPoint item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) - */ - // syntactic sugar - public ContactPoint addContact() { //3 - ContactPoint t = new ContactPoint(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - /** - * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Device setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return A network address on which the device may be contacted directly. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value A network address on which the device may be contacted directly. - */ - public Device setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "A kind of this device.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("model", "string", "The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.", 0, java.lang.Integer.MAX_VALUE, model)); - childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("expiry", "date", "Date of expiry of this device (if applicable).", 0, java.lang.Integer.MAX_VALUE, expiry)); - childrenList.add(new Property("udi", "string", "FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner)); - childrenList.add(new Property("location", "Reference(Location)", "The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, if the resource is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - public Device copy() { - Device dst = new Device(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.model = model == null ? null : model.copy(); - dst.version = version == null ? null : version.copy(); - dst.expiry = expiry == null ? null : expiry.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.owner = owner == null ? null : owner.copy(); - dst.location = location == null ? null : location.copy(); - dst.patient = patient == null ? null : patient.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactPoint i : contact) - dst.contact.add(i.copy()); - }; - dst.url = url == null ? null : url.copy(); - return dst; - } - - protected Device typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (manufacturer == null || manufacturer.isEmpty()) && (model == null || model.isEmpty()) - && (version == null || version.isEmpty()) && (expiry == null || expiry.isEmpty()) && (udi == null || udi.isEmpty()) - && (lotNumber == null || lotNumber.isEmpty()) && (owner == null || owner.isEmpty()) && (location == null || location.isEmpty()) - && (patient == null || patient.isEmpty()) && (contact == null || contact.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Device; - } - - @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" ) - public static final String SP_MODEL = "model"; - @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" ) - public static final String SP_MANUFACTURER = "manufacturer"; - @SearchParamDefinition(name="udi", path="Device.udi", description="FDA Mandated Unique Device Identifier", type="string" ) - public static final String SP_UDI = "udi"; - @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner and others", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. + */ +@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device") +public class Device extends DomainResource { + + /** + * Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Instance id from manufacturer, owner and others", formalDefinition="Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device." ) + protected List identifier; + + /** + * A kind of this device. + */ + @Child(name="type", type={CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="What kind of device this is", formalDefinition="A kind of this device." ) + protected CodeableConcept type; + + /** + * A name of the manufacturer. + */ + @Child(name="manufacturer", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) + protected StringType manufacturer; + + /** + * The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + @Child(name="model", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type." ) + protected StringType model; + + /** + * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + @Child(name="version", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Version number (i.e. software)", formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware." ) + protected StringType version; + + /** + * Date of expiry of this device (if applicable). + */ + @Child(name="expiry", type={DateType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Date of expiry of this device (if applicable)", formalDefinition="Date of expiry of this device (if applicable)." ) + protected DateType expiry; + + /** + * FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + */ + @Child(name="udi", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="FDA Mandated Unique Device Identifier", formalDefinition="FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm." ) + protected StringType udi; + + /** + * Lot number assigned by the manufacturer. + */ + @Child(name="lotNumber", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." ) + protected StringType lotNumber; + + /** + * An organization that is responsible for the provision and ongoing maintenance of the device. + */ + @Child(name="owner", type={Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) + protected Reference owner; + + /** + * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + protected Organization ownerTarget; + + /** + * The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location. + */ + @Child(name="location", type={Location.class}, order=8, min=0, max=1) + @Description(shortDefinition="Where the resource is found", formalDefinition="The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + protected Location locationTarget; + + /** + * Patient information, if the resource is affixed to a person. + */ + @Child(name="patient", type={Patient.class}, order=9, min=0, max=1) + @Description(shortDefinition="If the resource is affixed to a person", formalDefinition="Patient information, if the resource is affixed to a person." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient information, if the resource is affixed to a person.) + */ + protected Patient patientTarget; + + /** + * Contact details for an organization or a particular human that is responsible for the device. + */ + @Child(name="contact", type={ContactPoint.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) + protected List contact; + + /** + * A network address on which the device may be contacted directly. + */ + @Child(name="url", type={UriType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) + protected UriType url; + + private static final long serialVersionUID = 1190320903L; + + public Device() { + super(); + } + + public Device(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #type} (A kind of this device.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A kind of this device.) + */ + public Device setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value + */ + public StringType getManufacturerElement() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new StringType(); + return this.manufacturer; + } + + public boolean hasManufacturerElement() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value + */ + public Device setManufacturerElement(StringType value) { + this.manufacturer = value; + return this; + } + + /** + * @return A name of the manufacturer. + */ + public String getManufacturer() { + return this.manufacturer == null ? null : this.manufacturer.getValue(); + } + + /** + * @param value A name of the manufacturer. + */ + public Device setManufacturer(String value) { + if (Utilities.noString(value)) + this.manufacturer = null; + else { + if (this.manufacturer == null) + this.manufacturer = new StringType(); + this.manufacturer.setValue(value); + } + return this; + } + + /** + * @return {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value + */ + public StringType getModelElement() { + if (this.model == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.model"); + else if (Configuration.doAutoCreate()) + this.model = new StringType(); + return this.model; + } + + public boolean hasModelElement() { + return this.model != null && !this.model.isEmpty(); + } + + public boolean hasModel() { + return this.model != null && !this.model.isEmpty(); + } + + /** + * @param value {@link #model} (The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value + */ + public Device setModelElement(StringType value) { + this.model = value; + return this; + } + + /** + * @return The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + public String getModel() { + return this.model == null ? null : this.model.getValue(); + } + + /** + * @param value The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + */ + public Device setModel(String value) { + if (Utilities.noString(value)) + this.model = null; + else { + if (this.model == null) + this.model = new StringType(); + this.model.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Device setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + */ + public Device setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #expiry} (Date of expiry of this device (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public DateType getExpiryElement() { + if (this.expiry == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.expiry"); + else if (Configuration.doAutoCreate()) + this.expiry = new DateType(); + return this.expiry; + } + + public boolean hasExpiryElement() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + public boolean hasExpiry() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + /** + * @param value {@link #expiry} (Date of expiry of this device (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public Device setExpiryElement(DateType value) { + this.expiry = value; + return this; + } + + /** + * @return Date of expiry of this device (if applicable). + */ + public Date getExpiry() { + return this.expiry == null ? null : this.expiry.getValue(); + } + + /** + * @param value Date of expiry of this device (if applicable). + */ + public Device setExpiry(Date value) { + if (value == null) + this.expiry = null; + else { + if (this.expiry == null) + this.expiry = new DateType(); + this.expiry.setValue(value); + } + return this; + } + + /** + * @return {@link #udi} (FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value + */ + public StringType getUdiElement() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new StringType(); + return this.udi; + } + + public boolean hasUdiElement() { + return this.udi != null && !this.udi.isEmpty(); + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value + */ + public Device setUdiElement(StringType value) { + this.udi = value; + return this; + } + + /** + * @return FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + */ + public String getUdi() { + return this.udi == null ? null : this.udi.getValue(); + } + + /** + * @param value FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + */ + public Device setUdi(String value) { + if (Utilities.noString(value)) + this.udi = null; + else { + if (this.udi == null) + this.udi = new StringType(); + this.udi.setValue(value); + } + return this; + } + + /** + * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public Device setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return Lot number assigned by the manufacturer. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value Lot number assigned by the manufacturer. + */ + public Device setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Reference getOwner() { + if (this.owner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.owner"); + else if (Configuration.doAutoCreate()) + this.owner = new Reference(); + return this.owner; + } + + public boolean hasOwner() { + return this.owner != null && !this.owner.isEmpty(); + } + + /** + * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Device setOwner(Reference value) { + this.owner = value; + return this; + } + + /** + * @return {@link #owner} 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. (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Organization getOwnerTarget() { + if (this.ownerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.owner"); + else if (Configuration.doAutoCreate()) + this.ownerTarget = new Organization(); + return this.ownerTarget; + } + + /** + * @param value {@link #owner} 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. (An organization that is responsible for the provision and ongoing maintenance of the device.) + */ + public Device setOwnerTarget(Organization value) { + this.ownerTarget = value; + return this; + } + + /** + * @return {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Device setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location.) + */ + public Device setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #patient} (Patient information, if the resource is affixed to a person.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.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} (Patient information, if the resource is affixed to a person.) + */ + public Device 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. (Patient information, if the resource is affixed to a person.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.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. (Patient information, if the resource is affixed to a person.) + */ + public Device setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactPoint item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) + */ + // syntactic sugar + public ContactPoint addContact() { //3 + ContactPoint t = new ContactPoint(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + /** + * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Device.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Device setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return A network address on which the device may be contacted directly. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value A network address on which the device may be contacted directly. + */ + public Device setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "A kind of this device.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("model", "string", "The 'model' - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.", 0, java.lang.Integer.MAX_VALUE, model)); + childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("expiry", "date", "Date of expiry of this device (if applicable).", 0, java.lang.Integer.MAX_VALUE, expiry)); + childrenList.add(new Property("udi", "string", "FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner)); + childrenList.add(new Property("location", "Reference(Location)", "The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. 'in/with the patient'), or a coded location.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, if the resource is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url)); + } + + public Device copy() { + Device dst = new Device(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.model = model == null ? null : model.copy(); + dst.version = version == null ? null : version.copy(); + dst.expiry = expiry == null ? null : expiry.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.owner = owner == null ? null : owner.copy(); + dst.location = location == null ? null : location.copy(); + dst.patient = patient == null ? null : patient.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactPoint i : contact) + dst.contact.add(i.copy()); + }; + dst.url = url == null ? null : url.copy(); + return dst; + } + + protected Device typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (manufacturer == null || manufacturer.isEmpty()) && (model == null || model.isEmpty()) + && (version == null || version.isEmpty()) && (expiry == null || expiry.isEmpty()) && (udi == null || udi.isEmpty()) + && (lotNumber == null || lotNumber.isEmpty()) && (owner == null || owner.isEmpty()) && (location == null || location.isEmpty()) + && (patient == null || patient.isEmpty()) && (contact == null || contact.isEmpty()) && (url == null || url.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Device; + } + + @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" ) + public static final String SP_MODEL = "model"; + @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" ) + public static final String SP_MANUFACTURER = "manufacturer"; + @SearchParamDefinition(name="udi", path="Device.udi", description="FDA Mandated Unique Device Identifier", type="string" ) + public static final String SP_UDI = "udi"; + @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner and others", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java index 32692a3c096..a1243a9cae8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java @@ -20,896 +20,896 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 characteristics, operational status and capabilities of a medical-related component of a medical device. - */ -@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") -public class DeviceComponent extends DomainResource { - - public enum MeasurementPrinciple implements FhirEnum { - /** - * Measurement principle isn't in the list. - */ - OTHER, - /** - * Measurement is done using chemical. - */ - CHEMICAL, - /** - * Measurement is done using electrical. - */ - ELECTRICAL, - /** - * Measurement is done using impedance. - */ - IMPEDANCE, - /** - * Measurement is done using nuclear. - */ - NUCLEAR, - /** - * Measurement is done using optical. - */ - OPTICAL, - /** - * Measurement is done using thermal. - */ - THERMAL, - /** - * Measurement is done using biological. - */ - BIOLOGICAL, - /** - * Measurement is done using mechanical. - */ - MECHANICAL, - /** - * Measurement is done using acoustical. - */ - ACOUSTICAL, - /** - * Measurement is done using manual. - */ - MANUAL, - /** - * added to help the parsers - */ - NULL; - - 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)) - return OTHER; - if ("chemical".equals(codeString)) - return CHEMICAL; - if ("electrical".equals(codeString)) - return ELECTRICAL; - if ("impedance".equals(codeString)) - return IMPEDANCE; - if ("nuclear".equals(codeString)) - return NUCLEAR; - if ("optical".equals(codeString)) - return OPTICAL; - if ("thermal".equals(codeString)) - return THERMAL; - if ("biological".equals(codeString)) - return BIOLOGICAL; - if ("mechanical".equals(codeString)) - return MECHANICAL; - if ("acoustical".equals(codeString)) - return ACOUSTICAL; - if ("manual".equals(codeString)) - return MANUAL; - throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case OTHER: return "other"; - case CHEMICAL: return "chemical"; - case ELECTRICAL: return "electrical"; - case IMPEDANCE: return "impedance"; - case NUCLEAR: return "nuclear"; - case OPTICAL: return "optical"; - case THERMAL: return "thermal"; - case BIOLOGICAL: return "biological"; - case MECHANICAL: return "mechanical"; - case ACOUSTICAL: return "acoustical"; - case MANUAL: return "manual"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OTHER: return ""; - case CHEMICAL: return ""; - case ELECTRICAL: return ""; - case IMPEDANCE: return ""; - case NUCLEAR: return ""; - case OPTICAL: return ""; - case THERMAL: return ""; - case BIOLOGICAL: return ""; - case MECHANICAL: return ""; - case ACOUSTICAL: return ""; - case MANUAL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OTHER: return "Measurement principle isn't in the list."; - case CHEMICAL: return "Measurement is done using chemical."; - case ELECTRICAL: return "Measurement is done using electrical."; - case IMPEDANCE: return "Measurement is done using impedance."; - case NUCLEAR: return "Measurement is done using nuclear."; - case OPTICAL: return "Measurement is done using optical."; - case THERMAL: return "Measurement is done using thermal."; - case BIOLOGICAL: return "Measurement is done using biological."; - case MECHANICAL: return "Measurement is done using mechanical."; - case ACOUSTICAL: return "Measurement is done using acoustical."; - case MANUAL: return "Measurement is done using manual."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OTHER: return "msp-other"; - case CHEMICAL: return "msp-chemical"; - case ELECTRICAL: return "msp-electrical"; - case IMPEDANCE: return "msp-impedance"; - case NUCLEAR: return "msp-nuclear"; - case OPTICAL: return "msp-optical"; - case THERMAL: return "msp-thermal"; - case BIOLOGICAL: return "msp-biological"; - case MECHANICAL: return "msp-mechanical"; - case ACOUSTICAL: return "msp-acoustical"; - case MANUAL: return "msp-manual"; - default: return "?"; - } - } - } - - public static class MeasurementPrincipleEnumFactory implements EnumFactory { - public MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("other".equals(codeString)) - return MeasurementPrinciple.OTHER; - if ("chemical".equals(codeString)) - return MeasurementPrinciple.CHEMICAL; - if ("electrical".equals(codeString)) - return MeasurementPrinciple.ELECTRICAL; - if ("impedance".equals(codeString)) - return MeasurementPrinciple.IMPEDANCE; - if ("nuclear".equals(codeString)) - return MeasurementPrinciple.NUCLEAR; - if ("optical".equals(codeString)) - return MeasurementPrinciple.OPTICAL; - if ("thermal".equals(codeString)) - return MeasurementPrinciple.THERMAL; - if ("biological".equals(codeString)) - return MeasurementPrinciple.BIOLOGICAL; - if ("mechanical".equals(codeString)) - return MeasurementPrinciple.MECHANICAL; - if ("acoustical".equals(codeString)) - return MeasurementPrinciple.ACOUSTICAL; - if ("manual".equals(codeString)) - return MeasurementPrinciple.MANUAL; - throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); - } - public String toCode(MeasurementPrinciple code) throws IllegalArgumentException { - if (code == MeasurementPrinciple.OTHER) - return "other"; - if (code == MeasurementPrinciple.CHEMICAL) - return "chemical"; - if (code == MeasurementPrinciple.ELECTRICAL) - return "electrical"; - if (code == MeasurementPrinciple.IMPEDANCE) - return "impedance"; - if (code == MeasurementPrinciple.NUCLEAR) - return "nuclear"; - if (code == MeasurementPrinciple.OPTICAL) - return "optical"; - if (code == MeasurementPrinciple.THERMAL) - return "thermal"; - if (code == MeasurementPrinciple.BIOLOGICAL) - return "biological"; - if (code == MeasurementPrinciple.MECHANICAL) - return "mechanical"; - if (code == MeasurementPrinciple.ACOUSTICAL) - return "acoustical"; - if (code == MeasurementPrinciple.MANUAL) - return "manual"; - return "?"; - } - } - - @Block() - public static class DeviceComponentProductionSpecificationComponent extends BackboneElement { - /** - * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. - */ - @Child(name="specType", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." ) - protected CodeableConcept specType; - - /** - * Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. - */ - @Child(name="componentId", type={Identifier.class}, order=2, min=0, max=1) - @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of." ) - protected Identifier componentId; - - /** - * Describes the printable string defining the component. - */ - @Child(name="productionSpec", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." ) - protected StringType productionSpec; - - private static final long serialVersionUID = -1476597516L; - - public DeviceComponentProductionSpecificationComponent() { - super(); - } - - /** - * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) - */ - public CodeableConcept getSpecType() { - if (this.specType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); - else if (Configuration.doAutoCreate()) - this.specType = new CodeableConcept(); - return this.specType; - } - - public boolean hasSpecType() { - return this.specType != null && !this.specType.isEmpty(); - } - - /** - * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) - */ - public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { - this.specType = value; - return this; - } - - /** - * @return {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) - */ - public Identifier getComponentId() { - if (this.componentId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); - else if (Configuration.doAutoCreate()) - this.componentId = new Identifier(); - return this.componentId; - } - - public boolean hasComponentId() { - return this.componentId != null && !this.componentId.isEmpty(); - } - - /** - * @param value {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) - */ - public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { - this.componentId = value; - return this; - } - - /** - * @return {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value - */ - public StringType getProductionSpecElement() { - if (this.productionSpec == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); - else if (Configuration.doAutoCreate()) - this.productionSpec = new StringType(); - return this.productionSpec; - } - - public boolean hasProductionSpecElement() { - return this.productionSpec != null && !this.productionSpec.isEmpty(); - } - - public boolean hasProductionSpec() { - return this.productionSpec != null && !this.productionSpec.isEmpty(); - } - - /** - * @param value {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value - */ - public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { - this.productionSpec = value; - return this; - } - - /** - * @return Describes the printable string defining the component. - */ - public String getProductionSpec() { - return this.productionSpec == null ? null : this.productionSpec.getValue(); - } - - /** - * @param value Describes the printable string defining the component. - */ - public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { - if (Utilities.noString(value)) - this.productionSpec = null; - else { - if (this.productionSpec == null) - this.productionSpec = new StringType(); - this.productionSpec.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType)); - childrenList.add(new Property("componentId", "Identifier", "Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId)); - childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec)); - } - - public DeviceComponentProductionSpecificationComponent copy() { - DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); - copyValues(dst); - dst.specType = specType == null ? null : specType.copy(); - dst.componentId = componentId == null ? null : componentId.copy(); - dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty()) - && (productionSpec == null || productionSpec.isEmpty()); - } - - } - - /** - * Describes the specific component type as defined in the object-oriented or metric nomenclature partition. - */ - @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) - @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." ) - protected CodeableConcept type; - - /** - * Describes the local assigned unique identification by the software. For example: handle ID. - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=1, max=1) - @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." ) - protected Identifier identifier; - - /** - * Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - @Child(name="lastSystemChange", type={InstantType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." ) - protected InstantType lastSystemChange; - - /** - * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. - */ - @Child(name="source", type={Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - protected Device sourceTarget; - - /** - * Describes the link to the parent resource. For example: Channel is linked to its VMD parent. - */ - @Child(name="parent", type={DeviceComponent.class}, order=3, min=0, max=1) - @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." ) - protected Reference parent; - - /** - * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - protected DeviceComponent parentTarget; - - /** - * Indicates current operational status of the device. For example: On, Off, Standby, etc. - */ - @Child(name="operationalStatus", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." ) - protected List operationalStatus; - - /** - * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular. - */ - @Child(name="parameterGroup", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular." ) - protected CodeableConcept parameterGroup; - - /** - * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - @Child(name="measurementPrinciple", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) - protected Enumeration measurementPrinciple; - - /** - * Describes the production specification such as component revision, serial number, etc. - */ - @Child(name="productionSpecification", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." ) - protected List productionSpecification; - - /** - * Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. - */ - @Child(name="languageCode", type={CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) - protected CodeableConcept languageCode; - - private static final long serialVersionUID = 1179239259L; - - public DeviceComponent() { - super(); - } - - public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) { - super(); - this.type = type; - this.identifier = identifier; - this.lastSystemChange = lastSystemChange; - } - - /** - * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) - */ - public DeviceComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) - */ - public DeviceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value - */ - public InstantType getLastSystemChangeElement() { - if (this.lastSystemChange == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); - else if (Configuration.doAutoCreate()) - this.lastSystemChange = new InstantType(); - return this.lastSystemChange; - } - - public boolean hasLastSystemChangeElement() { - return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); - } - - public boolean hasLastSystemChange() { - return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); - } - - /** - * @param value {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value - */ - public DeviceComponent setLastSystemChangeElement(InstantType value) { - this.lastSystemChange = value; - return this; - } - - /** - * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - 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(Date value) { - if (this.lastSystemChange == null) - this.lastSystemChange = new InstantType(); - this.lastSystemChange.setValue(value); - return this; - } - - /** - * @return {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceComponent setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} 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. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public Device getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Device(); - return this.sourceTarget; - } - - /** - * @param value {@link #source} 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. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceComponent setSourceTarget(Device value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** - * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent setParent(Reference value) { - this.parent = value; - return this; - } - - /** - * @return {@link #parent} 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. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new DeviceComponent(); - return this.parentTarget; - } - - /** - * @param value {@link #parent} 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. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent setParentTarget(DeviceComponent value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) - */ - public List getOperationalStatus() { - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - return this.operationalStatus; - } - - public boolean hasOperationalStatus() { - if (this.operationalStatus == null) - return false; - for (CodeableConcept item : this.operationalStatus) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) - */ - // syntactic sugar - public CodeableConcept addOperationalStatus() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - this.operationalStatus.add(t); - return t; - } - - /** - * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) - */ - public CodeableConcept getParameterGroup() { - if (this.parameterGroup == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); - else if (Configuration.doAutoCreate()) - this.parameterGroup = new CodeableConcept(); - return this.parameterGroup; - } - - public boolean hasParameterGroup() { - return this.parameterGroup != null && !this.parameterGroup.isEmpty(); - } - - /** - * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) - */ - public DeviceComponent setParameterGroup(CodeableConcept value) { - this.parameterGroup = value; - return this; - } - - /** - * @return {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value - */ - public Enumeration getMeasurementPrincipleElement() { - if (this.measurementPrinciple == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); - else if (Configuration.doAutoCreate()) - this.measurementPrinciple = new Enumeration(); - return this.measurementPrinciple; - } - - public boolean hasMeasurementPrincipleElement() { - return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); - } - - public boolean hasMeasurementPrinciple() { - return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); - } - - /** - * @param value {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value - */ - public DeviceComponent setMeasurementPrincipleElement(Enumeration value) { - this.measurementPrinciple = value; - return this; - } - - /** - * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - public MeasurementPrinciple getMeasurementPrinciple() { - return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); - } - - /** - * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - public DeviceComponent setMeasurementPrinciple(MeasurementPrinciple value) { - if (value == null) - this.measurementPrinciple = null; - else { - if (this.measurementPrinciple == null) - this.measurementPrinciple = new Enumeration(MeasurementPrinciple.ENUM_FACTORY); - this.measurementPrinciple.setValue(value); - } - return this; - } - - /** - * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) - */ - public List getProductionSpecification() { - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - return this.productionSpecification; - } - - public boolean hasProductionSpecification() { - if (this.productionSpecification == null) - return false; - for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) - */ - // syntactic sugar - public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 - DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - this.productionSpecification.add(t); - return t; - } - - /** - * @return {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) - */ - public CodeableConcept getLanguageCode() { - if (this.languageCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.languageCode"); - else if (Configuration.doAutoCreate()) - this.languageCode = new CodeableConcept(); - return this.languageCode; - } - - public boolean hasLanguageCode() { - return this.languageCode != null && !this.languageCode.isEmpty(); - } - - /** - * @param value {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) - */ - public DeviceComponent setLanguageCode(CodeableConcept value) { - this.languageCode = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange)); - childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); - childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup)); - childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple)); - childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); - childrenList.add(new Property("languageCode", "CodeableConcept", "Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, java.lang.Integer.MAX_VALUE, languageCode)); - } - - public DeviceComponent copy() { - DeviceComponent dst = new DeviceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); - dst.source = source == null ? null : source.copy(); - dst.parent = parent == null ? null : parent.copy(); - if (operationalStatus != null) { - dst.operationalStatus = new ArrayList(); - for (CodeableConcept i : operationalStatus) - dst.operationalStatus.add(i.copy()); - }; - dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); - dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); - if (productionSpecification != null) { - dst.productionSpecification = new ArrayList(); - for (DeviceComponentProductionSpecificationComponent i : productionSpecification) - dst.productionSpecification.add(i.copy()); - }; - dst.languageCode = languageCode == null ? null : languageCode.copy(); - return dst; - } - - protected DeviceComponent typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty()) - && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty()) - && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty()) - && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceComponent; - } - - @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" ) - public static final String SP_PARENT = "parent"; - @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" ) - public static final String SP_TYPE = "type"; - -} - + +/* + 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 characteristics, operational status and capabilities of a medical-related component of a medical device. + */ +@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") +public class DeviceComponent extends DomainResource { + + public enum MeasurementPrinciple implements FhirEnum { + /** + * Measurement principle isn't in the list. + */ + OTHER, + /** + * Measurement is done using chemical. + */ + CHEMICAL, + /** + * Measurement is done using electrical. + */ + ELECTRICAL, + /** + * Measurement is done using impedance. + */ + IMPEDANCE, + /** + * Measurement is done using nuclear. + */ + NUCLEAR, + /** + * Measurement is done using optical. + */ + OPTICAL, + /** + * Measurement is done using thermal. + */ + THERMAL, + /** + * Measurement is done using biological. + */ + BIOLOGICAL, + /** + * Measurement is done using mechanical. + */ + MECHANICAL, + /** + * Measurement is done using acoustical. + */ + ACOUSTICAL, + /** + * Measurement is done using manual. + */ + MANUAL, + /** + * added to help the parsers + */ + NULL; + + 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)) + return OTHER; + if ("chemical".equals(codeString)) + return CHEMICAL; + if ("electrical".equals(codeString)) + return ELECTRICAL; + if ("impedance".equals(codeString)) + return IMPEDANCE; + if ("nuclear".equals(codeString)) + return NUCLEAR; + if ("optical".equals(codeString)) + return OPTICAL; + if ("thermal".equals(codeString)) + return THERMAL; + if ("biological".equals(codeString)) + return BIOLOGICAL; + if ("mechanical".equals(codeString)) + return MECHANICAL; + if ("acoustical".equals(codeString)) + return ACOUSTICAL; + if ("manual".equals(codeString)) + return MANUAL; + throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case OTHER: return "other"; + case CHEMICAL: return "chemical"; + case ELECTRICAL: return "electrical"; + case IMPEDANCE: return "impedance"; + case NUCLEAR: return "nuclear"; + case OPTICAL: return "optical"; + case THERMAL: return "thermal"; + case BIOLOGICAL: return "biological"; + case MECHANICAL: return "mechanical"; + case ACOUSTICAL: return "acoustical"; + case MANUAL: return "manual"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OTHER: return ""; + case CHEMICAL: return ""; + case ELECTRICAL: return ""; + case IMPEDANCE: return ""; + case NUCLEAR: return ""; + case OPTICAL: return ""; + case THERMAL: return ""; + case BIOLOGICAL: return ""; + case MECHANICAL: return ""; + case ACOUSTICAL: return ""; + case MANUAL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OTHER: return "Measurement principle isn't in the list."; + case CHEMICAL: return "Measurement is done using chemical."; + case ELECTRICAL: return "Measurement is done using electrical."; + case IMPEDANCE: return "Measurement is done using impedance."; + case NUCLEAR: return "Measurement is done using nuclear."; + case OPTICAL: return "Measurement is done using optical."; + case THERMAL: return "Measurement is done using thermal."; + case BIOLOGICAL: return "Measurement is done using biological."; + case MECHANICAL: return "Measurement is done using mechanical."; + case ACOUSTICAL: return "Measurement is done using acoustical."; + case MANUAL: return "Measurement is done using manual."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OTHER: return "msp-other"; + case CHEMICAL: return "msp-chemical"; + case ELECTRICAL: return "msp-electrical"; + case IMPEDANCE: return "msp-impedance"; + case NUCLEAR: return "msp-nuclear"; + case OPTICAL: return "msp-optical"; + case THERMAL: return "msp-thermal"; + case BIOLOGICAL: return "msp-biological"; + case MECHANICAL: return "msp-mechanical"; + case ACOUSTICAL: return "msp-acoustical"; + case MANUAL: return "msp-manual"; + default: return "?"; + } + } + } + + public static class MeasurementPrincipleEnumFactory implements EnumFactory { + public MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("other".equals(codeString)) + return MeasurementPrinciple.OTHER; + if ("chemical".equals(codeString)) + return MeasurementPrinciple.CHEMICAL; + if ("electrical".equals(codeString)) + return MeasurementPrinciple.ELECTRICAL; + if ("impedance".equals(codeString)) + return MeasurementPrinciple.IMPEDANCE; + if ("nuclear".equals(codeString)) + return MeasurementPrinciple.NUCLEAR; + if ("optical".equals(codeString)) + return MeasurementPrinciple.OPTICAL; + if ("thermal".equals(codeString)) + return MeasurementPrinciple.THERMAL; + if ("biological".equals(codeString)) + return MeasurementPrinciple.BIOLOGICAL; + if ("mechanical".equals(codeString)) + return MeasurementPrinciple.MECHANICAL; + if ("acoustical".equals(codeString)) + return MeasurementPrinciple.ACOUSTICAL; + if ("manual".equals(codeString)) + return MeasurementPrinciple.MANUAL; + throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); + } + public String toCode(MeasurementPrinciple code) throws IllegalArgumentException { + if (code == MeasurementPrinciple.OTHER) + return "other"; + if (code == MeasurementPrinciple.CHEMICAL) + return "chemical"; + if (code == MeasurementPrinciple.ELECTRICAL) + return "electrical"; + if (code == MeasurementPrinciple.IMPEDANCE) + return "impedance"; + if (code == MeasurementPrinciple.NUCLEAR) + return "nuclear"; + if (code == MeasurementPrinciple.OPTICAL) + return "optical"; + if (code == MeasurementPrinciple.THERMAL) + return "thermal"; + if (code == MeasurementPrinciple.BIOLOGICAL) + return "biological"; + if (code == MeasurementPrinciple.MECHANICAL) + return "mechanical"; + if (code == MeasurementPrinciple.ACOUSTICAL) + return "acoustical"; + if (code == MeasurementPrinciple.MANUAL) + return "manual"; + return "?"; + } + } + + @Block() + public static class DeviceComponentProductionSpecificationComponent extends BackboneElement { + /** + * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. + */ + @Child(name="specType", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." ) + protected CodeableConcept specType; + + /** + * Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. + */ + @Child(name="componentId", type={Identifier.class}, order=2, min=0, max=1) + @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of." ) + protected Identifier componentId; + + /** + * Describes the printable string defining the component. + */ + @Child(name="productionSpec", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." ) + protected StringType productionSpec; + + private static final long serialVersionUID = -1476597516L; + + public DeviceComponentProductionSpecificationComponent() { + super(); + } + + /** + * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) + */ + public CodeableConcept getSpecType() { + if (this.specType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); + else if (Configuration.doAutoCreate()) + this.specType = new CodeableConcept(); + return this.specType; + } + + public boolean hasSpecType() { + return this.specType != null && !this.specType.isEmpty(); + } + + /** + * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) + */ + public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { + this.specType = value; + return this; + } + + /** + * @return {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) + */ + public Identifier getComponentId() { + if (this.componentId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); + else if (Configuration.doAutoCreate()) + this.componentId = new Identifier(); + return this.componentId; + } + + public boolean hasComponentId() { + return this.componentId != null && !this.componentId.isEmpty(); + } + + /** + * @param value {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) + */ + public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { + this.componentId = value; + return this; + } + + /** + * @return {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value + */ + public StringType getProductionSpecElement() { + if (this.productionSpec == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); + else if (Configuration.doAutoCreate()) + this.productionSpec = new StringType(); + return this.productionSpec; + } + + public boolean hasProductionSpecElement() { + return this.productionSpec != null && !this.productionSpec.isEmpty(); + } + + public boolean hasProductionSpec() { + return this.productionSpec != null && !this.productionSpec.isEmpty(); + } + + /** + * @param value {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value + */ + public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { + this.productionSpec = value; + return this; + } + + /** + * @return Describes the printable string defining the component. + */ + public String getProductionSpec() { + return this.productionSpec == null ? null : this.productionSpec.getValue(); + } + + /** + * @param value Describes the printable string defining the component. + */ + public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { + if (Utilities.noString(value)) + this.productionSpec = null; + else { + if (this.productionSpec == null) + this.productionSpec = new StringType(); + this.productionSpec.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType)); + childrenList.add(new Property("componentId", "Identifier", "Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId)); + childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec)); + } + + public DeviceComponentProductionSpecificationComponent copy() { + DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); + copyValues(dst); + dst.specType = specType == null ? null : specType.copy(); + dst.componentId = componentId == null ? null : componentId.copy(); + dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty()) + && (productionSpec == null || productionSpec.isEmpty()); + } + + } + + /** + * Describes the specific component type as defined in the object-oriented or metric nomenclature partition. + */ + @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) + @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." ) + protected CodeableConcept type; + + /** + * Describes the local assigned unique identification by the software. For example: handle ID. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=1, max=1) + @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." ) + protected Identifier identifier; + + /** + * Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + @Child(name="lastSystemChange", type={InstantType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." ) + protected InstantType lastSystemChange; + + /** + * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. + */ + @Child(name="source", type={Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + protected Device sourceTarget; + + /** + * Describes the link to the parent resource. For example: Channel is linked to its VMD parent. + */ + @Child(name="parent", type={DeviceComponent.class}, order=3, min=0, max=1) + @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." ) + protected Reference parent; + + /** + * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + protected DeviceComponent parentTarget; + + /** + * Indicates current operational status of the device. For example: On, Off, Standby, etc. + */ + @Child(name="operationalStatus", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." ) + protected List operationalStatus; + + /** + * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular. + */ + @Child(name="parameterGroup", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular." ) + protected CodeableConcept parameterGroup; + + /** + * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + @Child(name="measurementPrinciple", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) + protected Enumeration measurementPrinciple; + + /** + * Describes the production specification such as component revision, serial number, etc. + */ + @Child(name="productionSpecification", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." ) + protected List productionSpecification; + + /** + * Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. + */ + @Child(name="languageCode", type={CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) + protected CodeableConcept languageCode; + + private static final long serialVersionUID = 1179239259L; + + public DeviceComponent() { + super(); + } + + public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) { + super(); + this.type = type; + this.identifier = identifier; + this.lastSystemChange = lastSystemChange; + } + + /** + * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) + */ + public DeviceComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) + */ + public DeviceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value + */ + public InstantType getLastSystemChangeElement() { + if (this.lastSystemChange == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); + else if (Configuration.doAutoCreate()) + this.lastSystemChange = new InstantType(); + return this.lastSystemChange; + } + + public boolean hasLastSystemChangeElement() { + return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); + } + + public boolean hasLastSystemChange() { + return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); + } + + /** + * @param value {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value + */ + public DeviceComponent setLastSystemChangeElement(InstantType value) { + this.lastSystemChange = value; + return this; + } + + /** + * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. + */ + 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(Date value) { + if (this.lastSystemChange == null) + this.lastSystemChange = new InstantType(); + this.lastSystemChange.setValue(value); + return this; + } + + /** + * @return {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceComponent setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} 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. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public Device getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Device(); + return this.sourceTarget; + } + + /** + * @param value {@link #source} 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. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceComponent setSourceTarget(Device value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** + * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent setParent(Reference value) { + this.parent = value; + return this; + } + + /** + * @return {@link #parent} 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. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new DeviceComponent(); + return this.parentTarget; + } + + /** + * @param value {@link #parent} 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. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) + */ + public DeviceComponent setParentTarget(DeviceComponent value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) + */ + public List getOperationalStatus() { + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + return this.operationalStatus; + } + + public boolean hasOperationalStatus() { + if (this.operationalStatus == null) + return false; + for (CodeableConcept item : this.operationalStatus) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) + */ + // syntactic sugar + public CodeableConcept addOperationalStatus() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.operationalStatus == null) + this.operationalStatus = new ArrayList(); + this.operationalStatus.add(t); + return t; + } + + /** + * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) + */ + public CodeableConcept getParameterGroup() { + if (this.parameterGroup == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); + else if (Configuration.doAutoCreate()) + this.parameterGroup = new CodeableConcept(); + return this.parameterGroup; + } + + public boolean hasParameterGroup() { + return this.parameterGroup != null && !this.parameterGroup.isEmpty(); + } + + /** + * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.) + */ + public DeviceComponent setParameterGroup(CodeableConcept value) { + this.parameterGroup = value; + return this; + } + + /** + * @return {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value + */ + public Enumeration getMeasurementPrincipleElement() { + if (this.measurementPrinciple == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); + else if (Configuration.doAutoCreate()) + this.measurementPrinciple = new Enumeration(); + return this.measurementPrinciple; + } + + public boolean hasMeasurementPrincipleElement() { + return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); + } + + public boolean hasMeasurementPrinciple() { + return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); + } + + /** + * @param value {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value + */ + public DeviceComponent setMeasurementPrincipleElement(Enumeration value) { + this.measurementPrinciple = value; + return this; + } + + /** + * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + public MeasurementPrinciple getMeasurementPrinciple() { + return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); + } + + /** + * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + public DeviceComponent setMeasurementPrinciple(MeasurementPrinciple value) { + if (value == null) + this.measurementPrinciple = null; + else { + if (this.measurementPrinciple == null) + this.measurementPrinciple = new Enumeration(MeasurementPrinciple.ENUM_FACTORY); + this.measurementPrinciple.setValue(value); + } + return this; + } + + /** + * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) + */ + public List getProductionSpecification() { + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + return this.productionSpecification; + } + + public boolean hasProductionSpecification() { + if (this.productionSpecification == null) + return false; + for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) + */ + // syntactic sugar + public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 + DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); + if (this.productionSpecification == null) + this.productionSpecification = new ArrayList(); + this.productionSpecification.add(t); + return t; + } + + /** + * @return {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) + */ + public CodeableConcept getLanguageCode() { + if (this.languageCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceComponent.languageCode"); + else if (Configuration.doAutoCreate()) + this.languageCode = new CodeableConcept(); + return this.languageCode; + } + + public boolean hasLanguageCode() { + return this.languageCode != null && !this.languageCode.isEmpty(); + } + + /** + * @param value {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) + */ + public DeviceComponent setLanguageCode(CodeableConcept value) { + this.languageCode = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange)); + childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); + childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup)); + childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple)); + childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); + childrenList.add(new Property("languageCode", "CodeableConcept", "Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, java.lang.Integer.MAX_VALUE, languageCode)); + } + + public DeviceComponent copy() { + DeviceComponent dst = new DeviceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); + dst.source = source == null ? null : source.copy(); + dst.parent = parent == null ? null : parent.copy(); + if (operationalStatus != null) { + dst.operationalStatus = new ArrayList(); + for (CodeableConcept i : operationalStatus) + dst.operationalStatus.add(i.copy()); + }; + dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); + dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); + if (productionSpecification != null) { + dst.productionSpecification = new ArrayList(); + for (DeviceComponentProductionSpecificationComponent i : productionSpecification) + dst.productionSpecification.add(i.copy()); + }; + dst.languageCode = languageCode == null ? null : languageCode.copy(); + return dst; + } + + protected DeviceComponent typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty()) + && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty()) + && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty()) + && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceComponent; + } + + @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" ) + public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java index a5c4c390b21..7a9d52b391e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java @@ -20,1187 +20,1187 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 a measurement, calculation or setting capability of a medical device. - */ -@ResourceDef(name="DeviceMetric", profile="http://hl7.org/fhir/Profile/DeviceMetric") -public class DeviceMetric extends Resource { - - public enum MetricOperationalStatus implements FhirEnum { - /** - * The DeviceMetric is operating and will generate DeviceObservations. - */ - ON, - /** - * The DeviceMetric is not operating. - */ - OFF, - /** - * The DeviceMetric is operating, but will not generate any DeviceObservations. - */ - STANDBY, - /** - * added to help the parsers - */ - NULL; - - public static final MetricOperationalStatusEnumFactory ENUM_FACTORY = new MetricOperationalStatusEnumFactory(); - - public static MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return ON; - if ("off".equals(codeString)) - return OFF; - if ("standby".equals(codeString)) - return STANDBY; - throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ON: return "on"; - case OFF: return "off"; - case STANDBY: return "standby"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ON: return ""; - case OFF: return ""; - case STANDBY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ON: return "The DeviceMetric is operating and will generate DeviceObservations."; - case OFF: return "The DeviceMetric is not operating."; - case STANDBY: return "The DeviceMetric is operating, but will not generate any DeviceObservations."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ON: return "on"; - case OFF: return "off"; - case STANDBY: return "standby"; - default: return "?"; - } - } - } - - public static class MetricOperationalStatusEnumFactory implements EnumFactory { - public MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return MetricOperationalStatus.ON; - if ("off".equals(codeString)) - return MetricOperationalStatus.OFF; - if ("standby".equals(codeString)) - return MetricOperationalStatus.STANDBY; - throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); - } - public String toCode(MetricOperationalStatus code) throws IllegalArgumentException { - if (code == MetricOperationalStatus.ON) - return "on"; - if (code == MetricOperationalStatus.OFF) - return "off"; - if (code == MetricOperationalStatus.STANDBY) - return "standby"; - return "?"; - } - } - - public enum MetricCategory implements FhirEnum { - /** - * DeviceObservations generated for this DeviceMetric are measured. - */ - MEASUREMENT, - /** - * DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. - */ - SETTING, - /** - * DeviceObservations generated for this DeviceMetric are calculated. - */ - CALCULATION, - /** - * The category of this DeviceMetric is unspecified. - */ - UNSPECIFIED, - /** - * added to help the parsers - */ - NULL; - - public static final MetricCategoryEnumFactory ENUM_FACTORY = new MetricCategoryEnumFactory(); - - public static MetricCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return MEASUREMENT; - if ("setting".equals(codeString)) - return SETTING; - if ("calculation".equals(codeString)) - return CALCULATION; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MEASUREMENT: return "measurement"; - case SETTING: return "setting"; - case CALCULATION: return "calculation"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MEASUREMENT: return ""; - case SETTING: return ""; - case CALCULATION: return ""; - case UNSPECIFIED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MEASUREMENT: return "DeviceObservations generated for this DeviceMetric are measured."; - case SETTING: return "DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device."; - case CALCULATION: return "DeviceObservations generated for this DeviceMetric are calculated."; - case UNSPECIFIED: return "The category of this DeviceMetric is unspecified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MEASUREMENT: return "measurement"; - case SETTING: return "setting"; - case CALCULATION: return "calculation"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - } - - public static class MetricCategoryEnumFactory implements EnumFactory { - public MetricCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return MetricCategory.MEASUREMENT; - if ("setting".equals(codeString)) - return MetricCategory.SETTING; - if ("calculation".equals(codeString)) - return MetricCategory.CALCULATION; - if ("unspecified".equals(codeString)) - return MetricCategory.UNSPECIFIED; - throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); - } - public String toCode(MetricCategory code) throws IllegalArgumentException { - if (code == MetricCategory.MEASUREMENT) - return "measurement"; - if (code == MetricCategory.SETTING) - return "setting"; - if (code == MetricCategory.CALCULATION) - return "calculation"; - if (code == MetricCategory.UNSPECIFIED) - return "unspecified"; - return "?"; - } - } - - public enum MetricCalibrationType implements FhirEnum { - /** - * TODO. - */ - UNSPECIFIED, - /** - * TODO. - */ - OFFSET, - /** - * TODO. - */ - GAIN, - /** - * TODO. - */ - TWOPOINT, - /** - * added to help the parsers - */ - NULL; - - public static final MetricCalibrationTypeEnumFactory ENUM_FACTORY = new MetricCalibrationTypeEnumFactory(); - - public static MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - if ("offset".equals(codeString)) - return OFFSET; - if ("gain".equals(codeString)) - return GAIN; - if ("two-point".equals(codeString)) - return TWOPOINT; - throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case UNSPECIFIED: return "unspecified"; - case OFFSET: return "offset"; - case GAIN: return "gain"; - case TWOPOINT: return "two-point"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNSPECIFIED: return ""; - case OFFSET: return ""; - case GAIN: return ""; - case TWOPOINT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNSPECIFIED: return "TODO."; - case OFFSET: return "TODO."; - case GAIN: return "TODO."; - case TWOPOINT: return "TODO."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNSPECIFIED: return "unspecified"; - case OFFSET: return "offset"; - case GAIN: return "gain"; - case TWOPOINT: return "two-point"; - default: return "?"; - } - } - } - - public static class MetricCalibrationTypeEnumFactory implements EnumFactory { - public MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return MetricCalibrationType.UNSPECIFIED; - if ("offset".equals(codeString)) - return MetricCalibrationType.OFFSET; - if ("gain".equals(codeString)) - return MetricCalibrationType.GAIN; - if ("two-point".equals(codeString)) - return MetricCalibrationType.TWOPOINT; - throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); - } - public String toCode(MetricCalibrationType code) throws IllegalArgumentException { - if (code == MetricCalibrationType.UNSPECIFIED) - return "unspecified"; - if (code == MetricCalibrationType.OFFSET) - return "offset"; - if (code == MetricCalibrationType.GAIN) - return "gain"; - if (code == MetricCalibrationType.TWOPOINT) - return "two-point"; - return "?"; - } - } - - public enum MetricCalibrationState implements FhirEnum { - /** - * The metric has not been calibrated. - */ - NOTCALIBRATED, - /** - * The metric needs to be calibrated. - */ - CALIBRATIONREQUIRED, - /** - * The metric has been calibrated. - */ - CALIBRATED, - /** - * The state of calibration of this metric is unspecified. - */ - UNSPECIFIED, - /** - * added to help the parsers - */ - NULL; - - public static final MetricCalibrationStateEnumFactory ENUM_FACTORY = new MetricCalibrationStateEnumFactory(); - - public static MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return NOTCALIBRATED; - if ("calibration-required".equals(codeString)) - return CALIBRATIONREQUIRED; - if ("calibrated".equals(codeString)) - return CALIBRATED; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case NOTCALIBRATED: return "not-calibrated"; - case CALIBRATIONREQUIRED: return "calibration-required"; - case CALIBRATED: return "calibrated"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTCALIBRATED: return ""; - case CALIBRATIONREQUIRED: return ""; - case CALIBRATED: return ""; - case UNSPECIFIED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTCALIBRATED: return "The metric has not been calibrated."; - case CALIBRATIONREQUIRED: return "The metric needs to be calibrated."; - case CALIBRATED: return "The metric has been calibrated."; - case UNSPECIFIED: return "The state of calibration of this metric is unspecified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTCALIBRATED: return "not-calibrated"; - case CALIBRATIONREQUIRED: return "calibration-required"; - case CALIBRATED: return "calibrated"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - } - - public static class MetricCalibrationStateEnumFactory implements EnumFactory { - public MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return MetricCalibrationState.NOTCALIBRATED; - if ("calibration-required".equals(codeString)) - return MetricCalibrationState.CALIBRATIONREQUIRED; - if ("calibrated".equals(codeString)) - return MetricCalibrationState.CALIBRATED; - if ("unspecified".equals(codeString)) - return MetricCalibrationState.UNSPECIFIED; - throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); - } - public String toCode(MetricCalibrationState code) throws IllegalArgumentException { - if (code == MetricCalibrationState.NOTCALIBRATED) - return "not-calibrated"; - if (code == MetricCalibrationState.CALIBRATIONREQUIRED) - return "calibration-required"; - if (code == MetricCalibrationState.CALIBRATED) - return "calibrated"; - if (code == MetricCalibrationState.UNSPECIFIED) - return "unspecified"; - return "?"; - } - } - - @Block() - public static class DeviceMetricCalibrationInfoComponent extends BackboneElement { - /** - * Describes the type of the calibration method. - */ - @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="unspecified | offset | gain | two-point", formalDefinition="Describes the type of the calibration method." ) - protected Enumeration type; - - /** - * Describes the state of the calibration. - */ - @Child(name="state", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="not-calibrated | calibration-required | calibrated | unspecified", formalDefinition="Describes the state of the calibration." ) - protected Enumeration state; - - /** - * Describes the time last calibration has been performed. - */ - @Child(name="time", type={InstantType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Describes the time last calibration has been performed", formalDefinition="Describes the time last calibration has been performed." ) - protected InstantType time; - - private static final long serialVersionUID = 407720126L; - - public DeviceMetricCalibrationInfoComponent() { - super(); - } - - /** - * @return {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public DeviceMetricCalibrationInfoComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Describes the type of the calibration method. - */ - public MetricCalibrationType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Describes the type of the calibration method. - */ - public DeviceMetricCalibrationInfoComponent setType(MetricCalibrationType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(MetricCalibrationType.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public Enumeration getStateElement() { - if (this.state == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.state"); - else if (Configuration.doAutoCreate()) - this.state = new Enumeration(); - return this.state; - } - - public boolean hasStateElement() { - return this.state != null && !this.state.isEmpty(); - } - - public boolean hasState() { - return this.state != null && !this.state.isEmpty(); - } - - /** - * @param value {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public DeviceMetricCalibrationInfoComponent setStateElement(Enumeration value) { - this.state = value; - return this; - } - - /** - * @return Describes the state of the calibration. - */ - public MetricCalibrationState getState() { - return this.state == null ? null : this.state.getValue(); - } - - /** - * @param value Describes the state of the calibration. - */ - public DeviceMetricCalibrationInfoComponent setState(MetricCalibrationState value) { - if (value == null) - this.state = null; - else { - if (this.state == null) - this.state = new Enumeration(MetricCalibrationState.ENUM_FACTORY); - this.state.setValue(value); - } - return this; - } - - /** - * @return {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public InstantType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.time"); - else if (Configuration.doAutoCreate()) - this.time = new InstantType(); - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DeviceMetricCalibrationInfoComponent setTimeElement(InstantType value) { - this.time = value; - return this; - } - - /** - * @return Describes the time last calibration has been performed. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value Describes the time last calibration has been performed. - */ - public DeviceMetricCalibrationInfoComponent setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new InstantType(); - this.time.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Describes the type of the calibration method.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("state", "code", "Describes the state of the calibration.", 0, java.lang.Integer.MAX_VALUE, state)); - childrenList.add(new Property("time", "instant", "Describes the time last calibration has been performed.", 0, java.lang.Integer.MAX_VALUE, time)); - } - - public DeviceMetricCalibrationInfoComponent copy() { - DeviceMetricCalibrationInfoComponent dst = new DeviceMetricCalibrationInfoComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.state = state == null ? null : state.copy(); - dst.time = time == null ? null : time.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) - && (time == null || time.isEmpty()); - } - - } - - /** - * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. - */ - @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Type of metric", formalDefinition="Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc." ) - protected CodeableConcept type; - - /** + +/* + 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 a measurement, calculation or setting capability of a medical device. + */ +@ResourceDef(name="DeviceMetric", profile="http://hl7.org/fhir/Profile/DeviceMetric") +public class DeviceMetric extends Resource { + + public enum MetricOperationalStatus implements FhirEnum { + /** + * The DeviceMetric is operating and will generate DeviceObservations. + */ + ON, + /** + * The DeviceMetric is not operating. + */ + OFF, + /** + * The DeviceMetric is operating, but will not generate any DeviceObservations. + */ + STANDBY, + /** + * added to help the parsers + */ + NULL; + + public static final MetricOperationalStatusEnumFactory ENUM_FACTORY = new MetricOperationalStatusEnumFactory(); + + public static MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return ON; + if ("off".equals(codeString)) + return OFF; + if ("standby".equals(codeString)) + return STANDBY; + throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ON: return "on"; + case OFF: return "off"; + case STANDBY: return "standby"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ON: return ""; + case OFF: return ""; + case STANDBY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ON: return "The DeviceMetric is operating and will generate DeviceObservations."; + case OFF: return "The DeviceMetric is not operating."; + case STANDBY: return "The DeviceMetric is operating, but will not generate any DeviceObservations."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ON: return "on"; + case OFF: return "off"; + case STANDBY: return "standby"; + default: return "?"; + } + } + } + + public static class MetricOperationalStatusEnumFactory implements EnumFactory { + public MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return MetricOperationalStatus.ON; + if ("off".equals(codeString)) + return MetricOperationalStatus.OFF; + if ("standby".equals(codeString)) + return MetricOperationalStatus.STANDBY; + throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); + } + public String toCode(MetricOperationalStatus code) throws IllegalArgumentException { + if (code == MetricOperationalStatus.ON) + return "on"; + if (code == MetricOperationalStatus.OFF) + return "off"; + if (code == MetricOperationalStatus.STANDBY) + return "standby"; + return "?"; + } + } + + public enum MetricCategory implements FhirEnum { + /** + * DeviceObservations generated for this DeviceMetric are measured. + */ + MEASUREMENT, + /** + * DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. + */ + SETTING, + /** + * DeviceObservations generated for this DeviceMetric are calculated. + */ + CALCULATION, + /** + * The category of this DeviceMetric is unspecified. + */ + UNSPECIFIED, + /** + * added to help the parsers + */ + NULL; + + public static final MetricCategoryEnumFactory ENUM_FACTORY = new MetricCategoryEnumFactory(); + + public static MetricCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return MEASUREMENT; + if ("setting".equals(codeString)) + return SETTING; + if ("calculation".equals(codeString)) + return CALCULATION; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MEASUREMENT: return "measurement"; + case SETTING: return "setting"; + case CALCULATION: return "calculation"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MEASUREMENT: return ""; + case SETTING: return ""; + case CALCULATION: return ""; + case UNSPECIFIED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MEASUREMENT: return "DeviceObservations generated for this DeviceMetric are measured."; + case SETTING: return "DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device."; + case CALCULATION: return "DeviceObservations generated for this DeviceMetric are calculated."; + case UNSPECIFIED: return "The category of this DeviceMetric is unspecified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MEASUREMENT: return "measurement"; + case SETTING: return "setting"; + case CALCULATION: return "calculation"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + } + + public static class MetricCategoryEnumFactory implements EnumFactory { + public MetricCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return MetricCategory.MEASUREMENT; + if ("setting".equals(codeString)) + return MetricCategory.SETTING; + if ("calculation".equals(codeString)) + return MetricCategory.CALCULATION; + if ("unspecified".equals(codeString)) + return MetricCategory.UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); + } + public String toCode(MetricCategory code) throws IllegalArgumentException { + if (code == MetricCategory.MEASUREMENT) + return "measurement"; + if (code == MetricCategory.SETTING) + return "setting"; + if (code == MetricCategory.CALCULATION) + return "calculation"; + if (code == MetricCategory.UNSPECIFIED) + return "unspecified"; + return "?"; + } + } + + public enum MetricCalibrationType implements FhirEnum { + /** + * TODO. + */ + UNSPECIFIED, + /** + * TODO. + */ + OFFSET, + /** + * TODO. + */ + GAIN, + /** + * TODO. + */ + TWOPOINT, + /** + * added to help the parsers + */ + NULL; + + public static final MetricCalibrationTypeEnumFactory ENUM_FACTORY = new MetricCalibrationTypeEnumFactory(); + + public static MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + if ("offset".equals(codeString)) + return OFFSET; + if ("gain".equals(codeString)) + return GAIN; + if ("two-point".equals(codeString)) + return TWOPOINT; + throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case UNSPECIFIED: return "unspecified"; + case OFFSET: return "offset"; + case GAIN: return "gain"; + case TWOPOINT: return "two-point"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNSPECIFIED: return ""; + case OFFSET: return ""; + case GAIN: return ""; + case TWOPOINT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNSPECIFIED: return "TODO."; + case OFFSET: return "TODO."; + case GAIN: return "TODO."; + case TWOPOINT: return "TODO."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNSPECIFIED: return "unspecified"; + case OFFSET: return "offset"; + case GAIN: return "gain"; + case TWOPOINT: return "two-point"; + default: return "?"; + } + } + } + + public static class MetricCalibrationTypeEnumFactory implements EnumFactory { + public MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return MetricCalibrationType.UNSPECIFIED; + if ("offset".equals(codeString)) + return MetricCalibrationType.OFFSET; + if ("gain".equals(codeString)) + return MetricCalibrationType.GAIN; + if ("two-point".equals(codeString)) + return MetricCalibrationType.TWOPOINT; + throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); + } + public String toCode(MetricCalibrationType code) throws IllegalArgumentException { + if (code == MetricCalibrationType.UNSPECIFIED) + return "unspecified"; + if (code == MetricCalibrationType.OFFSET) + return "offset"; + if (code == MetricCalibrationType.GAIN) + return "gain"; + if (code == MetricCalibrationType.TWOPOINT) + return "two-point"; + return "?"; + } + } + + public enum MetricCalibrationState implements FhirEnum { + /** + * The metric has not been calibrated. + */ + NOTCALIBRATED, + /** + * The metric needs to be calibrated. + */ + CALIBRATIONREQUIRED, + /** + * The metric has been calibrated. + */ + CALIBRATED, + /** + * The state of calibration of this metric is unspecified. + */ + UNSPECIFIED, + /** + * added to help the parsers + */ + NULL; + + public static final MetricCalibrationStateEnumFactory ENUM_FACTORY = new MetricCalibrationStateEnumFactory(); + + public static MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return CALIBRATED; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NOTCALIBRATED: return "not-calibrated"; + case CALIBRATIONREQUIRED: return "calibration-required"; + case CALIBRATED: return "calibrated"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTCALIBRATED: return ""; + case CALIBRATIONREQUIRED: return ""; + case CALIBRATED: return ""; + case UNSPECIFIED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTCALIBRATED: return "The metric has not been calibrated."; + case CALIBRATIONREQUIRED: return "The metric needs to be calibrated."; + case CALIBRATED: return "The metric has been calibrated."; + case UNSPECIFIED: return "The state of calibration of this metric is unspecified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTCALIBRATED: return "not-calibrated"; + case CALIBRATIONREQUIRED: return "calibration-required"; + case CALIBRATED: return "calibrated"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + } + + public static class MetricCalibrationStateEnumFactory implements EnumFactory { + public MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return MetricCalibrationState.NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return MetricCalibrationState.CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return MetricCalibrationState.CALIBRATED; + if ("unspecified".equals(codeString)) + return MetricCalibrationState.UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); + } + public String toCode(MetricCalibrationState code) throws IllegalArgumentException { + if (code == MetricCalibrationState.NOTCALIBRATED) + return "not-calibrated"; + if (code == MetricCalibrationState.CALIBRATIONREQUIRED) + return "calibration-required"; + if (code == MetricCalibrationState.CALIBRATED) + return "calibrated"; + if (code == MetricCalibrationState.UNSPECIFIED) + return "unspecified"; + return "?"; + } + } + + @Block() + public static class DeviceMetricCalibrationInfoComponent extends BackboneElement { + /** + * Describes the type of the calibration method. + */ + @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="unspecified | offset | gain | two-point", formalDefinition="Describes the type of the calibration method." ) + protected Enumeration type; + + /** + * Describes the state of the calibration. + */ + @Child(name="state", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="not-calibrated | calibration-required | calibrated | unspecified", formalDefinition="Describes the state of the calibration." ) + protected Enumeration state; + + /** + * Describes the time last calibration has been performed. + */ + @Child(name="time", type={InstantType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Describes the time last calibration has been performed", formalDefinition="Describes the time last calibration has been performed." ) + protected InstantType time; + + private static final long serialVersionUID = 407720126L; + + public DeviceMetricCalibrationInfoComponent() { + super(); + } + + /** + * @return {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public DeviceMetricCalibrationInfoComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Describes the type of the calibration method. + */ + public MetricCalibrationType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Describes the type of the calibration method. + */ + public DeviceMetricCalibrationInfoComponent setType(MetricCalibrationType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(MetricCalibrationType.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public Enumeration getStateElement() { + if (this.state == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.state"); + else if (Configuration.doAutoCreate()) + this.state = new Enumeration(); + return this.state; + } + + public boolean hasStateElement() { + return this.state != null && !this.state.isEmpty(); + } + + public boolean hasState() { + return this.state != null && !this.state.isEmpty(); + } + + /** + * @param value {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public DeviceMetricCalibrationInfoComponent setStateElement(Enumeration value) { + this.state = value; + return this; + } + + /** + * @return Describes the state of the calibration. + */ + public MetricCalibrationState getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Describes the state of the calibration. + */ + public DeviceMetricCalibrationInfoComponent setState(MetricCalibrationState value) { + if (value == null) + this.state = null; + else { + if (this.state == null) + this.state = new Enumeration(MetricCalibrationState.ENUM_FACTORY); + this.state.setValue(value); + } + return this; + } + + /** + * @return {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public InstantType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new InstantType(); + return this.time; + } + + public boolean hasTimeElement() { + return this.time != null && !this.time.isEmpty(); + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DeviceMetricCalibrationInfoComponent setTimeElement(InstantType value) { + this.time = value; + return this; + } + + /** + * @return Describes the time last calibration has been performed. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value Describes the time last calibration has been performed. + */ + public DeviceMetricCalibrationInfoComponent setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new InstantType(); + this.time.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Describes the type of the calibration method.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("state", "code", "Describes the state of the calibration.", 0, java.lang.Integer.MAX_VALUE, state)); + childrenList.add(new Property("time", "instant", "Describes the time last calibration has been performed.", 0, java.lang.Integer.MAX_VALUE, time)); + } + + public DeviceMetricCalibrationInfoComponent copy() { + DeviceMetricCalibrationInfoComponent dst = new DeviceMetricCalibrationInfoComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.state = state == null ? null : state.copy(); + dst.time = time == null ? null : time.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) + && (time == null || time.isEmpty()); + } + + } + + /** + * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. + */ + @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Type of metric", formalDefinition="Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc." ) + protected CodeableConcept type; + + /** * Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. -It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=1, max=1) - @Description(shortDefinition="Unique identifier of this DeviceMetric", formalDefinition="Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device." ) - protected Identifier identifier; - - /** - * Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. - */ - @Child(name="unit", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Unit of metric", formalDefinition="Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc." ) - protected CodeableConcept unit; - - /** - * Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. - */ - @Child(name="source", type={Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Describes the link to the source Device", formalDefinition="Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - protected Device sourceTarget; - - /** +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=1, max=1) + @Description(shortDefinition="Unique identifier of this DeviceMetric", formalDefinition="Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device." ) + protected Identifier identifier; + + /** + * Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. + */ + @Child(name="unit", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Unit of metric", formalDefinition="Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc." ) + protected CodeableConcept unit; + + /** + * Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. + */ + @Child(name="source", type={Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Describes the link to the source Device", formalDefinition="Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + protected Device sourceTarget; + + /** * Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. - */ - @Child(name="parent", type={DeviceComponent.class}, order=3, min=0, max=1) - @Description(shortDefinition="Describes the link to the parent DeviceComponent", formalDefinition="Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location." ) - protected Reference parent; - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. + */ + @Child(name="parent", type={DeviceComponent.class}, order=3, min=0, max=1) + @Description(shortDefinition="Describes the link to the parent DeviceComponent", formalDefinition="Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location." ) + protected Reference parent; + + /** * The actual object that is the target of the reference (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - protected DeviceComponent parentTarget; - - /** - * Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - @Child(name="operationalState", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) - protected Enumeration operationalState; - - /** - * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - @Child(name="measurementMode", type={Identifier.class}, order=5, min=0, max=1) - @Description(shortDefinition="Describes the physical principle of the measurement", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) - protected Identifier measurementMode; - - /** - * Describes the typical color of the representation of observations that have been generated for this DeviceMetric. - */ - @Child(name="color", type={Identifier.class}, order=6, min=0, max=1) - @Description(shortDefinition="Describes the typical color of representation", formalDefinition="Describes the typical color of the representation of observations that have been generated for this DeviceMetric." ) - protected Identifier color; - - /** - * Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - @Child(name="category", type={CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="measurement | setting | calculation | unspecified", formalDefinition="Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation." ) - protected Enumeration category; - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + protected DeviceComponent parentTarget; + + /** + * Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + @Child(name="operationalState", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) + protected Enumeration operationalState; + + /** + * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + @Child(name="measurementMode", type={Identifier.class}, order=5, min=0, max=1) + @Description(shortDefinition="Describes the physical principle of the measurement", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) + protected Identifier measurementMode; + + /** + * Describes the typical color of the representation of observations that have been generated for this DeviceMetric. + */ + @Child(name="color", type={Identifier.class}, order=6, min=0, max=1) + @Description(shortDefinition="Describes the typical color of representation", formalDefinition="Describes the typical color of the representation of observations that have been generated for this DeviceMetric." ) + protected Identifier color; + + /** + * Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + @Child(name="category", type={CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="measurement | setting | calculation | unspecified", formalDefinition="Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation." ) + protected Enumeration category; + + /** * Describes the measurement repetition time. This is not necessarily the same as the update -period. - */ - @Child(name="measurementPeriod", type={Timing.class}, order=8, min=0, max=1) - @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod." ) - protected Timing measurementPeriod; - - /** - * Describes the calibrations that have been performed or that are required to be performed. - */ - @Child(name="calibrationInfo", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Describes the calibrations that have been performed or that are required to be performed", formalDefinition="Describes the calibrations that have been performed or that are required to be performed." ) - protected List calibrationInfo; - - private static final long serialVersionUID = 600373390L; - - public DeviceMetric() { - super(); - } - - public DeviceMetric(CodeableConcept type, Identifier identifier, Enumeration category) { - super(); - this.type = type; - this.identifier = identifier; - this.category = category; - } - - /** - * @return {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) - */ - public DeviceMetric setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** +period. + */ + @Child(name="measurementPeriod", type={Timing.class}, order=8, min=0, max=1) + @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod." ) + protected Timing measurementPeriod; + + /** + * Describes the calibrations that have been performed or that are required to be performed. + */ + @Child(name="calibrationInfo", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Describes the calibrations that have been performed or that are required to be performed", formalDefinition="Describes the calibrations that have been performed or that are required to be performed." ) + protected List calibrationInfo; + + private static final long serialVersionUID = 600373390L; + + public DeviceMetric() { + super(); + } + + public DeviceMetric(CodeableConcept type, Identifier identifier, Enumeration category) { + super(); + this.type = type; + this.identifier = identifier; + this.category = category; + } + + /** + * @return {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) + */ + public DeviceMetric setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** * @return {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. -It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** * @param value {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. -It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) - */ - public DeviceMetric setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) - */ - public CodeableConcept getUnit() { - if (this.unit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.unit"); - else if (Configuration.doAutoCreate()) - this.unit = new CodeableConcept(); - return this.unit; - } - - public boolean hasUnit() { - return this.unit != null && !this.unit.isEmpty(); - } - - /** - * @param value {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) - */ - public DeviceMetric setUnit(CodeableConcept value) { - this.unit = value; - return this; - } - - /** - * @return {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceMetric setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} 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. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public Device getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Device(); - return this.sourceTarget; - } - - /** - * @param value {@link #source} 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. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceMetric setSourceTarget(Device value) { - this.sourceTarget = value; - return this; - } - - /** +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) + */ + public DeviceMetric setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) + */ + public CodeableConcept getUnit() { + if (this.unit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.unit"); + else if (Configuration.doAutoCreate()) + this.unit = new CodeableConcept(); + return this.unit; + } + + public boolean hasUnit() { + return this.unit != null && !this.unit.isEmpty(); + } + + /** + * @param value {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) + */ + public DeviceMetric setUnit(CodeableConcept value) { + this.unit = value; + return this; + } + + /** + * @return {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceMetric setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} 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. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public Device getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Device(); + return this.sourceTarget; + } + + /** + * @param value {@link #source} 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. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceMetric setSourceTarget(Device value) { + this.sourceTarget = value; + return this; + } + + /** * @return {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** * @param value {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceMetric setParent(Reference value) { - this.parent = value; - return this; - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceMetric setParent(Reference value) { + this.parent = value; + return this; + } + + /** * @return {@link #parent} 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. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceComponent getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new DeviceComponent(); - return this.parentTarget; - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceComponent getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new DeviceComponent(); + return this.parentTarget; + } + + /** * @param value {@link #parent} 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. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. -An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceMetric setParentTarget(DeviceComponent value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #operationalState} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalState" gives direct access to the value - */ - public Enumeration getOperationalStateElement() { - if (this.operationalState == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.operationalState"); - else if (Configuration.doAutoCreate()) - this.operationalState = new Enumeration(); - return this.operationalState; - } - - public boolean hasOperationalStateElement() { - return this.operationalState != null && !this.operationalState.isEmpty(); - } - - public boolean hasOperationalState() { - return this.operationalState != null && !this.operationalState.isEmpty(); - } - - /** - * @param value {@link #operationalState} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalState" gives direct access to the value - */ - public DeviceMetric setOperationalStateElement(Enumeration value) { - this.operationalState = value; - return this; - } - - /** - * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - public MetricOperationalStatus getOperationalState() { - return this.operationalState == null ? null : this.operationalState.getValue(); - } - - /** - * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - public DeviceMetric setOperationalState(MetricOperationalStatus value) { - if (value == null) - this.operationalState = null; - else { - if (this.operationalState == null) - this.operationalState = new Enumeration(MetricOperationalStatus.ENUM_FACTORY); - this.operationalState.setValue(value); - } - return this; - } - - /** - * @return {@link #measurementMode} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.) - */ - public Identifier getMeasurementMode() { - if (this.measurementMode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.measurementMode"); - else if (Configuration.doAutoCreate()) - this.measurementMode = new Identifier(); - return this.measurementMode; - } - - public boolean hasMeasurementMode() { - return this.measurementMode != null && !this.measurementMode.isEmpty(); - } - - /** - * @param value {@link #measurementMode} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.) - */ - public DeviceMetric setMeasurementMode(Identifier value) { - this.measurementMode = value; - return this; - } - - /** - * @return {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.) - */ - public Identifier getColor() { - if (this.color == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.color"); - else if (Configuration.doAutoCreate()) - this.color = new Identifier(); - return this.color; - } - - public boolean hasColor() { - return this.color != null && !this.color.isEmpty(); - } - - /** - * @param value {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.) - */ - public DeviceMetric setColor(Identifier value) { - this.color = value; - return this; - } - - /** - * @return {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(); - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public DeviceMetric setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - public MetricCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - public DeviceMetric setCategory(MetricCategory value) { - if (this.category == null) - this.category = new Enumeration(MetricCategory.ENUM_FACTORY); - this.category.setValue(value); - return this; - } - - /** +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceMetric setParentTarget(DeviceComponent value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #operationalState} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalState" gives direct access to the value + */ + public Enumeration getOperationalStateElement() { + if (this.operationalState == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.operationalState"); + else if (Configuration.doAutoCreate()) + this.operationalState = new Enumeration(); + return this.operationalState; + } + + public boolean hasOperationalStateElement() { + return this.operationalState != null && !this.operationalState.isEmpty(); + } + + public boolean hasOperationalState() { + return this.operationalState != null && !this.operationalState.isEmpty(); + } + + /** + * @param value {@link #operationalState} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalState" gives direct access to the value + */ + public DeviceMetric setOperationalStateElement(Enumeration value) { + this.operationalState = value; + return this; + } + + /** + * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public MetricOperationalStatus getOperationalState() { + return this.operationalState == null ? null : this.operationalState.getValue(); + } + + /** + * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public DeviceMetric setOperationalState(MetricOperationalStatus value) { + if (value == null) + this.operationalState = null; + else { + if (this.operationalState == null) + this.operationalState = new Enumeration(MetricOperationalStatus.ENUM_FACTORY); + this.operationalState.setValue(value); + } + return this; + } + + /** + * @return {@link #measurementMode} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.) + */ + public Identifier getMeasurementMode() { + if (this.measurementMode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.measurementMode"); + else if (Configuration.doAutoCreate()) + this.measurementMode = new Identifier(); + return this.measurementMode; + } + + public boolean hasMeasurementMode() { + return this.measurementMode != null && !this.measurementMode.isEmpty(); + } + + /** + * @param value {@link #measurementMode} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.) + */ + public DeviceMetric setMeasurementMode(Identifier value) { + this.measurementMode = value; + return this; + } + + /** + * @return {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.) + */ + public Identifier getColor() { + if (this.color == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.color"); + else if (Configuration.doAutoCreate()) + this.color = new Identifier(); + return this.color; + } + + public boolean hasColor() { + return this.color != null && !this.color.isEmpty(); + } + + /** + * @param value {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.) + */ + public DeviceMetric setColor(Identifier value) { + this.color = value; + return this; + } + + /** + * @return {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public DeviceMetric setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + public MetricCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + public DeviceMetric setCategory(MetricCategory value) { + if (this.category == null) + this.category = new Enumeration(MetricCategory.ENUM_FACTORY); + this.category.setValue(value); + return this; + } + + /** * @return {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update -period.) - */ - public Timing getMeasurementPeriod() { - if (this.measurementPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.measurementPeriod"); - else if (Configuration.doAutoCreate()) - this.measurementPeriod = new Timing(); - return this.measurementPeriod; - } - - public boolean hasMeasurementPeriod() { - return this.measurementPeriod != null && !this.measurementPeriod.isEmpty(); - } - - /** +period.) + */ + public Timing getMeasurementPeriod() { + if (this.measurementPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.measurementPeriod"); + else if (Configuration.doAutoCreate()) + this.measurementPeriod = new Timing(); + return this.measurementPeriod; + } + + public boolean hasMeasurementPeriod() { + return this.measurementPeriod != null && !this.measurementPeriod.isEmpty(); + } + + /** * @param value {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update -period.) - */ - public DeviceMetric setMeasurementPeriod(Timing value) { - this.measurementPeriod = value; - return this; - } - - /** - * @return {@link #calibrationInfo} (Describes the calibrations that have been performed or that are required to be performed.) - */ - public List getCalibrationInfo() { - if (this.calibrationInfo == null) - this.calibrationInfo = new ArrayList(); - return this.calibrationInfo; - } - - public boolean hasCalibrationInfo() { - if (this.calibrationInfo == null) - return false; - for (DeviceMetricCalibrationInfoComponent item : this.calibrationInfo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #calibrationInfo} (Describes the calibrations that have been performed or that are required to be performed.) - */ - // syntactic sugar - public DeviceMetricCalibrationInfoComponent addCalibrationInfo() { //3 - DeviceMetricCalibrationInfoComponent t = new DeviceMetricCalibrationInfoComponent(); - if (this.calibrationInfo == null) - this.calibrationInfo = new ArrayList(); - this.calibrationInfo.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("unit", "CodeableConcept", "Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("operationalState", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalState)); - childrenList.add(new Property("measurementMode", "Identifier", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementMode)); - childrenList.add(new Property("color", "Identifier", "Describes the typical color of the representation of observations that have been generated for this DeviceMetric.", 0, java.lang.Integer.MAX_VALUE, color)); - childrenList.add(new Property("category", "code", "Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("measurementPeriod", "Timing", "Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); - childrenList.add(new Property("calibrationInfo", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibrationInfo)); - } - - public DeviceMetric copy() { - DeviceMetric dst = new DeviceMetric(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.source = source == null ? null : source.copy(); - dst.parent = parent == null ? null : parent.copy(); - dst.operationalState = operationalState == null ? null : operationalState.copy(); - dst.measurementMode = measurementMode == null ? null : measurementMode.copy(); - dst.color = color == null ? null : color.copy(); - dst.category = category == null ? null : category.copy(); - dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); - if (calibrationInfo != null) { - dst.calibrationInfo = new ArrayList(); - for (DeviceMetricCalibrationInfoComponent i : calibrationInfo) - dst.calibrationInfo.add(i.copy()); - }; - return dst; - } - - protected DeviceMetric typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (unit == null || unit.isEmpty()) && (source == null || source.isEmpty()) && (parent == null || parent.isEmpty()) - && (operationalState == null || operationalState.isEmpty()) && (measurementMode == null || measurementMode.isEmpty()) - && (color == null || color.isEmpty()) && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) - && (calibrationInfo == null || calibrationInfo.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceMetric; - } - - @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) - public static final String SP_CATEGORY = "category"; - @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) - public static final String SP_PARENT = "parent"; - @SearchParamDefinition(name="type", path="DeviceMetric.type", description="The component type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="DeviceMetric.identifier", description="The identifier of the metric", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +period.) + */ + public DeviceMetric setMeasurementPeriod(Timing value) { + this.measurementPeriod = value; + return this; + } + + /** + * @return {@link #calibrationInfo} (Describes the calibrations that have been performed or that are required to be performed.) + */ + public List getCalibrationInfo() { + if (this.calibrationInfo == null) + this.calibrationInfo = new ArrayList(); + return this.calibrationInfo; + } + + public boolean hasCalibrationInfo() { + if (this.calibrationInfo == null) + return false; + for (DeviceMetricCalibrationInfoComponent item : this.calibrationInfo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #calibrationInfo} (Describes the calibrations that have been performed or that are required to be performed.) + */ + // syntactic sugar + public DeviceMetricCalibrationInfoComponent addCalibrationInfo() { //3 + DeviceMetricCalibrationInfoComponent t = new DeviceMetricCalibrationInfoComponent(); + if (this.calibrationInfo == null) + this.calibrationInfo = new ArrayList(); + this.calibrationInfo.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("unit", "CodeableConcept", "Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalState", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalState)); + childrenList.add(new Property("measurementMode", "Identifier", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementMode)); + childrenList.add(new Property("color", "Identifier", "Describes the typical color of the representation of observations that have been generated for this DeviceMetric.", 0, java.lang.Integer.MAX_VALUE, color)); + childrenList.add(new Property("category", "code", "Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("measurementPeriod", "Timing", "Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); + childrenList.add(new Property("calibrationInfo", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibrationInfo)); + } + + public DeviceMetric copy() { + DeviceMetric dst = new DeviceMetric(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.source = source == null ? null : source.copy(); + dst.parent = parent == null ? null : parent.copy(); + dst.operationalState = operationalState == null ? null : operationalState.copy(); + dst.measurementMode = measurementMode == null ? null : measurementMode.copy(); + dst.color = color == null ? null : color.copy(); + dst.category = category == null ? null : category.copy(); + dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); + if (calibrationInfo != null) { + dst.calibrationInfo = new ArrayList(); + for (DeviceMetricCalibrationInfoComponent i : calibrationInfo) + dst.calibrationInfo.add(i.copy()); + }; + return dst; + } + + protected DeviceMetric typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (unit == null || unit.isEmpty()) && (source == null || source.isEmpty()) && (parent == null || parent.isEmpty()) + && (operationalState == null || operationalState.isEmpty()) && (measurementMode == null || measurementMode.isEmpty()) + && (color == null || color.isEmpty()) && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) + && (calibrationInfo == null || calibrationInfo.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceMetric; + } + + @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) + public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="type", path="DeviceMetric.type", description="The component type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="DeviceMetric.identifier", description="The identifier of the metric", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java index 4f3a1af023b..a6fcda29996 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java @@ -20,1222 +20,1222 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Represents a request for the use of a device. - */ -@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") -public class DeviceUseRequest extends DomainResource { - - public enum DeviceUseRequestStatus implements FhirEnum { - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the request but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work is complete, and the outcomes are being reviewed for approval. - */ - REVIEW, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The request was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("review".equals(codeString)) - return REVIEW; - 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 DeviceUseRequestStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case REVIEW: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the request but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The request was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - } - - public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { - public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return DeviceUseRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return DeviceUseRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return DeviceUseRequestStatus.ACCEPTED; - if ("in progress".equals(codeString)) - return DeviceUseRequestStatus.INPROGRESS; - if ("review".equals(codeString)) - return DeviceUseRequestStatus.REVIEW; - if ("completed".equals(codeString)) - return DeviceUseRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return DeviceUseRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return DeviceUseRequestStatus.REJECTED; - if ("failed".equals(codeString)) - return DeviceUseRequestStatus.FAILED; - throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestStatus code) throws IllegalArgumentException { - if (code == DeviceUseRequestStatus.REQUESTED) - return "requested"; - if (code == DeviceUseRequestStatus.RECEIVED) - return "received"; - if (code == DeviceUseRequestStatus.ACCEPTED) - return "accepted"; - if (code == DeviceUseRequestStatus.INPROGRESS) - return "in progress"; - if (code == DeviceUseRequestStatus.REVIEW) - return "review"; - if (code == DeviceUseRequestStatus.COMPLETED) - return "completed"; - if (code == DeviceUseRequestStatus.SUSPENDED) - return "suspended"; - if (code == DeviceUseRequestStatus.REJECTED) - return "rejected"; - if (code == DeviceUseRequestStatus.FAILED) - return "failed"; - return "?"; - } - } - - public enum DeviceUseRequestMode implements FhirEnum { - /** - * planned. - */ - PLANNED, - /** - * proposed. - */ - PROPOSED, - /** - * ordered. - */ - ORDERED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PLANNED; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("ordered".equals(codeString)) - return ORDERED; - throw new IllegalArgumentException("Unknown DeviceUseRequestMode 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 DeviceUseRequestModeEnumFactory implements EnumFactory { - public DeviceUseRequestMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return DeviceUseRequestMode.PLANNED; - if ("proposed".equals(codeString)) - return DeviceUseRequestMode.PROPOSED; - if ("ordered".equals(codeString)) - return DeviceUseRequestMode.ORDERED; - throw new IllegalArgumentException("Unknown DeviceUseRequestMode code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestMode code) throws IllegalArgumentException { - if (code == DeviceUseRequestMode.PLANNED) - return "planned"; - if (code == DeviceUseRequestMode.PROPOSED) - return "proposed"; - if (code == DeviceUseRequestMode.ORDERED) - return "ordered"; - return "?"; - } - } - - public enum DeviceUseRequestPriority implements FhirEnum { - /** - * The request has a normal priority. - */ - ROUTINE, - /** - * The request should be done urgently. - */ - URGENT, - /** - * The request is time-critical. - */ - STAT, - /** - * The request should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return ""; - case URGENT: return ""; - case STAT: return ""; - case ASAP: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The request has a normal priority."; - case URGENT: return "The request should be done urgently."; - case STAT: return "The request is time-critical."; - case ASAP: return "The request should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - } - - public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { - public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return DeviceUseRequestPriority.ROUTINE; - if ("urgent".equals(codeString)) - return DeviceUseRequestPriority.URGENT; - if ("stat".equals(codeString)) - return DeviceUseRequestPriority.STAT; - if ("asap".equals(codeString)) - return DeviceUseRequestPriority.ASAP; - throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestPriority code) throws IllegalArgumentException { - if (code == DeviceUseRequestPriority.ROUTINE) - return "routine"; - if (code == DeviceUseRequestPriority.URGENT) - return "urgent"; - if (code == DeviceUseRequestPriority.STAT) - return "stat"; - if (code == DeviceUseRequestPriority.ASAP) - return "asap"; - return "?"; - } - } - - /** - * Body site where the device is to be used. - */ - @Child(name="bodySite", type={CodeableConcept.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target body site", formalDefinition="Body site where the device is to be used." ) - protected List bodySite; - - /** - * The status of the request. - */ - @Child(name="status", type={CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the request." ) - protected Enumeration status; - - /** - * The mode of the request. - */ - @Child(name="mode", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="planned | proposed | ordered", formalDefinition="The mode of the request." ) - protected Enumeration mode; - - /** - * The details of the device to be used. - */ - @Child(name="device", type={Device.class}, order=2, min=1, max=1) - @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The details of the device to be used.) - */ - protected Device deviceTarget; - - /** - * An encounter that provides additional context in which this request is made. - */ - @Child(name="encounter", type={Encounter.class}, order=3, min=0, max=1) - @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * Identifiers assigned to this order by the orderer or by the receiver. - */ - @Child(name="identifier", type={Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) - protected List identifier; - - /** - * Reason or justification for the use of this device. - */ - @Child(name="indication", type={CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason for request", formalDefinition="Reason or justification for the use of this device." ) - protected List indication; - - /** - * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. - */ - @Child(name="notes", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) - protected List notes; - - /** - * The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. - */ - @Child(name="prnReason", type={CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="PRN", formalDefinition="The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%." ) - protected List prnReason; - - /** - * The time when the request was made. - */ - @Child(name="orderedOn", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="When ordered", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The time at which the request was made/recorded. - */ - @Child(name="recordedOn", type={DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="When recorded", formalDefinition="The time at which the request was made/recorded." ) - protected DateTimeType recordedOn; - - /** - * The patient who will use the device. - */ - @Child(name="subject", type={Patient.class}, order=10, min=1, max=1) - @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who will use the device.) - */ - protected Patient subjectTarget; - - /** - * The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name="timing", type={Timing.class, Period.class, DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Schedule for use", formalDefinition="The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type timing; - - /** - * Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - @Child(name="priority", type={CodeType.class}, order=12, min=0, max=1) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine." ) - protected Enumeration priority; - - private static final long serialVersionUID = -680542754L; - - public DeviceUseRequest() { - super(); - } - - public DeviceUseRequest(Reference device, Reference subject) { - super(); - this.device = device; - this.subject = subject; - } - - /** - * @return {@link #bodySite} (Body site where the device is to be used.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Body site where the device is to be used.) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - /** - * @return {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DeviceUseRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the request. - */ - public DeviceUseRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the request. - */ - public DeviceUseRequest setStatus(DeviceUseRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(DeviceUseRequestStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (The mode of the request.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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 mode of the request.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public DeviceUseRequest setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return The mode of the request. - */ - public DeviceUseRequestMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value The mode of the request. - */ - public DeviceUseRequest setMode(DeviceUseRequestMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(DeviceUseRequestMode.ENUM_FACTORY); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #device} (The details of the device to be used.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The details of the device to be used.) - */ - public DeviceUseRequest setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} 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 details of the device to be used.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); - return this.deviceTarget; - } - - /** - * @param value {@link #device} 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 details of the device to be used.) - */ - public DeviceUseRequest setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.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} (An encounter that provides additional context in which this request is made.) - */ - public DeviceUseRequest 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. (An encounter that provides additional context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.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. (An encounter that provides additional context in which this request is made.) - */ - public DeviceUseRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this order by the orderer or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #indication} (Reason or justification for the use of this device.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - 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} (Reason or justification for the use of this device.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - /** - * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public DeviceUseRequest addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) - */ - public List getPrnReason() { - if (this.prnReason == null) - this.prnReason = new ArrayList(); - return this.prnReason; - } - - public boolean hasPrnReason() { - if (this.prnReason == null) - return false; - for (CodeableConcept item : this.prnReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) - */ - // syntactic sugar - public CodeableConcept addPrnReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.prnReason == null) - this.prnReason = new ArrayList(); - this.prnReason.add(t); - return t; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DeviceUseRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public DeviceUseRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DateTimeType getRecordedOnElement() { - if (this.recordedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.recordedOn"); - else if (Configuration.doAutoCreate()) - this.recordedOn = new DateTimeType(); - return this.recordedOn; - } - - public boolean hasRecordedOnElement() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - public boolean hasRecordedOn() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - /** - * @param value {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DeviceUseRequest setRecordedOnElement(DateTimeType value) { - this.recordedOn = value; - return this; - } - - /** - * @return The time at which the request was made/recorded. - */ - 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(Date value) { - if (value == null) - this.recordedOn = null; - else { - if (this.recordedOn == null) - this.recordedOn = new DateTimeType(); - this.recordedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who will use the device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.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 will use the device.) - */ - public DeviceUseRequest 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 will use the device.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.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 will use the device.) - */ - public DeviceUseRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getTimingTiming() throws Exception { - if (!(this.timing instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DeviceUseRequest setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(); - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public DeviceUseRequest setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - public DeviceUseRequestPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - public DeviceUseRequest setPriority(DeviceUseRequestPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(DeviceUseRequestPriority.ENUM_FACTORY); - this.priority.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bodySite", "CodeableConcept", "Body site where the device is to be used.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("status", "code", "The status of the request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("mode", "code", "The mode of the request.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("device", "Reference(Device)", "The details of the device to be used.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("notes", "string", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("prnReason", "CodeableConcept", "The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.", 0, java.lang.Integer.MAX_VALUE, prnReason)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("recordedOn", "dateTime", "The time at which the request was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will use the device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("priority", "code", "Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - public DeviceUseRequest copy() { - DeviceUseRequest dst = new DeviceUseRequest(); - copyValues(dst); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.device = device == null ? null : device.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - if (prnReason != null) { - dst.prnReason = new ArrayList(); - for (CodeableConcept i : prnReason) - dst.prnReason.add(i.copy()); - }; - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected DeviceUseRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) - && (mode == null || mode.isEmpty()) && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) - && (notes == null || notes.isEmpty()) && (prnReason == null || prnReason.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) - && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) - && (timing == null || timing.isEmpty()) && (priority == null || priority.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceUseRequest; - } - - @SearchParamDefinition(name="patient", path="DeviceUseRequest.subject", description="Search by subject - a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="DeviceUseRequest.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - -} - + +/* + 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; +/** + * Represents a request for the use of a device. + */ +@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") +public class DeviceUseRequest extends DomainResource { + + public enum DeviceUseRequestStatus implements FhirEnum { + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the request but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work is complete, and the outcomes are being reviewed for approval. + */ + REVIEW, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The request was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("review".equals(codeString)) + return REVIEW; + 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 DeviceUseRequestStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case REVIEW: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the request but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The request was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + } + + public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { + public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return DeviceUseRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return DeviceUseRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return DeviceUseRequestStatus.ACCEPTED; + if ("in progress".equals(codeString)) + return DeviceUseRequestStatus.INPROGRESS; + if ("review".equals(codeString)) + return DeviceUseRequestStatus.REVIEW; + if ("completed".equals(codeString)) + return DeviceUseRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return DeviceUseRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return DeviceUseRequestStatus.REJECTED; + if ("failed".equals(codeString)) + return DeviceUseRequestStatus.FAILED; + throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestStatus code) throws IllegalArgumentException { + if (code == DeviceUseRequestStatus.REQUESTED) + return "requested"; + if (code == DeviceUseRequestStatus.RECEIVED) + return "received"; + if (code == DeviceUseRequestStatus.ACCEPTED) + return "accepted"; + if (code == DeviceUseRequestStatus.INPROGRESS) + return "in progress"; + if (code == DeviceUseRequestStatus.REVIEW) + return "review"; + if (code == DeviceUseRequestStatus.COMPLETED) + return "completed"; + if (code == DeviceUseRequestStatus.SUSPENDED) + return "suspended"; + if (code == DeviceUseRequestStatus.REJECTED) + return "rejected"; + if (code == DeviceUseRequestStatus.FAILED) + return "failed"; + return "?"; + } + } + + public enum DeviceUseRequestMode implements FhirEnum { + /** + * planned. + */ + PLANNED, + /** + * proposed. + */ + PROPOSED, + /** + * ordered. + */ + ORDERED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PLANNED; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("ordered".equals(codeString)) + return ORDERED; + throw new IllegalArgumentException("Unknown DeviceUseRequestMode 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 DeviceUseRequestModeEnumFactory implements EnumFactory { + public DeviceUseRequestMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return DeviceUseRequestMode.PLANNED; + if ("proposed".equals(codeString)) + return DeviceUseRequestMode.PROPOSED; + if ("ordered".equals(codeString)) + return DeviceUseRequestMode.ORDERED; + throw new IllegalArgumentException("Unknown DeviceUseRequestMode code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestMode code) throws IllegalArgumentException { + if (code == DeviceUseRequestMode.PLANNED) + return "planned"; + if (code == DeviceUseRequestMode.PROPOSED) + return "proposed"; + if (code == DeviceUseRequestMode.ORDERED) + return "ordered"; + return "?"; + } + } + + public enum DeviceUseRequestPriority implements FhirEnum { + /** + * The request has a normal priority. + */ + ROUTINE, + /** + * The request should be done urgently. + */ + URGENT, + /** + * The request is time-critical. + */ + STAT, + /** + * The request should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return ""; + case URGENT: return ""; + case STAT: return ""; + case ASAP: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The request has a normal priority."; + case URGENT: return "The request should be done urgently."; + case STAT: return "The request is time-critical."; + case ASAP: return "The request should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + } + + public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { + public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return DeviceUseRequestPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DeviceUseRequestPriority.URGENT; + if ("stat".equals(codeString)) + return DeviceUseRequestPriority.STAT; + if ("asap".equals(codeString)) + return DeviceUseRequestPriority.ASAP; + throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + } + public String toCode(DeviceUseRequestPriority code) throws IllegalArgumentException { + if (code == DeviceUseRequestPriority.ROUTINE) + return "routine"; + if (code == DeviceUseRequestPriority.URGENT) + return "urgent"; + if (code == DeviceUseRequestPriority.STAT) + return "stat"; + if (code == DeviceUseRequestPriority.ASAP) + return "asap"; + return "?"; + } + } + + /** + * Body site where the device is to be used. + */ + @Child(name="bodySite", type={CodeableConcept.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target body site", formalDefinition="Body site where the device is to be used." ) + protected List bodySite; + + /** + * The status of the request. + */ + @Child(name="status", type={CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the request." ) + protected Enumeration status; + + /** + * The mode of the request. + */ + @Child(name="mode", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="planned | proposed | ordered", formalDefinition="The mode of the request." ) + protected Enumeration mode; + + /** + * The details of the device to be used. + */ + @Child(name="device", type={Device.class}, order=2, min=1, max=1) + @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The details of the device to be used.) + */ + protected Device deviceTarget; + + /** + * An encounter that provides additional context in which this request is made. + */ + @Child(name="encounter", type={Encounter.class}, order=3, min=0, max=1) + @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * Identifiers assigned to this order by the orderer or by the receiver. + */ + @Child(name="identifier", type={Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) + protected List identifier; + + /** + * Reason or justification for the use of this device. + */ + @Child(name="indication", type={CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason for request", formalDefinition="Reason or justification for the use of this device." ) + protected List indication; + + /** + * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + */ + @Child(name="notes", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) + protected List notes; + + /** + * The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. + */ + @Child(name="prnReason", type={CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="PRN", formalDefinition="The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%." ) + protected List prnReason; + + /** + * The time when the request was made. + */ + @Child(name="orderedOn", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="When ordered", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The time at which the request was made/recorded. + */ + @Child(name="recordedOn", type={DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="When recorded", formalDefinition="The time at which the request was made/recorded." ) + protected DateTimeType recordedOn; + + /** + * The patient who will use the device. + */ + @Child(name="subject", type={Patient.class}, order=10, min=1, max=1) + @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who will use the device.) + */ + protected Patient subjectTarget; + + /** + * The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name="timing", type={Timing.class, Period.class, DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Schedule for use", formalDefinition="The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type timing; + + /** + * Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + @Child(name="priority", type={CodeType.class}, order=12, min=0, max=1) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine." ) + protected Enumeration priority; + + private static final long serialVersionUID = -680542754L; + + public DeviceUseRequest() { + super(); + } + + public DeviceUseRequest(Reference device, Reference subject) { + super(); + this.device = device; + this.subject = subject; + } + + /** + * @return {@link #bodySite} (Body site where the device is to be used.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Body site where the device is to be used.) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + /** + * @return {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DeviceUseRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the request. + */ + public DeviceUseRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the request. + */ + public DeviceUseRequest setStatus(DeviceUseRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(DeviceUseRequestStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (The mode of the request.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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 mode of the request.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public DeviceUseRequest setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return The mode of the request. + */ + public DeviceUseRequestMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value The mode of the request. + */ + public DeviceUseRequest setMode(DeviceUseRequestMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(DeviceUseRequestMode.ENUM_FACTORY); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #device} (The details of the device to be used.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The details of the device to be used.) + */ + public DeviceUseRequest setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} 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 details of the device to be used.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); + return this.deviceTarget; + } + + /** + * @param value {@link #device} 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 details of the device to be used.) + */ + public DeviceUseRequest setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (An encounter that provides additional context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.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} (An encounter that provides additional context in which this request is made.) + */ + public DeviceUseRequest 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. (An encounter that provides additional context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.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. (An encounter that provides additional context in which this request is made.) + */ + public DeviceUseRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this order by the orderer or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #indication} (Reason or justification for the use of this device.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + 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} (Reason or justification for the use of this device.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + /** + * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public DeviceUseRequest addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) + */ + public List getPrnReason() { + if (this.prnReason == null) + this.prnReason = new ArrayList(); + return this.prnReason; + } + + public boolean hasPrnReason() { + if (this.prnReason == null) + return false; + for (CodeableConcept item : this.prnReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) + */ + // syntactic sugar + public CodeableConcept addPrnReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.prnReason == null) + this.prnReason = new ArrayList(); + this.prnReason.add(t); + return t; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DeviceUseRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public DeviceUseRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DateTimeType getRecordedOnElement() { + if (this.recordedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.recordedOn"); + else if (Configuration.doAutoCreate()) + this.recordedOn = new DateTimeType(); + return this.recordedOn; + } + + public boolean hasRecordedOnElement() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + public boolean hasRecordedOn() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + /** + * @param value {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DeviceUseRequest setRecordedOnElement(DateTimeType value) { + this.recordedOn = value; + return this; + } + + /** + * @return The time at which the request was made/recorded. + */ + 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(Date value) { + if (value == null) + this.recordedOn = null; + else { + if (this.recordedOn == null) + this.recordedOn = new DateTimeType(); + this.recordedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who will use the device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.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 will use the device.) + */ + public DeviceUseRequest 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 will use the device.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.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 will use the device.) + */ + public DeviceUseRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTimingTiming() throws Exception { + if (!(this.timing instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DeviceUseRequest setTiming(Type value) { + this.timing = value; + return this; + } + + /** + * @return {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(); + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DeviceUseRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + public DeviceUseRequestPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + */ + public DeviceUseRequest setPriority(DeviceUseRequestPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(DeviceUseRequestPriority.ENUM_FACTORY); + this.priority.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bodySite", "CodeableConcept", "Body site where the device is to be used.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("status", "code", "The status of the request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("mode", "code", "The mode of the request.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("device", "Reference(Device)", "The details of the device to be used.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("notes", "string", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("prnReason", "CodeableConcept", "The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.", 0, java.lang.Integer.MAX_VALUE, prnReason)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("recordedOn", "dateTime", "The time at which the request was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will use the device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("priority", "code", "Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + public DeviceUseRequest copy() { + DeviceUseRequest dst = new DeviceUseRequest(); + copyValues(dst); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.mode = mode == null ? null : mode.copy(); + dst.device = device == null ? null : device.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + if (prnReason != null) { + dst.prnReason = new ArrayList(); + for (CodeableConcept i : prnReason) + dst.prnReason.add(i.copy()); + }; + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.timing = timing == null ? null : timing.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected DeviceUseRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) + && (mode == null || mode.isEmpty()) && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) + && (notes == null || notes.isEmpty()) && (prnReason == null || prnReason.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) + && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) + && (timing == null || timing.isEmpty()) && (priority == null || priority.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceUseRequest; + } + + @SearchParamDefinition(name="patient", path="DeviceUseRequest.subject", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="DeviceUseRequest.subject", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java index fc03125ebfc..f27963154d9 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java @@ -20,552 +20,552 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. - */ -@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement") -public class DeviceUseStatement extends DomainResource { - - /** - * Body site where the device was used. - */ - @Child(name="bodySite", type={CodeableConcept.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="Body site where the device was used." ) - protected List bodySite; - - /** - * The time period over which the device was used. - */ - @Child(name="whenUsed", type={Period.class}, order=0, min=0, max=1) - @Description(shortDefinition="", formalDefinition="The time period over which the device was used." ) - protected Period whenUsed; - - /** - * The details of the device used. - */ - @Child(name="device", type={Device.class}, order=1, min=1, max=1) - @Description(shortDefinition="", formalDefinition="The details of the device used." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The details of the device used.) - */ - protected Device deviceTarget; - - /** - * An external identifier for this statement such as an IRI. - */ - @Child(name="identifier", type={Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="An external identifier for this statement such as an IRI." ) - protected List identifier; - - /** - * Reason or justification for the use of the device. - */ - @Child(name="indication", type={CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="Reason or justification for the use of the device." ) - protected List indication; - - /** - * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. - */ - @Child(name="notes", type={StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) - protected List notes; - - /** - * The time at which the statement was made/recorded. - */ - @Child(name="recordedOn", type={DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="", formalDefinition="The time at which the statement was made/recorded." ) - protected DateTimeType recordedOn; - - /** - * The patient who used the device. - */ - @Child(name="subject", type={Patient.class}, order=6, min=1, max=1) - @Description(shortDefinition="", formalDefinition="The patient who used the device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who used the device.) - */ - protected Patient subjectTarget; - - /** - * How often the device was used. - */ - @Child(name="timing", type={Timing.class, Period.class, DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="", formalDefinition="How often the device was used." ) - protected Type timing; - - private static final long serialVersionUID = 523119888L; - - public DeviceUseStatement() { - super(); - } - - public DeviceUseStatement(Reference device, Reference subject) { - super(); - this.device = device; - this.subject = subject; - } - - /** - * @return {@link #bodySite} (Body site where the device was used.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Body site where the device was used.) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - /** - * @return {@link #whenUsed} (The time period over which the device was used.) - */ - public Period getWhenUsed() { - if (this.whenUsed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed"); - else if (Configuration.doAutoCreate()) - this.whenUsed = new Period(); - return this.whenUsed; - } - - public boolean hasWhenUsed() { - return this.whenUsed != null && !this.whenUsed.isEmpty(); - } - - /** - * @param value {@link #whenUsed} (The time period over which the device was used.) - */ - public DeviceUseStatement setWhenUsed(Period value) { - this.whenUsed = value; - return this; - } - - /** - * @return {@link #device} (The details of the device used.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The details of the device used.) - */ - public DeviceUseStatement setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} 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 details of the device used.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); - return this.deviceTarget; - } - - /** - * @param value {@link #device} 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 details of the device used.) - */ - public DeviceUseStatement setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #identifier} (An external identifier for this statement such as an IRI.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (An external identifier for this statement such as an IRI.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #indication} (Reason or justification for the use of the device.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - 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} (Reason or justification for the use of the device.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - /** - * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public DeviceUseStatement addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DateTimeType getRecordedOnElement() { - if (this.recordedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn"); - else if (Configuration.doAutoCreate()) - this.recordedOn = new DateTimeType(); - return this.recordedOn; - } - - public boolean hasRecordedOnElement() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - public boolean hasRecordedOn() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - /** - * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DeviceUseStatement setRecordedOnElement(DateTimeType value) { - this.recordedOn = value; - return this; - } - - /** - * @return The time at which the statement was made/recorded. - */ - 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(Date value) { - if (value == null) - this.recordedOn = null; - else { - if (this.recordedOn == null) - this.recordedOn = new DateTimeType(); - this.recordedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who used the device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.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 used the device.) - */ - public DeviceUseStatement 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 used the device.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.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 used the device.) - */ - public DeviceUseStatement setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Timing getTimingTiming() throws Exception { - if (!(this.timing instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (How often the device was used.) - */ - public DeviceUseStatement setTiming(Type value) { - this.timing = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bodySite", "CodeableConcept", "Body site where the device was used.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); - childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("notes", "string", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who used the device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, java.lang.Integer.MAX_VALUE, timing)); - } - - public DeviceUseStatement copy() { - DeviceUseStatement dst = new DeviceUseStatement(); - copyValues(dst); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - dst.whenUsed = whenUsed == null ? null : whenUsed.copy(); - dst.device = device == null ? null : device.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.timing = timing == null ? null : timing.copy(); - return dst; - } - - protected DeviceUseStatement typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (whenUsed == null || whenUsed.isEmpty()) - && (device == null || device.isEmpty()) && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) - && (notes == null || notes.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) - && (timing == null || timing.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceUseStatement; - } - - @SearchParamDefinition(name="patient", path="", description="Search by subject - a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - -} - + +/* + 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; +/** + * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + */ +@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement") +public class DeviceUseStatement extends DomainResource { + + /** + * Body site where the device was used. + */ + @Child(name="bodySite", type={CodeableConcept.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="Body site where the device was used." ) + protected List bodySite; + + /** + * The time period over which the device was used. + */ + @Child(name="whenUsed", type={Period.class}, order=0, min=0, max=1) + @Description(shortDefinition="", formalDefinition="The time period over which the device was used." ) + protected Period whenUsed; + + /** + * The details of the device used. + */ + @Child(name="device", type={Device.class}, order=1, min=1, max=1) + @Description(shortDefinition="", formalDefinition="The details of the device used." ) + protected Reference device; + + /** + * The actual object that is the target of the reference (The details of the device used.) + */ + protected Device deviceTarget; + + /** + * An external identifier for this statement such as an IRI. + */ + @Child(name="identifier", type={Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="An external identifier for this statement such as an IRI." ) + protected List identifier; + + /** + * Reason or justification for the use of the device. + */ + @Child(name="indication", type={CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="Reason or justification for the use of the device." ) + protected List indication; + + /** + * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + */ + @Child(name="notes", type={StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) + protected List notes; + + /** + * The time at which the statement was made/recorded. + */ + @Child(name="recordedOn", type={DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="", formalDefinition="The time at which the statement was made/recorded." ) + protected DateTimeType recordedOn; + + /** + * The patient who used the device. + */ + @Child(name="subject", type={Patient.class}, order=6, min=1, max=1) + @Description(shortDefinition="", formalDefinition="The patient who used the device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who used the device.) + */ + protected Patient subjectTarget; + + /** + * How often the device was used. + */ + @Child(name="timing", type={Timing.class, Period.class, DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="", formalDefinition="How often the device was used." ) + protected Type timing; + + private static final long serialVersionUID = 523119888L; + + public DeviceUseStatement() { + super(); + } + + public DeviceUseStatement(Reference device, Reference subject) { + super(); + this.device = device; + this.subject = subject; + } + + /** + * @return {@link #bodySite} (Body site where the device was used.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Body site where the device was used.) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + /** + * @return {@link #whenUsed} (The time period over which the device was used.) + */ + public Period getWhenUsed() { + if (this.whenUsed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed"); + else if (Configuration.doAutoCreate()) + this.whenUsed = new Period(); + return this.whenUsed; + } + + public boolean hasWhenUsed() { + return this.whenUsed != null && !this.whenUsed.isEmpty(); + } + + /** + * @param value {@link #whenUsed} (The time period over which the device was used.) + */ + public DeviceUseStatement setWhenUsed(Period value) { + this.whenUsed = value; + return this; + } + + /** + * @return {@link #device} (The details of the device used.) + */ + public Reference getDevice() { + if (this.device == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.device"); + else if (Configuration.doAutoCreate()) + this.device = new Reference(); + return this.device; + } + + public boolean hasDevice() { + return this.device != null && !this.device.isEmpty(); + } + + /** + * @param value {@link #device} (The details of the device used.) + */ + public DeviceUseStatement setDevice(Reference value) { + this.device = value; + return this; + } + + /** + * @return {@link #device} 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 details of the device used.) + */ + public Device getDeviceTarget() { + if (this.deviceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.device"); + else if (Configuration.doAutoCreate()) + this.deviceTarget = new Device(); + return this.deviceTarget; + } + + /** + * @param value {@link #device} 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 details of the device used.) + */ + public DeviceUseStatement setDeviceTarget(Device value) { + this.deviceTarget = value; + return this; + } + + /** + * @return {@link #identifier} (An external identifier for this statement such as an IRI.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (An external identifier for this statement such as an IRI.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #indication} (Reason or justification for the use of the device.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + 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} (Reason or justification for the use of the device.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + /** + * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public DeviceUseStatement addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DateTimeType getRecordedOnElement() { + if (this.recordedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn"); + else if (Configuration.doAutoCreate()) + this.recordedOn = new DateTimeType(); + return this.recordedOn; + } + + public boolean hasRecordedOnElement() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + public boolean hasRecordedOn() { + return this.recordedOn != null && !this.recordedOn.isEmpty(); + } + + /** + * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value + */ + public DeviceUseStatement setRecordedOnElement(DateTimeType value) { + this.recordedOn = value; + return this; + } + + /** + * @return The time at which the statement was made/recorded. + */ + 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(Date value) { + if (value == null) + this.recordedOn = null; + else { + if (this.recordedOn == null) + this.recordedOn = new DateTimeType(); + this.recordedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (The patient who used the device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.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 used the device.) + */ + public DeviceUseStatement 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 used the device.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceUseStatement.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 used the device.) + */ + public DeviceUseStatement setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Timing getTimingTiming() throws Exception { + if (!(this.timing instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + /** + * @return {@link #timing} (How often the device was used.) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (How often the device was used.) + */ + public DeviceUseStatement setTiming(Type value) { + this.timing = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bodySite", "CodeableConcept", "Body site where the device was used.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); + childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("notes", "string", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who used the device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, java.lang.Integer.MAX_VALUE, timing)); + } + + public DeviceUseStatement copy() { + DeviceUseStatement dst = new DeviceUseStatement(); + copyValues(dst); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + dst.whenUsed = whenUsed == null ? null : whenUsed.copy(); + dst.device = device == null ? null : device.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.timing = timing == null ? null : timing.copy(); + return dst; + } + + protected DeviceUseStatement typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (whenUsed == null || whenUsed.isEmpty()) + && (device == null || device.isEmpty()) && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) + && (notes == null || notes.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) + && (timing == null || timing.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceUseStatement; + } + + @SearchParamDefinition(name="patient", path="", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java index d82a13f5e09..7f305d10b12 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java @@ -20,1492 +20,1492 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A request for a diagnostic investigation service to be performed. - */ -@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") -public class DiagnosticOrder extends DomainResource { - - public enum DiagnosticOrderStatus implements FhirEnum { - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the order, but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the order, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work is complete, and the outcomes are being reviewed for approval. - */ - REVIEW, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("review".equals(codeString)) - return REVIEW; - 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 DiagnosticOrderStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case REVIEW: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - } - - public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { - public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return DiagnosticOrderStatus.REQUESTED; - if ("received".equals(codeString)) - return DiagnosticOrderStatus.RECEIVED; - if ("accepted".equals(codeString)) - return DiagnosticOrderStatus.ACCEPTED; - if ("in progress".equals(codeString)) - return DiagnosticOrderStatus.INPROGRESS; - if ("review".equals(codeString)) - return DiagnosticOrderStatus.REVIEW; - if ("completed".equals(codeString)) - return DiagnosticOrderStatus.COMPLETED; - if ("suspended".equals(codeString)) - return DiagnosticOrderStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return DiagnosticOrderStatus.REJECTED; - if ("failed".equals(codeString)) - return DiagnosticOrderStatus.FAILED; - throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); - } - public String toCode(DiagnosticOrderStatus code) throws IllegalArgumentException { - if (code == DiagnosticOrderStatus.REQUESTED) - return "requested"; - if (code == DiagnosticOrderStatus.RECEIVED) - return "received"; - if (code == DiagnosticOrderStatus.ACCEPTED) - return "accepted"; - if (code == DiagnosticOrderStatus.INPROGRESS) - return "in progress"; - if (code == DiagnosticOrderStatus.REVIEW) - return "review"; - if (code == DiagnosticOrderStatus.COMPLETED) - return "completed"; - if (code == DiagnosticOrderStatus.SUSPENDED) - return "suspended"; - if (code == DiagnosticOrderStatus.REJECTED) - return "rejected"; - if (code == DiagnosticOrderStatus.FAILED) - return "failed"; - return "?"; - } - } - - public enum DiagnosticOrderPriority implements FhirEnum { - /** - * The order has a normal priority. - */ - ROUTINE, - /** - * The order should be urgently. - */ - URGENT, - /** - * The order is time-critical. - */ - STAT, - /** - * The order should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return ""; - case URGENT: return ""; - case STAT: return ""; - case ASAP: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The order has a normal priority."; - case URGENT: return "The order should be urgently."; - case STAT: return "The order is time-critical."; - case ASAP: return "The order should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "ASAP"; - default: return "?"; - } - } - } - - public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { - public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return DiagnosticOrderPriority.ROUTINE; - if ("urgent".equals(codeString)) - return DiagnosticOrderPriority.URGENT; - if ("stat".equals(codeString)) - return DiagnosticOrderPriority.STAT; - if ("asap".equals(codeString)) - return DiagnosticOrderPriority.ASAP; - throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - public String toCode(DiagnosticOrderPriority code) throws IllegalArgumentException { - if (code == DiagnosticOrderPriority.ROUTINE) - return "routine"; - if (code == DiagnosticOrderPriority.URGENT) - return "urgent"; - if (code == DiagnosticOrderPriority.STAT) - return "stat"; - if (code == DiagnosticOrderPriority.ASAP) - return "asap"; - return "?"; - } - } - - @Block() - public static class DiagnosticOrderEventComponent extends BackboneElement { - /** - * The status for the event. - */ - @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status for the event." ) - protected Enumeration status; - - /** - * Additional information about the event that occurred - e.g. if the status remained unchanged. - */ - @Child(name="description", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="More information about the event and its context", formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged." ) - protected CodeableConcept description; - - /** - * The date/time at which the event occurred. - */ - @Child(name="dateTime", type={DateTimeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="The date at which the event happened", formalDefinition="The date/time at which the event occurred." ) - protected DateTimeType dateTime; - - /** - * The person who was responsible for performing or recording the action. - */ - @Child(name="actor", type={Practitioner.class, Device.class}, order=4, min=0, max=1) - @Description(shortDefinition="Who recorded or did this", formalDefinition="The person who was responsible for performing or recording the action." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The person who was responsible for performing or recording the action.) - */ - protected Resource actorTarget; - - private static final long serialVersionUID = -370793723L; - - public DiagnosticOrderEventComponent() { - super(); - } - - public DiagnosticOrderEventComponent(Enumeration status, DateTimeType dateTime) { - super(); - this.status = status; - this.dateTime = dateTime; - } - - /** - * @return {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrderEventComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status for the event. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status for the event. - */ - public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { - if (this.status == null) - this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) - */ - public CodeableConcept getDescription() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new CodeableConcept(); - return this.description; - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) - */ - public DiagnosticOrderEventComponent setDescription(CodeableConcept value) { - this.description = value; - return this; - } - - /** - * @return {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DiagnosticOrderEventComponent setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date/time at which the event occurred. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date/time at which the event occurred. - */ - public DiagnosticOrderEventComponent setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #actor} (The person who was responsible for performing or recording the action.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The person who was responsible for performing or recording the action.) - */ - public DiagnosticOrderEventComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) - */ - public DiagnosticOrderEventComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The status for the event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("description", "CodeableConcept", "Additional information about the event that occurred - e.g. if the status remained unchanged.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("dateTime", "dateTime", "The date/time at which the event occurred.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("actor", "Reference(Practitioner|Device)", "The person who was responsible for performing or recording the action.", 0, java.lang.Integer.MAX_VALUE, actor)); - } - - public DiagnosticOrderEventComponent copy() { - DiagnosticOrderEventComponent dst = new DiagnosticOrderEventComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.description = description == null ? null : description.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.actor = actor == null ? null : actor.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) - && (dateTime == null || dateTime.isEmpty()) && (actor == null || actor.isEmpty()); - } - - } - - @Block() - public static class DiagnosticOrderItemComponent extends BackboneElement { - /** - * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code to indicate the item (test or panel) being ordered", formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested." ) - protected CodeableConcept code; - - /** - * If the item is related to a specific speciment. - */ - @Child(name="specimen", type={Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If this item relates to specific specimens", formalDefinition="If the item is related to a specific speciment." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (If the item is related to a specific speciment.) - */ - protected List specimenTarget; - - - /** - * Anatomical location where the request test should be performed. - */ - @Child(name="bodySite", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Location of requested test (if applicable)", formalDefinition="Anatomical location where the request test should be performed." ) - protected CodeableConcept bodySite; - - /** - * The status of this individual item within the order. - */ - @Child(name="status", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of this individual item within the order." ) - protected Enumeration status; - - /** - * A summary of the events of interest that have occurred as this item of the request is processed. - */ - @Child(name="event", type={DiagnosticOrderEventComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Events specific to this item", formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed." ) - protected List event; - - private static final long serialVersionUID = 381238192L; - - public DiagnosticOrderItemComponent() { - super(); - } - - public DiagnosticOrderItemComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) - */ - public DiagnosticOrderItemComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #specimen} (If the item is related to a specific speciment.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (If the item is related to a specific speciment.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - /** - * @return {@link #specimen} (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. If the item is related to a specific speciment.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (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. If the item is related to a specific speciment.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #bodySite} (Anatomical location where the request test should be performed.) - */ - public CodeableConcept getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Anatomical location where the request test should be performed.) - */ - public DiagnosticOrderItemComponent setBodySite(CodeableConcept value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrderItemComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this individual item within the order. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this individual item within the order. - */ - public DiagnosticOrderItemComponent setStatus(DiagnosticOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DiagnosticOrderEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) - */ - // syntactic sugar - public DiagnosticOrderEventComponent addEvent() { //3 - DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "If the item is related to a specific speciment.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Anatomical location where the request test should be performed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("status", "code", "The status of this individual item within the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("event", "@DiagnosticOrder.event", "A summary of the events of interest that have occurred as this item of the request is processed.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - public DiagnosticOrderItemComponent copy() { - DiagnosticOrderItemComponent dst = new DiagnosticOrderItemComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.status = status == null ? null : status.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (DiagnosticOrderEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (specimen == null || specimen.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) && (event == null || event.isEmpty()) - ; - } - - } - - /** - * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). - */ - @Child(name="subject", type={Patient.class, Group.class, Location.class, Device.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Who and/or what test is about", formalDefinition="Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - protected Resource subjectTarget; - - /** - * The practitioner that holds legal responsibility for ordering the investigation. - */ - @Child(name="orderer", type={Practitioner.class}, order=0, min=0, max=1) - @Description(shortDefinition="Who ordered the test", formalDefinition="The practitioner that holds legal responsibility for ordering the investigation." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the investigation.) - */ - protected Practitioner ordererTarget; - - /** - * Identifiers assigned to this order by the order or by the receiver. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) - protected List identifier; - - /** - * An encounter that provides additional information about the healthcare context in which this request is made. - */ - @Child(name="encounter", type={Encounter.class}, order=2, min=0, max=1) - @Description(shortDefinition="The encounter that this diagnostic order is associated with", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * An explanation or justification for why this diagnostic investigation is being requested. - */ - @Child(name="clinicalNotes", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested." ) - protected StringType clinicalNotes; - - /** - * Additional clinical information about the patient or specimen that may influence test interpretations. - */ - @Child(name="supportingInformation", type={Observation.class, Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supporting observations or conditions for this request", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - protected List supportingInformationTarget; - - - /** - * One or more specimens that the diagnostic investigation is about. - */ - @Child(name="specimen", type={Specimen.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="If the whole order relates to specific specimens", formalDefinition="One or more specimens that the diagnostic investigation is about." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (One or more specimens that the diagnostic investigation is about.) - */ - protected List specimenTarget; - - - /** - * The status of the order. - */ - @Child(name="status", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the order." ) - protected Enumeration status; - - /** - * The clinical priority associated with this order. - */ - @Child(name="priority", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) - protected Enumeration priority; - - /** - * A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed. - */ - @Child(name="event", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A list of events of interest in the lifecycle", formalDefinition="A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed." ) - protected List event; - - /** - * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested. - */ - @Child(name="item", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The items the orderer requested", formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested." ) - protected List item; - - private static final long serialVersionUID = 1028294242L; - - public DiagnosticOrder() { - super(); - } - - public DiagnosticOrder(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #subject} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.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} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public DiagnosticOrder 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. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public Resource getSubjectTarget() { - 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. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) - */ - public DiagnosticOrder setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public DiagnosticOrder setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} 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 practitioner that holds legal responsibility for ordering the investigation.) - */ - public Practitioner getOrdererTarget() { - if (this.ordererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.ordererTarget = new Practitioner(); - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} 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 that holds legal responsibility for ordering the investigation.) - */ - public DiagnosticOrder setOrdererTarget(Practitioner value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this order by the order or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.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} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public DiagnosticOrder 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. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.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. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public DiagnosticOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value - */ - public StringType getClinicalNotesElement() { - if (this.clinicalNotes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.clinicalNotes"); - else if (Configuration.doAutoCreate()) - this.clinicalNotes = new StringType(); - return this.clinicalNotes; - } - - public boolean hasClinicalNotesElement() { - return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); - } - - public boolean hasClinicalNotes() { - return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); - } - - /** - * @param value {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value - */ - public DiagnosticOrder setClinicalNotesElement(StringType value) { - this.clinicalNotes = value; - return this; - } - - /** - * @return An explanation or justification for why this diagnostic investigation is being requested. - */ - public String getClinicalNotes() { - return this.clinicalNotes == null ? null : this.clinicalNotes.getValue(); - } - - /** - * @param value An explanation or justification for why this diagnostic investigation is being requested. - */ - public DiagnosticOrder setClinicalNotes(String value) { - if (Utilities.noString(value)) - this.clinicalNotes = null; - else { - if (this.clinicalNotes == null) - this.clinicalNotes = new StringType(); - this.clinicalNotes.setValue(value); - } - return this; - } - - /** - * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - /** - * @return {@link #supportingInformation} (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. Additional clinical information about the patient or specimen that may influence test interpretations.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - /** - * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - /** - * @return {@link #specimen} (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. One or more specimens that the diagnostic investigation is about.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (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. One or more specimens that the diagnostic investigation is about.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the order. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the order. - */ - public DiagnosticOrder setStatus(DiagnosticOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(); - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public DiagnosticOrder setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The clinical priority associated with this order. - */ - public DiagnosticOrderPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The clinical priority associated with this order. - */ - public DiagnosticOrder setPriority(DiagnosticOrderPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(DiagnosticOrderPriority.ENUM_FACTORY); - this.priority.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DiagnosticOrderEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) - */ - // syntactic sugar - public DiagnosticOrderEventComponent addEvent() { //3 - DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - /** - * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (DiagnosticOrderItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) - */ - // syntactic sugar - public DiagnosticOrderItemComponent addItem() { //3 - DiagnosticOrderItemComponent t = new DiagnosticOrderItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("clinicalNotes", "string", "An explanation or justification for why this diagnostic investigation is being requested.", 0, java.lang.Integer.MAX_VALUE, clinicalNotes)); - childrenList.add(new Property("supportingInformation", "Reference(Observation|Condition)", "Additional clinical information about the patient or specimen that may influence test interpretations.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the diagnostic investigation is about.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("event", "", "A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("item", "", "The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public DiagnosticOrder copy() { - DiagnosticOrder dst = new DiagnosticOrder(); - copyValues(dst); - dst.subject = subject == null ? null : subject.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - dst.clinicalNotes = clinicalNotes == null ? null : clinicalNotes.copy(); - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.priority = priority == null ? null : priority.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (DiagnosticOrderEventComponent i : event) - dst.event.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (DiagnosticOrderItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - protected DiagnosticOrder typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (subject == null || subject.isEmpty()) && (orderer == null || orderer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (clinicalNotes == null || clinicalNotes.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (status == null || status.isEmpty()) && (priority == null || priority.isEmpty()) - && (event == null || event.isEmpty()) && (item == null || item.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DiagnosticOrder; - } - - @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="Who ordered the test", type="reference" ) - public static final String SP_ORDERER = "orderer"; - @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) - public static final String SP_ITEMSTATUS = "item-status"; - @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) - public static final String SP_EVENTSTATUS = "event-status"; - @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor|DiagnosticOrder.item.event.actor", description="Who recorded or did this", type="reference" ) - public static final String SP_ACTOR = "actor"; - @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="Code to indicate the item (test or panel) being ordered", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="The encounter that this diagnostic order is associated with", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) - public static final String SP_ITEMPASTSTATUS = "item-past-status"; - @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite", description="Location of requested test (if applicable)", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="The date at which the event happened", type="date" ) - public static final String SP_ITEMDATE = "item-date"; - @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen|DiagnosticOrder.item.specimen", description="If the whole order relates to specific specimens", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - @SearchParamDefinition(name="event-status-date", path="", description="A combination of past-status and date", type="composite" ) - public static final String SP_EVENTSTATUSDATE = "event-status-date"; - @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="The date at which the event happened", type="date" ) - public static final String SP_EVENTDATE = "event-date"; - @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="Identifiers assigned to this order", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="item-status-date", path="", description="A combination of item-past-status and item-date", type="composite" ) - public static final String SP_ITEMSTATUSDATE = "item-status-date"; - -} - + +/* + 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; +/** + * A request for a diagnostic investigation service to be performed. + */ +@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") +public class DiagnosticOrder extends DomainResource { + + public enum DiagnosticOrderStatus implements FhirEnum { + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the order, but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the order, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the order is happening. + */ + INPROGRESS, + /** + * The work is complete, and the outcomes are being reviewed for approval. + */ + REVIEW, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("review".equals(codeString)) + return REVIEW; + 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 DiagnosticOrderStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case REVIEW: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the order is happening."; + case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + } + + public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { + public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return DiagnosticOrderStatus.REQUESTED; + if ("received".equals(codeString)) + return DiagnosticOrderStatus.RECEIVED; + if ("accepted".equals(codeString)) + return DiagnosticOrderStatus.ACCEPTED; + if ("in progress".equals(codeString)) + return DiagnosticOrderStatus.INPROGRESS; + if ("review".equals(codeString)) + return DiagnosticOrderStatus.REVIEW; + if ("completed".equals(codeString)) + return DiagnosticOrderStatus.COMPLETED; + if ("suspended".equals(codeString)) + return DiagnosticOrderStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return DiagnosticOrderStatus.REJECTED; + if ("failed".equals(codeString)) + return DiagnosticOrderStatus.FAILED; + throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + } + public String toCode(DiagnosticOrderStatus code) throws IllegalArgumentException { + if (code == DiagnosticOrderStatus.REQUESTED) + return "requested"; + if (code == DiagnosticOrderStatus.RECEIVED) + return "received"; + if (code == DiagnosticOrderStatus.ACCEPTED) + return "accepted"; + if (code == DiagnosticOrderStatus.INPROGRESS) + return "in progress"; + if (code == DiagnosticOrderStatus.REVIEW) + return "review"; + if (code == DiagnosticOrderStatus.COMPLETED) + return "completed"; + if (code == DiagnosticOrderStatus.SUSPENDED) + return "suspended"; + if (code == DiagnosticOrderStatus.REJECTED) + return "rejected"; + if (code == DiagnosticOrderStatus.FAILED) + return "failed"; + return "?"; + } + } + + public enum DiagnosticOrderPriority implements FhirEnum { + /** + * The order has a normal priority. + */ + ROUTINE, + /** + * The order should be urgently. + */ + URGENT, + /** + * The order is time-critical. + */ + STAT, + /** + * The order should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return ""; + case URGENT: return ""; + case STAT: return ""; + case ASAP: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The order has a normal priority."; + case URGENT: return "The order should be urgently."; + case STAT: return "The order is time-critical."; + case ASAP: return "The order should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "Routine"; + case URGENT: return "Urgent"; + case STAT: return "Stat"; + case ASAP: return "ASAP"; + default: return "?"; + } + } + } + + public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { + public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return DiagnosticOrderPriority.ROUTINE; + if ("urgent".equals(codeString)) + return DiagnosticOrderPriority.URGENT; + if ("stat".equals(codeString)) + return DiagnosticOrderPriority.STAT; + if ("asap".equals(codeString)) + return DiagnosticOrderPriority.ASAP; + throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + } + public String toCode(DiagnosticOrderPriority code) throws IllegalArgumentException { + if (code == DiagnosticOrderPriority.ROUTINE) + return "routine"; + if (code == DiagnosticOrderPriority.URGENT) + return "urgent"; + if (code == DiagnosticOrderPriority.STAT) + return "stat"; + if (code == DiagnosticOrderPriority.ASAP) + return "asap"; + return "?"; + } + } + + @Block() + public static class DiagnosticOrderEventComponent extends BackboneElement { + /** + * The status for the event. + */ + @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status for the event." ) + protected Enumeration status; + + /** + * Additional information about the event that occurred - e.g. if the status remained unchanged. + */ + @Child(name="description", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="More information about the event and its context", formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged." ) + protected CodeableConcept description; + + /** + * The date/time at which the event occurred. + */ + @Child(name="dateTime", type={DateTimeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="The date at which the event happened", formalDefinition="The date/time at which the event occurred." ) + protected DateTimeType dateTime; + + /** + * The person who was responsible for performing or recording the action. + */ + @Child(name="actor", type={Practitioner.class, Device.class}, order=4, min=0, max=1) + @Description(shortDefinition="Who recorded or did this", formalDefinition="The person who was responsible for performing or recording the action." ) + protected Reference actor; + + /** + * The actual object that is the target of the reference (The person who was responsible for performing or recording the action.) + */ + protected Resource actorTarget; + + private static final long serialVersionUID = -370793723L; + + public DiagnosticOrderEventComponent() { + super(); + } + + public DiagnosticOrderEventComponent(Enumeration status, DateTimeType dateTime) { + super(); + this.status = status; + this.dateTime = dateTime; + } + + /** + * @return {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrderEventComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status for the event. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status for the event. + */ + public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { + if (this.status == null) + this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) + */ + public CodeableConcept getDescription() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.description"); + else if (Configuration.doAutoCreate()) + this.description = new CodeableConcept(); + return this.description; + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) + */ + public DiagnosticOrderEventComponent setDescription(CodeableConcept value) { + this.description = value; + return this; + } + + /** + * @return {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DiagnosticOrderEventComponent setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date/time at which the event occurred. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date/time at which the event occurred. + */ + public DiagnosticOrderEventComponent setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #actor} (The person who was responsible for performing or recording the action.) + */ + public Reference getActor() { + if (this.actor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.actor"); + else if (Configuration.doAutoCreate()) + this.actor = new Reference(); + return this.actor; + } + + public boolean hasActor() { + return this.actor != null && !this.actor.isEmpty(); + } + + /** + * @param value {@link #actor} (The person who was responsible for performing or recording the action.) + */ + public DiagnosticOrderEventComponent setActor(Reference value) { + this.actor = value; + return this; + } + + /** + * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) + */ + public Resource getActorTarget() { + return this.actorTarget; + } + + /** + * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who was responsible for performing or recording the action.) + */ + public DiagnosticOrderEventComponent setActorTarget(Resource value) { + this.actorTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The status for the event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("description", "CodeableConcept", "Additional information about the event that occurred - e.g. if the status remained unchanged.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("dateTime", "dateTime", "The date/time at which the event occurred.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("actor", "Reference(Practitioner|Device)", "The person who was responsible for performing or recording the action.", 0, java.lang.Integer.MAX_VALUE, actor)); + } + + public DiagnosticOrderEventComponent copy() { + DiagnosticOrderEventComponent dst = new DiagnosticOrderEventComponent(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.description = description == null ? null : description.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.actor = actor == null ? null : actor.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) + && (dateTime == null || dateTime.isEmpty()) && (actor == null || actor.isEmpty()); + } + + } + + @Block() + public static class DiagnosticOrderItemComponent extends BackboneElement { + /** + * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code to indicate the item (test or panel) being ordered", formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested." ) + protected CodeableConcept code; + + /** + * If the item is related to a specific speciment. + */ + @Child(name="specimen", type={Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If this item relates to specific specimens", formalDefinition="If the item is related to a specific speciment." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (If the item is related to a specific speciment.) + */ + protected List specimenTarget; + + + /** + * Anatomical location where the request test should be performed. + */ + @Child(name="bodySite", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Location of requested test (if applicable)", formalDefinition="Anatomical location where the request test should be performed." ) + protected CodeableConcept bodySite; + + /** + * The status of this individual item within the order. + */ + @Child(name="status", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of this individual item within the order." ) + protected Enumeration status; + + /** + * A summary of the events of interest that have occurred as this item of the request is processed. + */ + @Child(name="event", type={DiagnosticOrderEventComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Events specific to this item", formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed." ) + protected List event; + + private static final long serialVersionUID = 381238192L; + + public DiagnosticOrderItemComponent() { + super(); + } + + public DiagnosticOrderItemComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) + */ + public DiagnosticOrderItemComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #specimen} (If the item is related to a specific speciment.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (If the item is related to a specific speciment.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + /** + * @return {@link #specimen} (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. If the item is related to a specific speciment.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (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. If the item is related to a specific speciment.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #bodySite} (Anatomical location where the request test should be performed.) + */ + public CodeableConcept getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Anatomical location where the request test should be performed.) + */ + public DiagnosticOrderItemComponent setBodySite(CodeableConcept value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrderItemComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this individual item within the order. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this individual item within the order. + */ + public DiagnosticOrderItemComponent setStatus(DiagnosticOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DiagnosticOrderEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) + */ + // syntactic sugar + public DiagnosticOrderEventComponent addEvent() { //3 + DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "If the item is related to a specific speciment.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Anatomical location where the request test should be performed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("status", "code", "The status of this individual item within the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("event", "@DiagnosticOrder.event", "A summary of the events of interest that have occurred as this item of the request is processed.", 0, java.lang.Integer.MAX_VALUE, event)); + } + + public DiagnosticOrderItemComponent copy() { + DiagnosticOrderItemComponent dst = new DiagnosticOrderItemComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.status = status == null ? null : status.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (DiagnosticOrderEventComponent i : event) + dst.event.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (specimen == null || specimen.isEmpty()) + && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) && (event == null || event.isEmpty()) + ; + } + + } + + /** + * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). + */ + @Child(name="subject", type={Patient.class, Group.class, Location.class, Device.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Who and/or what test is about", formalDefinition="Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + protected Resource subjectTarget; + + /** + * The practitioner that holds legal responsibility for ordering the investigation. + */ + @Child(name="orderer", type={Practitioner.class}, order=0, min=0, max=1) + @Description(shortDefinition="Who ordered the test", formalDefinition="The practitioner that holds legal responsibility for ordering the investigation." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the investigation.) + */ + protected Practitioner ordererTarget; + + /** + * Identifiers assigned to this order by the order or by the receiver. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) + protected List identifier; + + /** + * An encounter that provides additional information about the healthcare context in which this request is made. + */ + @Child(name="encounter", type={Encounter.class}, order=2, min=0, max=1) + @Description(shortDefinition="The encounter that this diagnostic order is associated with", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * An explanation or justification for why this diagnostic investigation is being requested. + */ + @Child(name="clinicalNotes", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested." ) + protected StringType clinicalNotes; + + /** + * Additional clinical information about the patient or specimen that may influence test interpretations. + */ + @Child(name="supportingInformation", type={Observation.class, Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supporting observations or conditions for this request", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + protected List supportingInformationTarget; + + + /** + * One or more specimens that the diagnostic investigation is about. + */ + @Child(name="specimen", type={Specimen.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="If the whole order relates to specific specimens", formalDefinition="One or more specimens that the diagnostic investigation is about." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (One or more specimens that the diagnostic investigation is about.) + */ + protected List specimenTarget; + + + /** + * The status of the order. + */ + @Child(name="status", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the order." ) + protected Enumeration status; + + /** + * The clinical priority associated with this order. + */ + @Child(name="priority", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) + protected Enumeration priority; + + /** + * A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed. + */ + @Child(name="event", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A list of events of interest in the lifecycle", formalDefinition="A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed." ) + protected List event; + + /** + * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested. + */ + @Child(name="item", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The items the orderer requested", formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested." ) + protected List item; + + private static final long serialVersionUID = 1028294242L; + + public DiagnosticOrder() { + super(); + } + + public DiagnosticOrder(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #subject} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.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} (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public DiagnosticOrder 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. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public Resource getSubjectTarget() { + 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. (Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).) + */ + public DiagnosticOrder setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) + */ + public DiagnosticOrder setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} 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 practitioner that holds legal responsibility for ordering the investigation.) + */ + public Practitioner getOrdererTarget() { + if (this.ordererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.ordererTarget = new Practitioner(); + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} 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 that holds legal responsibility for ordering the investigation.) + */ + public DiagnosticOrder setOrdererTarget(Practitioner value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this order by the order or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.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} (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public DiagnosticOrder 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. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.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. (An encounter that provides additional information about the healthcare context in which this request is made.) + */ + public DiagnosticOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value + */ + public StringType getClinicalNotesElement() { + if (this.clinicalNotes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.clinicalNotes"); + else if (Configuration.doAutoCreate()) + this.clinicalNotes = new StringType(); + return this.clinicalNotes; + } + + public boolean hasClinicalNotesElement() { + return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); + } + + public boolean hasClinicalNotes() { + return this.clinicalNotes != null && !this.clinicalNotes.isEmpty(); + } + + /** + * @param value {@link #clinicalNotes} (An explanation or justification for why this diagnostic investigation is being requested.). This is the underlying object with id, value and extensions. The accessor "getClinicalNotes" gives direct access to the value + */ + public DiagnosticOrder setClinicalNotesElement(StringType value) { + this.clinicalNotes = value; + return this; + } + + /** + * @return An explanation or justification for why this diagnostic investigation is being requested. + */ + public String getClinicalNotes() { + return this.clinicalNotes == null ? null : this.clinicalNotes.getValue(); + } + + /** + * @param value An explanation or justification for why this diagnostic investigation is being requested. + */ + public DiagnosticOrder setClinicalNotes(String value) { + if (Utilities.noString(value)) + this.clinicalNotes = null; + else { + if (this.clinicalNotes == null) + this.clinicalNotes = new StringType(); + this.clinicalNotes.setValue(value); + } + return this; + } + + /** + * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + /** + * @return {@link #supportingInformation} (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. Additional clinical information about the patient or specimen that may influence test interpretations.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + /** + * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + /** + * @return {@link #specimen} (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. One or more specimens that the diagnostic investigation is about.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (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. One or more specimens that the diagnostic investigation is about.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the order. + */ + public DiagnosticOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the order. + */ + public DiagnosticOrder setStatus(DiagnosticOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticOrder.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(); + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public DiagnosticOrder setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The clinical priority associated with this order. + */ + public DiagnosticOrderPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The clinical priority associated with this order. + */ + public DiagnosticOrder setPriority(DiagnosticOrderPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(DiagnosticOrderPriority.ENUM_FACTORY); + this.priority.setValue(value); + } + return this; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (DiagnosticOrderEventComponent item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.) + */ + // syntactic sugar + public DiagnosticOrderEventComponent addEvent() { //3 + DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + /** + * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (DiagnosticOrderItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.) + */ + // syntactic sugar + public DiagnosticOrderItemComponent addItem() { //3 + DiagnosticOrderItemComponent t = new DiagnosticOrderItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("clinicalNotes", "string", "An explanation or justification for why this diagnostic investigation is being requested.", 0, java.lang.Integer.MAX_VALUE, clinicalNotes)); + childrenList.add(new Property("supportingInformation", "Reference(Observation|Condition)", "Additional clinical information about the patient or specimen that may influence test interpretations.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the diagnostic investigation is about.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("event", "", "A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("item", "", "The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public DiagnosticOrder copy() { + DiagnosticOrder dst = new DiagnosticOrder(); + copyValues(dst); + dst.subject = subject == null ? null : subject.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + dst.clinicalNotes = clinicalNotes == null ? null : clinicalNotes.copy(); + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.priority = priority == null ? null : priority.copy(); + if (event != null) { + dst.event = new ArrayList(); + for (DiagnosticOrderEventComponent i : event) + dst.event.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (DiagnosticOrderItemComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + protected DiagnosticOrder typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (subject == null || subject.isEmpty()) && (orderer == null || orderer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (clinicalNotes == null || clinicalNotes.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (status == null || status.isEmpty()) && (priority == null || priority.isEmpty()) + && (event == null || event.isEmpty()) && (item == null || item.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DiagnosticOrder; + } + + @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="Who ordered the test", type="reference" ) + public static final String SP_ORDERER = "orderer"; + @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) + public static final String SP_ITEMSTATUS = "item-status"; + @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) + public static final String SP_EVENTSTATUS = "event-status"; + @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor|DiagnosticOrder.item.event.actor", description="Who recorded or did this", type="reference" ) + public static final String SP_ACTOR = "actor"; + @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="Code to indicate the item (test or panel) being ordered", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="The encounter that this diagnostic order is associated with", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", type="token" ) + public static final String SP_ITEMPASTSTATUS = "item-past-status"; + @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite", description="Location of requested test (if applicable)", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="The date at which the event happened", type="date" ) + public static final String SP_ITEMDATE = "item-date"; + @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen|DiagnosticOrder.item.specimen", description="If the whole order relates to specific specimens", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + @SearchParamDefinition(name="event-status-date", path="", description="A combination of past-status and date", type="composite" ) + public static final String SP_EVENTSTATUSDATE = "event-status-date"; + @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="The date at which the event happened", type="date" ) + public static final String SP_EVENTDATE = "event-date"; + @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="Identifiers assigned to this order", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="item-status-date", path="", description="A combination of item-past-status and item-date", type="composite" ) + public static final String SP_ITEMSTATUSDATE = "item-status-date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java index db026a6de24..afcdb2ab716 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java @@ -20,1253 +20,1253 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. - */ -@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") -public class DiagnosticReport extends DomainResource { - - public enum DiagnosticReportStatus implements FhirEnum { - /** - * The existence of the report is registered, but there is nothing yet available. - */ - REGISTERED, - /** - * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified. - */ - PARTIAL, - /** - * The report is complete and verified by an authorized person. - */ - FINAL, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. - */ - CORRECTED, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person, and data has been changed. - */ - AMENDED, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed. - */ - APPENDED, - /** - * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). - */ - CANCELLED, - /** - * The report has been withdrawn following previous Final release. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REGISTERED; - if ("partial".equals(codeString)) - return PARTIAL; - if ("final".equals(codeString)) - return FINAL; - if ("corrected".equals(codeString)) - return CORRECTED; - if ("amended".equals(codeString)) - return AMENDED; - if ("appended".equals(codeString)) - return APPENDED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REGISTERED: return "registered"; - case PARTIAL: return "partial"; - case FINAL: return "final"; - case CORRECTED: return "corrected"; - case AMENDED: return "amended"; - case APPENDED: return "appended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REGISTERED: return ""; - case PARTIAL: return ""; - case FINAL: return ""; - case CORRECTED: return ""; - case AMENDED: return ""; - case APPENDED: return ""; - case CANCELLED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REGISTERED: return "The existence of the report is registered, but there is nothing yet available."; - case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified."; - case FINAL: return "The report is complete and verified by an authorized person."; - case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person."; - case AMENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person, and data has been changed."; - case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed."; - case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; - case ENTEREDINERROR: return "The report has been withdrawn following previous Final release."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REGISTERED: return "registered"; - case PARTIAL: return "partial"; - case FINAL: return "final"; - case CORRECTED: return "corrected"; - case AMENDED: return "amended"; - case APPENDED: return "appended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - } - - public static class DiagnosticReportStatusEnumFactory implements EnumFactory { - public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return DiagnosticReportStatus.REGISTERED; - if ("partial".equals(codeString)) - return DiagnosticReportStatus.PARTIAL; - if ("final".equals(codeString)) - return DiagnosticReportStatus.FINAL; - if ("corrected".equals(codeString)) - return DiagnosticReportStatus.CORRECTED; - if ("amended".equals(codeString)) - return DiagnosticReportStatus.AMENDED; - if ("appended".equals(codeString)) - return DiagnosticReportStatus.APPENDED; - if ("cancelled".equals(codeString)) - return DiagnosticReportStatus.CANCELLED; - if ("entered in error".equals(codeString)) - return DiagnosticReportStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - public String toCode(DiagnosticReportStatus code) throws IllegalArgumentException { - if (code == DiagnosticReportStatus.REGISTERED) - return "registered"; - if (code == DiagnosticReportStatus.PARTIAL) - return "partial"; - if (code == DiagnosticReportStatus.FINAL) - return "final"; - if (code == DiagnosticReportStatus.CORRECTED) - return "corrected"; - if (code == DiagnosticReportStatus.AMENDED) - return "amended"; - if (code == DiagnosticReportStatus.APPENDED) - return "appended"; - if (code == DiagnosticReportStatus.CANCELLED) - return "cancelled"; - if (code == DiagnosticReportStatus.ENTEREDINERROR) - return "entered in error"; - return "?"; - } - } - - @Block() - public static class DiagnosticReportImageComponent extends BackboneElement { - /** - * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. - */ - @Child(name="comment", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Comment about the image (e.g. explanation)", formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features." ) - protected StringType comment; - - /** - * Reference to the image source. - */ - @Child(name="link", type={Media.class}, order=2, min=1, max=1) - @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." ) - protected Reference link; - - /** - * The actual object that is the target of the reference (Reference to the image source.) - */ - protected Media linkTarget; - - private static final long serialVersionUID = 935791940L; - - public DiagnosticReportImageComponent() { - super(); - } - - public DiagnosticReportImageComponent(Reference link) { - super(); - this.link = link; - } - - /** - * @return {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public DiagnosticReportImageComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. - */ - public DiagnosticReportImageComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #link} (Reference to the image source.) - */ - public Reference getLink() { - if (this.link == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); - else if (Configuration.doAutoCreate()) - this.link = new Reference(); - return this.link; - } - - public boolean hasLink() { - return this.link != null && !this.link.isEmpty(); - } - - /** - * @param value {@link #link} (Reference to the image source.) - */ - public DiagnosticReportImageComponent setLink(Reference value) { - this.link = value; - return this; - } - - /** - * @return {@link #link} 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. (Reference to the image source.) - */ - public Media getLinkTarget() { - if (this.linkTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); - else if (Configuration.doAutoCreate()) - this.linkTarget = new Media(); - return this.linkTarget; - } - - /** - * @param value {@link #link} 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 image source.) - */ - public DiagnosticReportImageComponent setLinkTarget(Media value) { - this.linkTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - public DiagnosticReportImageComponent copy() { - DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent(); - copyValues(dst); - dst.comment = comment == null ? null : comment.copy(); - dst.link = link == null ? null : link.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty()) - ; - } - - } - - /** - * A code or name that describes this diagnostic report. - */ - @Child(name="name", type={CodeableConcept.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." ) - protected CodeableConcept name; - - /** - * The status of the diagnostic report as a whole. - */ - @Child(name="status", type={CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="registered | partial | final | corrected +", formalDefinition="The status of the diagnostic report as a whole." ) - protected Enumeration status; - - /** - * The date and/or time that this version of the report was released from the source diagnostic service. - */ - @Child(name="issued", type={DateTimeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Date this version was released", formalDefinition="The date and/or time that this version of the report was released from the source diagnostic service." ) - protected DateTimeType issued; - - /** - * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. - */ - @Child(name="subject", type={Patient.class, Group.class, Device.class, Location.class}, order=2, min=1, max=1) - @Description(shortDefinition="The subject of the report, usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - protected Resource subjectTarget; - - /** - * The diagnostic service that is responsible for issuing the report. - */ - @Child(name="performer", type={Practitioner.class, Organization.class}, order=3, min=1, max=1) - @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.) - */ - protected Resource performerTarget; - - /** - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. - */ - @Child(name="identifier", type={Identifier.class}, order=4, min=0, max=1) - @Description(shortDefinition="Id for external references to this report", formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider." ) - protected Identifier identifier; - - /** - * Details concerning a test requested. - */ - @Child(name="requestDetail", type={DiagnosticOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test requested." ) - protected List requestDetail; - /** - * The actual objects that are the target of the reference (Details concerning a test requested.) - */ - protected List requestDetailTarget; - - - /** - * The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI. - */ - @Child(name="serviceCategory", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Biochemistry, Hematology etc.", formalDefinition="The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI." ) - protected CodeableConcept serviceCategory; - - /** - * The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. - */ - @Child(name="diagnostic", type={DateTimeType.class, Period.class}, order=7, min=1, max=1) - @Description(shortDefinition="Physiologically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." ) - protected Type diagnostic; - - /** - * Details about the specimens on which this Disagnostic report is based. - */ - @Child(name="specimen", type={Specimen.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this Disagnostic report is based." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (Details about the specimens on which this Disagnostic report is based.) - */ - protected List specimenTarget; - - - /** - * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels"). - */ - @Child(name="result", type={Observation.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Observations - simple, or complex nested groups", formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels')." ) - protected List result; - /** - * The actual objects that are the target of the reference (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - protected List resultTarget; - - - /** - * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. - */ - @Child(name="imagingStudy", type={ImagingStudy.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reference to full details of imaging associated with the diagnostic report", formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images." ) - protected List imagingStudy; - /** - * The actual objects that are the target of the reference (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - protected List imagingStudyTarget; - - - /** - * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). - */ - @Child(name="image", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Key images associated with this report", formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)." ) - protected List image; - - /** - * Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - @Child(name="conclusion", type={StringType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." ) - protected StringType conclusion; - - /** - * Codes for the conclusion. - */ - @Child(name="codedDiagnosis", type={CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." ) - protected List codedDiagnosis; - - /** - * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. - */ - @Child(name="presentedForm", type={Attachment.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Entire Report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." ) - protected List presentedForm; - - private static final long serialVersionUID = -1414376119L; - - public DiagnosticReport() { - super(); - } - - public DiagnosticReport(CodeableConcept name, Enumeration status, DateTimeType issued, Reference subject, Reference performer, Type diagnostic) { - super(); - this.name = name; - this.status = status; - this.issued = issued; - this.subject = subject; - this.performer = performer; - this.diagnostic = diagnostic; - } - - /** - * @return {@link #name} (A code or name that describes this diagnostic report.) - */ - public CodeableConcept getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeableConcept(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A code or name that describes this diagnostic report.) - */ - public DiagnosticReport setName(CodeableConcept value) { - this.name = value; - return this; - } - - /** - * @return {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticReport setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the diagnostic report as a whole. - */ - public DiagnosticReportStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the diagnostic report as a whole. - */ - public DiagnosticReport setStatus(DiagnosticReportStatus value) { - if (this.status == null) - this.status = new Enumeration(DiagnosticReportStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DiagnosticReport setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return The date and/or time that this version of the report was released from the source diagnostic service. - */ - 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(Date value) { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - return this; - } - - /** - * @return {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public DiagnosticReport 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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public Resource getSubjectTarget() { - 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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) - */ - public DiagnosticReport setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.) - */ - public DiagnosticReport setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} 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 diagnostic service that is responsible for issuing the report.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} 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 diagnostic service that is responsible for issuing the report.) - */ - public DiagnosticReport setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) - */ - public DiagnosticReport setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #requestDetail} (Details concerning a test requested.) - */ - public List getRequestDetail() { - if (this.requestDetail == null) - this.requestDetail = new ArrayList(); - return this.requestDetail; - } - - public boolean hasRequestDetail() { - if (this.requestDetail == null) - return false; - for (Reference item : this.requestDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #requestDetail} (Details concerning a test requested.) - */ - // syntactic sugar - public Reference addRequestDetail() { //3 - Reference t = new Reference(); - if (this.requestDetail == null) - this.requestDetail = new ArrayList(); - this.requestDetail.add(t); - return t; - } - - /** - * @return {@link #requestDetail} (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. Details concerning a test requested.) - */ - public List getRequestDetailTarget() { - if (this.requestDetailTarget == null) - this.requestDetailTarget = new ArrayList(); - return this.requestDetailTarget; - } - - // syntactic sugar - /** - * @return {@link #requestDetail} (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. Details concerning a test requested.) - */ - public DiagnosticOrder addRequestDetailTarget() { - DiagnosticOrder r = new DiagnosticOrder(); - if (this.requestDetailTarget == null) - this.requestDetailTarget = new ArrayList(); - this.requestDetailTarget.add(r); - return r; - } - - /** - * @return {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) - */ - public DiagnosticReport setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public Type getDiagnostic() { - return this.diagnostic; - } - - /** - * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public DateTimeType getDiagnosticDateTimeType() throws Exception { - if (!(this.diagnostic instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); - return (DateTimeType) this.diagnostic; - } - - /** - * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public Period getDiagnosticPeriod() throws Exception { - if (!(this.diagnostic instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); - return (Period) this.diagnostic; - } - - public boolean hasDiagnostic() { - return this.diagnostic != null && !this.diagnostic.isEmpty(); - } - - /** - * @param value {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) - */ - public DiagnosticReport setDiagnostic(Type value) { - this.diagnostic = value; - return this; - } - - /** - * @return {@link #specimen} (Details about the specimens on which this Disagnostic report is based.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (Details about the specimens on which this Disagnostic report is based.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - /** - * @return {@link #specimen} (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. Details about the specimens on which this Disagnostic report is based.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (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. Details about the specimens on which this Disagnostic report is based.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - public List getResult() { - if (this.result == null) - this.result = new ArrayList(); - return this.result; - } - - public boolean hasResult() { - if (this.result == null) - return false; - for (Reference item : this.result) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - // syntactic sugar - public Reference addResult() { //3 - Reference t = new Reference(); - if (this.result == null) - this.result = new ArrayList(); - this.result.add(t); - return t; - } - - /** - * @return {@link #result} (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. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - public List getResultTarget() { - if (this.resultTarget == null) - this.resultTarget = new ArrayList(); - return this.resultTarget; - } - - // syntactic sugar - /** - * @return {@link #result} (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. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) - */ - public Observation addResultTarget() { - Observation r = new Observation(); - if (this.resultTarget == null) - this.resultTarget = new ArrayList(); - this.resultTarget.add(r); - return r; - } - - /** - * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - public List getImagingStudy() { - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - return this.imagingStudy; - } - - public boolean hasImagingStudy() { - if (this.imagingStudy == null) - return false; - for (Reference item : this.imagingStudy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - // syntactic sugar - public Reference addImagingStudy() { //3 - Reference t = new Reference(); - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - this.imagingStudy.add(t); - return t; - } - - /** - * @return {@link #imagingStudy} (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. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - public List getImagingStudyTarget() { - if (this.imagingStudyTarget == null) - this.imagingStudyTarget = new ArrayList(); - return this.imagingStudyTarget; - } - - // syntactic sugar - /** - * @return {@link #imagingStudy} (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. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) - */ - public ImagingStudy addImagingStudyTarget() { - ImagingStudy r = new ImagingStudy(); - if (this.imagingStudyTarget == null) - this.imagingStudyTarget = new ArrayList(); - this.imagingStudyTarget.add(r); - return r; - } - - /** - * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) - */ - public List getImage() { - if (this.image == null) - this.image = new ArrayList(); - return this.image; - } - - public boolean hasImage() { - if (this.image == null) - return false; - for (DiagnosticReportImageComponent item : this.image) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) - */ - // syntactic sugar - public DiagnosticReportImageComponent addImage() { //3 - DiagnosticReportImageComponent t = new DiagnosticReportImageComponent(); - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return t; - } - - /** - * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value - */ - public StringType getConclusionElement() { - if (this.conclusion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.conclusion"); - else if (Configuration.doAutoCreate()) - this.conclusion = new StringType(); - return this.conclusion; - } - - public boolean hasConclusionElement() { - return this.conclusion != null && !this.conclusion.isEmpty(); - } - - public boolean hasConclusion() { - return this.conclusion != null && !this.conclusion.isEmpty(); - } - - /** - * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value - */ - public DiagnosticReport setConclusionElement(StringType value) { - this.conclusion = value; - return this; - } - - /** - * @return Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - public String getConclusion() { - return this.conclusion == null ? null : this.conclusion.getValue(); - } - - /** - * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - public DiagnosticReport setConclusion(String value) { - if (Utilities.noString(value)) - this.conclusion = null; - else { - if (this.conclusion == null) - this.conclusion = new StringType(); - this.conclusion.setValue(value); - } - return this; - } - - /** - * @return {@link #codedDiagnosis} (Codes for the conclusion.) - */ - public List getCodedDiagnosis() { - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - return this.codedDiagnosis; - } - - public boolean hasCodedDiagnosis() { - if (this.codedDiagnosis == null) - return false; - for (CodeableConcept item : this.codedDiagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codedDiagnosis} (Codes for the conclusion.) - */ - // syntactic sugar - public CodeableConcept addCodedDiagnosis() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - this.codedDiagnosis.add(t); - return t; - } - - /** - * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) - */ - public List getPresentedForm() { - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - return this.presentedForm; - } - - public boolean hasPresentedForm() { - if (this.presentedForm == null) - return false; - for (Attachment item : this.presentedForm) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) - */ - // syntactic sugar - public Attachment addPresentedForm() { //3 - Attachment t = new Attachment(); - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - this.presentedForm.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("issued", "dateTime", "The date and/or time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("requestDetail", "Reference(DiagnosticOrder)", "Details concerning a test requested.", 0, java.lang.Integer.MAX_VALUE, requestDetail)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("diagnostic[x]", "dateTime|Period", "The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, diagnostic)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this Disagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("result", "Reference(Observation)", "Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels').", 0, java.lang.Integer.MAX_VALUE, result)); - childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); - childrenList.add(new Property("image", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, image)); - childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion)); - childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis)); - childrenList.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm)); - } - - public DiagnosticReport copy() { - DiagnosticReport dst = new DiagnosticReport(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - if (requestDetail != null) { - dst.requestDetail = new ArrayList(); - for (Reference i : requestDetail) - dst.requestDetail.add(i.copy()); - }; - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - dst.diagnostic = diagnostic == null ? null : diagnostic.copy(); - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - if (result != null) { - dst.result = new ArrayList(); - for (Reference i : result) - dst.result.add(i.copy()); - }; - if (imagingStudy != null) { - dst.imagingStudy = new ArrayList(); - for (Reference i : imagingStudy) - dst.imagingStudy.add(i.copy()); - }; - if (image != null) { - dst.image = new ArrayList(); - for (DiagnosticReportImageComponent i : image) - dst.image.add(i.copy()); - }; - dst.conclusion = conclusion == null ? null : conclusion.copy(); - if (codedDiagnosis != null) { - dst.codedDiagnosis = new ArrayList(); - for (CodeableConcept i : codedDiagnosis) - dst.codedDiagnosis.add(i.copy()); - }; - if (presentedForm != null) { - dst.presentedForm = new ArrayList(); - for (Attachment i : presentedForm) - dst.presentedForm.add(i.copy()); - }; - return dst; - } - - protected DiagnosticReport typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (issued == null || issued.isEmpty()) && (subject == null || subject.isEmpty()) && (performer == null || performer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (requestDetail == null || requestDetail.isEmpty()) - && (serviceCategory == null || serviceCategory.isEmpty()) && (diagnostic == null || diagnostic.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) - && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty()) - && (presentedForm == null || presentedForm.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DiagnosticReport; - } - - @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" ) - public static final String SP_RESULT = "result"; - @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" ) - public static final String SP_ISSUED = "issued"; - @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" ) - public static final String SP_DIAGNOSIS = "diagnosis"; - @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="Reference to the image source", type="reference" ) - public static final String SP_IMAGE = "image"; - @SearchParamDefinition(name="date", path="DiagnosticReport.diagnostic[x]", description="The clinically relevant time of the report", type="date" ) - 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="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" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. + */ +@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") +public class DiagnosticReport extends DomainResource { + + public enum DiagnosticReportStatus implements FhirEnum { + /** + * The existence of the report is registered, but there is nothing yet available. + */ + REGISTERED, + /** + * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified. + */ + PARTIAL, + /** + * The report is complete and verified by an authorized person. + */ + FINAL, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. + */ + CORRECTED, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person, and data has been changed. + */ + AMENDED, + /** + * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed. + */ + APPENDED, + /** + * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED, + /** + * The report has been withdrawn following previous Final release. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REGISTERED; + if ("partial".equals(codeString)) + return PARTIAL; + if ("final".equals(codeString)) + return FINAL; + if ("corrected".equals(codeString)) + return CORRECTED; + if ("amended".equals(codeString)) + return AMENDED; + if ("appended".equals(codeString)) + return APPENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REGISTERED: return "registered"; + case PARTIAL: return "partial"; + case FINAL: return "final"; + case CORRECTED: return "corrected"; + case AMENDED: return "amended"; + case APPENDED: return "appended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REGISTERED: return ""; + case PARTIAL: return ""; + case FINAL: return ""; + case CORRECTED: return ""; + case AMENDED: return ""; + case APPENDED: return ""; + case CANCELLED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REGISTERED: return "The existence of the report is registered, but there is nothing yet available."; + case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified."; + case FINAL: return "The report is complete and verified by an authorized person."; + case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person."; + case AMENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person, and data has been changed."; + case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed."; + case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; + case ENTEREDINERROR: return "The report has been withdrawn following previous Final release."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REGISTERED: return "registered"; + case PARTIAL: return "partial"; + case FINAL: return "final"; + case CORRECTED: return "corrected"; + case AMENDED: return "amended"; + case APPENDED: return "appended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + } + + public static class DiagnosticReportStatusEnumFactory implements EnumFactory { + public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return DiagnosticReportStatus.REGISTERED; + if ("partial".equals(codeString)) + return DiagnosticReportStatus.PARTIAL; + if ("final".equals(codeString)) + return DiagnosticReportStatus.FINAL; + if ("corrected".equals(codeString)) + return DiagnosticReportStatus.CORRECTED; + if ("amended".equals(codeString)) + return DiagnosticReportStatus.AMENDED; + if ("appended".equals(codeString)) + return DiagnosticReportStatus.APPENDED; + if ("cancelled".equals(codeString)) + return DiagnosticReportStatus.CANCELLED; + if ("entered in error".equals(codeString)) + return DiagnosticReportStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); + } + public String toCode(DiagnosticReportStatus code) throws IllegalArgumentException { + if (code == DiagnosticReportStatus.REGISTERED) + return "registered"; + if (code == DiagnosticReportStatus.PARTIAL) + return "partial"; + if (code == DiagnosticReportStatus.FINAL) + return "final"; + if (code == DiagnosticReportStatus.CORRECTED) + return "corrected"; + if (code == DiagnosticReportStatus.AMENDED) + return "amended"; + if (code == DiagnosticReportStatus.APPENDED) + return "appended"; + if (code == DiagnosticReportStatus.CANCELLED) + return "cancelled"; + if (code == DiagnosticReportStatus.ENTEREDINERROR) + return "entered in error"; + return "?"; + } + } + + @Block() + public static class DiagnosticReportImageComponent extends BackboneElement { + /** + * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + @Child(name="comment", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Comment about the image (e.g. explanation)", formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features." ) + protected StringType comment; + + /** + * Reference to the image source. + */ + @Child(name="link", type={Media.class}, order=2, min=1, max=1) + @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." ) + protected Reference link; + + /** + * The actual object that is the target of the reference (Reference to the image source.) + */ + protected Media linkTarget; + + private static final long serialVersionUID = 935791940L; + + public DiagnosticReportImageComponent() { + super(); + } + + public DiagnosticReportImageComponent(Reference link) { + super(); + this.link = link; + } + + /** + * @return {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public DiagnosticReportImageComponent setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + */ + public DiagnosticReportImageComponent setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (Reference to the image source.) + */ + public Reference getLink() { + if (this.link == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); + else if (Configuration.doAutoCreate()) + this.link = new Reference(); + return this.link; + } + + public boolean hasLink() { + return this.link != null && !this.link.isEmpty(); + } + + /** + * @param value {@link #link} (Reference to the image source.) + */ + public DiagnosticReportImageComponent setLink(Reference value) { + this.link = value; + return this; + } + + /** + * @return {@link #link} 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. (Reference to the image source.) + */ + public Media getLinkTarget() { + if (this.linkTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); + else if (Configuration.doAutoCreate()) + this.linkTarget = new Media(); + return this.linkTarget; + } + + /** + * @param value {@link #link} 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 image source.) + */ + public DiagnosticReportImageComponent setLinkTarget(Media value) { + this.linkTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + public DiagnosticReportImageComponent copy() { + DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent(); + copyValues(dst); + dst.comment = comment == null ? null : comment.copy(); + dst.link = link == null ? null : link.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty()) + ; + } + + } + + /** + * A code or name that describes this diagnostic report. + */ + @Child(name="name", type={CodeableConcept.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." ) + protected CodeableConcept name; + + /** + * The status of the diagnostic report as a whole. + */ + @Child(name="status", type={CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="registered | partial | final | corrected +", formalDefinition="The status of the diagnostic report as a whole." ) + protected Enumeration status; + + /** + * The date and/or time that this version of the report was released from the source diagnostic service. + */ + @Child(name="issued", type={DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Date this version was released", formalDefinition="The date and/or time that this version of the report was released from the source diagnostic service." ) + protected DateTimeType issued; + + /** + * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. + */ + @Child(name="subject", type={Patient.class, Group.class, Device.class, Location.class}, order=2, min=1, max=1) + @Description(shortDefinition="The subject of the report, usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + protected Resource subjectTarget; + + /** + * The diagnostic service that is responsible for issuing the report. + */ + @Child(name="performer", type={Practitioner.class, Organization.class}, order=3, min=1, max=1) + @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.) + */ + protected Resource performerTarget; + + /** + * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. + */ + @Child(name="identifier", type={Identifier.class}, order=4, min=0, max=1) + @Description(shortDefinition="Id for external references to this report", formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider." ) + protected Identifier identifier; + + /** + * Details concerning a test requested. + */ + @Child(name="requestDetail", type={DiagnosticOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test requested." ) + protected List requestDetail; + /** + * The actual objects that are the target of the reference (Details concerning a test requested.) + */ + protected List requestDetailTarget; + + + /** + * The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI. + */ + @Child(name="serviceCategory", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Biochemistry, Hematology etc.", formalDefinition="The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI." ) + protected CodeableConcept serviceCategory; + + /** + * The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. + */ + @Child(name="diagnostic", type={DateTimeType.class, Period.class}, order=7, min=1, max=1) + @Description(shortDefinition="Physiologically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." ) + protected Type diagnostic; + + /** + * Details about the specimens on which this Disagnostic report is based. + */ + @Child(name="specimen", type={Specimen.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this Disagnostic report is based." ) + protected List specimen; + /** + * The actual objects that are the target of the reference (Details about the specimens on which this Disagnostic report is based.) + */ + protected List specimenTarget; + + + /** + * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels"). + */ + @Child(name="result", type={Observation.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Observations - simple, or complex nested groups", formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels')." ) + protected List result; + /** + * The actual objects that are the target of the reference (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + protected List resultTarget; + + + /** + * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. + */ + @Child(name="imagingStudy", type={ImagingStudy.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reference to full details of imaging associated with the diagnostic report", formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images." ) + protected List imagingStudy; + /** + * The actual objects that are the target of the reference (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + protected List imagingStudyTarget; + + + /** + * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). + */ + @Child(name="image", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Key images associated with this report", formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)." ) + protected List image; + + /** + * Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + @Child(name="conclusion", type={StringType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." ) + protected StringType conclusion; + + /** + * Codes for the conclusion. + */ + @Child(name="codedDiagnosis", type={CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." ) + protected List codedDiagnosis; + + /** + * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. + */ + @Child(name="presentedForm", type={Attachment.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Entire Report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." ) + protected List presentedForm; + + private static final long serialVersionUID = -1414376119L; + + public DiagnosticReport() { + super(); + } + + public DiagnosticReport(CodeableConcept name, Enumeration status, DateTimeType issued, Reference subject, Reference performer, Type diagnostic) { + super(); + this.name = name; + this.status = status; + this.issued = issued; + this.subject = subject; + this.performer = performer; + this.diagnostic = diagnostic; + } + + /** + * @return {@link #name} (A code or name that describes this diagnostic report.) + */ + public CodeableConcept getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeableConcept(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A code or name that describes this diagnostic report.) + */ + public DiagnosticReport setName(CodeableConcept value) { + this.name = value; + return this; + } + + /** + * @return {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DiagnosticReport setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the diagnostic report as a whole. + */ + public DiagnosticReportStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the diagnostic report as a whole. + */ + public DiagnosticReport setStatus(DiagnosticReportStatus value) { + if (this.status == null) + this.status = new Enumeration(DiagnosticReportStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (The date and/or time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DiagnosticReport setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return The date and/or time that this version of the report was released from the source diagnostic service. + */ + 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(Date value) { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + return this; + } + + /** + * @return {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public DiagnosticReport 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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public Resource getSubjectTarget() { + 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 subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.) + */ + public DiagnosticReport setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.) + */ + public DiagnosticReport setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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 diagnostic service that is responsible for issuing the report.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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 diagnostic service that is responsible for issuing the report.) + */ + public DiagnosticReport setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) + */ + public DiagnosticReport setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #requestDetail} (Details concerning a test requested.) + */ + public List getRequestDetail() { + if (this.requestDetail == null) + this.requestDetail = new ArrayList(); + return this.requestDetail; + } + + public boolean hasRequestDetail() { + if (this.requestDetail == null) + return false; + for (Reference item : this.requestDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #requestDetail} (Details concerning a test requested.) + */ + // syntactic sugar + public Reference addRequestDetail() { //3 + Reference t = new Reference(); + if (this.requestDetail == null) + this.requestDetail = new ArrayList(); + this.requestDetail.add(t); + return t; + } + + /** + * @return {@link #requestDetail} (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. Details concerning a test requested.) + */ + public List getRequestDetailTarget() { + if (this.requestDetailTarget == null) + this.requestDetailTarget = new ArrayList(); + return this.requestDetailTarget; + } + + // syntactic sugar + /** + * @return {@link #requestDetail} (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. Details concerning a test requested.) + */ + public DiagnosticOrder addRequestDetailTarget() { + DiagnosticOrder r = new DiagnosticOrder(); + if (this.requestDetailTarget == null) + this.requestDetailTarget = new ArrayList(); + this.requestDetailTarget.add(r); + return r; + } + + /** + * @return {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.) + */ + public DiagnosticReport setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public Type getDiagnostic() { + return this.diagnostic; + } + + /** + * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public DateTimeType getDiagnosticDateTimeType() throws Exception { + if (!(this.diagnostic instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); + return (DateTimeType) this.diagnostic; + } + + /** + * @return {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public Period getDiagnosticPeriod() throws Exception { + if (!(this.diagnostic instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.diagnostic.getClass().getName()+" was encountered"); + return (Period) this.diagnostic; + } + + public boolean hasDiagnostic() { + return this.diagnostic != null && !this.diagnostic.isEmpty(); + } + + /** + * @param value {@link #diagnostic} (The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.) + */ + public DiagnosticReport setDiagnostic(Type value) { + this.diagnostic = value; + return this; + } + + /** + * @return {@link #specimen} (Details about the specimens on which this Disagnostic report is based.) + */ + public List getSpecimen() { + if (this.specimen == null) + this.specimen = new ArrayList(); + return this.specimen; + } + + public boolean hasSpecimen() { + if (this.specimen == null) + return false; + for (Reference item : this.specimen) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specimen} (Details about the specimens on which this Disagnostic report is based.) + */ + // syntactic sugar + public Reference addSpecimen() { //3 + Reference t = new Reference(); + if (this.specimen == null) + this.specimen = new ArrayList(); + this.specimen.add(t); + return t; + } + + /** + * @return {@link #specimen} (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. Details about the specimens on which this Disagnostic report is based.) + */ + public List getSpecimenTarget() { + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + return this.specimenTarget; + } + + // syntactic sugar + /** + * @return {@link #specimen} (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. Details about the specimens on which this Disagnostic report is based.) + */ + public Specimen addSpecimenTarget() { + Specimen r = new Specimen(); + if (this.specimenTarget == null) + this.specimenTarget = new ArrayList(); + this.specimenTarget.add(r); + return r; + } + + /** + * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public List getResult() { + if (this.result == null) + this.result = new ArrayList(); + return this.result; + } + + public boolean hasResult() { + if (this.result == null) + return false; + for (Reference item : this.result) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + // syntactic sugar + public Reference addResult() { //3 + Reference t = new Reference(); + if (this.result == null) + this.result = new ArrayList(); + this.result.add(t); + return t; + } + + /** + * @return {@link #result} (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. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public List getResultTarget() { + if (this.resultTarget == null) + this.resultTarget = new ArrayList(); + return this.resultTarget; + } + + // syntactic sugar + /** + * @return {@link #result} (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. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").) + */ + public Observation addResultTarget() { + Observation r = new Observation(); + if (this.resultTarget == null) + this.resultTarget = new ArrayList(); + this.resultTarget.add(r); + return r; + } + + /** + * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public List getImagingStudy() { + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + return this.imagingStudy; + } + + public boolean hasImagingStudy() { + if (this.imagingStudy == null) + return false; + for (Reference item : this.imagingStudy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + // syntactic sugar + public Reference addImagingStudy() { //3 + Reference t = new Reference(); + if (this.imagingStudy == null) + this.imagingStudy = new ArrayList(); + this.imagingStudy.add(t); + return t; + } + + /** + * @return {@link #imagingStudy} (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. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public List getImagingStudyTarget() { + if (this.imagingStudyTarget == null) + this.imagingStudyTarget = new ArrayList(); + return this.imagingStudyTarget; + } + + // syntactic sugar + /** + * @return {@link #imagingStudy} (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. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.) + */ + public ImagingStudy addImagingStudyTarget() { + ImagingStudy r = new ImagingStudy(); + if (this.imagingStudyTarget == null) + this.imagingStudyTarget = new ArrayList(); + this.imagingStudyTarget.add(r); + return r; + } + + /** + * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) + */ + public List getImage() { + if (this.image == null) + this.image = new ArrayList(); + return this.image; + } + + public boolean hasImage() { + if (this.image == null) + return false; + for (DiagnosticReportImageComponent item : this.image) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #image} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).) + */ + // syntactic sugar + public DiagnosticReportImageComponent addImage() { //3 + DiagnosticReportImageComponent t = new DiagnosticReportImageComponent(); + if (this.image == null) + this.image = new ArrayList(); + this.image.add(t); + return t; + } + + /** + * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value + */ + public StringType getConclusionElement() { + if (this.conclusion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosticReport.conclusion"); + else if (Configuration.doAutoCreate()) + this.conclusion = new StringType(); + return this.conclusion; + } + + public boolean hasConclusionElement() { + return this.conclusion != null && !this.conclusion.isEmpty(); + } + + public boolean hasConclusion() { + return this.conclusion != null && !this.conclusion.isEmpty(); + } + + /** + * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value + */ + public DiagnosticReport setConclusionElement(StringType value) { + this.conclusion = value; + return this; + } + + /** + * @return Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + public String getConclusion() { + return this.conclusion == null ? null : this.conclusion.getValue(); + } + + /** + * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report. + */ + public DiagnosticReport setConclusion(String value) { + if (Utilities.noString(value)) + this.conclusion = null; + else { + if (this.conclusion == null) + this.conclusion = new StringType(); + this.conclusion.setValue(value); + } + return this; + } + + /** + * @return {@link #codedDiagnosis} (Codes for the conclusion.) + */ + public List getCodedDiagnosis() { + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + return this.codedDiagnosis; + } + + public boolean hasCodedDiagnosis() { + if (this.codedDiagnosis == null) + return false; + for (CodeableConcept item : this.codedDiagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #codedDiagnosis} (Codes for the conclusion.) + */ + // syntactic sugar + public CodeableConcept addCodedDiagnosis() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.codedDiagnosis == null) + this.codedDiagnosis = new ArrayList(); + this.codedDiagnosis.add(t); + return t; + } + + /** + * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) + */ + public List getPresentedForm() { + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + return this.presentedForm; + } + + public boolean hasPresentedForm() { + if (this.presentedForm == null) + return false; + for (Attachment item : this.presentedForm) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) + */ + // syntactic sugar + public Attachment addPresentedForm() { //3 + Attachment t = new Attachment(); + if (this.presentedForm == null) + this.presentedForm = new ArrayList(); + this.presentedForm.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("issued", "dateTime", "The date and/or time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("requestDetail", "Reference(DiagnosticOrder)", "Details concerning a test requested.", 0, java.lang.Integer.MAX_VALUE, requestDetail)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("diagnostic[x]", "dateTime|Period", "The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, diagnostic)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this Disagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("result", "Reference(Observation)", "Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. 'atomic' results), or they can be grouping observations that include references to other members of the group (e.g. 'panels').", 0, java.lang.Integer.MAX_VALUE, result)); + childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); + childrenList.add(new Property("image", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, image)); + childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion)); + childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis)); + childrenList.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm)); + } + + public DiagnosticReport copy() { + DiagnosticReport dst = new DiagnosticReport(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + if (requestDetail != null) { + dst.requestDetail = new ArrayList(); + for (Reference i : requestDetail) + dst.requestDetail.add(i.copy()); + }; + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + dst.diagnostic = diagnostic == null ? null : diagnostic.copy(); + if (specimen != null) { + dst.specimen = new ArrayList(); + for (Reference i : specimen) + dst.specimen.add(i.copy()); + }; + if (result != null) { + dst.result = new ArrayList(); + for (Reference i : result) + dst.result.add(i.copy()); + }; + if (imagingStudy != null) { + dst.imagingStudy = new ArrayList(); + for (Reference i : imagingStudy) + dst.imagingStudy.add(i.copy()); + }; + if (image != null) { + dst.image = new ArrayList(); + for (DiagnosticReportImageComponent i : image) + dst.image.add(i.copy()); + }; + dst.conclusion = conclusion == null ? null : conclusion.copy(); + if (codedDiagnosis != null) { + dst.codedDiagnosis = new ArrayList(); + for (CodeableConcept i : codedDiagnosis) + dst.codedDiagnosis.add(i.copy()); + }; + if (presentedForm != null) { + dst.presentedForm = new ArrayList(); + for (Attachment i : presentedForm) + dst.presentedForm.add(i.copy()); + }; + return dst; + } + + protected DiagnosticReport typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) + && (issued == null || issued.isEmpty()) && (subject == null || subject.isEmpty()) && (performer == null || performer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (requestDetail == null || requestDetail.isEmpty()) + && (serviceCategory == null || serviceCategory.isEmpty()) && (diagnostic == null || diagnostic.isEmpty()) + && (specimen == null || specimen.isEmpty()) && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) + && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty()) + && (presentedForm == null || presentedForm.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DiagnosticReport; + } + + @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" ) + public static final String SP_RESULT = "result"; + @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" ) + public static final String SP_ISSUED = "issued"; + @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" ) + public static final String SP_DIAGNOSIS = "diagnosis"; + @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="Reference to the image source", type="reference" ) + public static final String SP_IMAGE = "image"; + @SearchParamDefinition(name="date", path="DiagnosticReport.diagnostic[x]", description="The clinically relevant time of the report", type="date" ) + 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="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" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java index 7293617faf4..1c0e51998cd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java @@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Distance") -public class Distance extends Quantity { - - private static final long serialVersionUID = -483422721L; - - public Distance copy() { - Distance dst = new Distance(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.units = units == null ? null : units.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Distance typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - + +/* + 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Distance") +public class Distance extends Quantity { + + private static final long serialVersionUID = -483422721L; + + public Distance copy() { + Distance dst = new Distance(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.units = units == null ? null : units.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Distance typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java index a11941608f3..170981e27b3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java @@ -20,862 +20,862 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A manifest that defines a set of documents. - */ -@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") -public class DocumentManifest extends DomainResource { - - public enum DocumentReferenceStatus implements FhirEnum { - /** - * This is the current reference for this document. - */ - CURRENT, - /** - * This reference has been superseded by another reference. - */ - SUPERCEDED, - /** - * This reference was created in error. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CURRENT; - if ("superceded".equals(codeString)) - return SUPERCEDED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case SUPERCEDED: return "superceded"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return ""; - case SUPERCEDED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "This is the current reference for this document."; - case SUPERCEDED: return "This reference has been superseded by another reference."; - case ENTEREDINERROR: return "This reference was created in error."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "current"; - case SUPERCEDED: return "superceded"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - } - - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return DocumentReferenceStatus.CURRENT; - if ("superceded".equals(codeString)) - return DocumentReferenceStatus.SUPERCEDED; - if ("entered in error".equals(codeString)) - return DocumentReferenceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException { - if (code == DocumentReferenceStatus.CURRENT) - return "current"; - if (code == DocumentReferenceStatus.SUPERCEDED) - return "superceded"; - if (code == DocumentReferenceStatus.ENTEREDINERROR) - return "entered in error"; - return "?"; - } - } - - /** - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. - */ - @Child(name="masterIdentifier", type={Identifier.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Unique Identifier for the set of documents", formalDefinition="A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts." ) - protected Identifier masterIdentifier; - - /** - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers. - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the manifest", formalDefinition="Other identifiers associated with the document, including version independent, source record and workflow related identifiers." ) - protected List identifier; - - /** - * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). - */ - @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The subject of the set of documents", formalDefinition="Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case)." ) - protected List subject; - /** - * The actual objects that are the target of the reference (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - protected List subjectTarget; - - - /** - * A patient, practitioner, or organization for which this set of documents is intended. - */ - @Child(name="recipient", type={Patient.class, Practitioner.class, Organization.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intended to get notified about this set of documents", formalDefinition="A patient, practitioner, or organization for which this set of documents is intended." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (A patient, practitioner, or organization for which this set of documents is intended.) - */ - protected List recipientTarget; - - - /** - * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider. - */ - @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="What kind of document set this is", formalDefinition="Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider." ) - protected CodeableConcept type; - - /** - * Identifies who is responsible for adding the information to the document. - */ - @Child(name="author", type={Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) - */ - protected List authorTarget; - - - /** - * 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). - */ - @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="When this document manifest created", formalDefinition="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)." ) - protected DateTimeType created; - - /** - * Identifies the source system, application, or software that produced the document manifest. - */ - @Child(name="source", type={UriType.class}, order=6, min=0, max=1) - @Description(shortDefinition="The source system/application/software", formalDefinition="Identifies the source system, application, or software that produced the document manifest." ) - protected UriType source; - - /** - * The status of this document manifest. - */ - @Child(name="status", type={CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="current | superceded | entered in error", formalDefinition="The status of this document manifest." ) - protected Enumeration status; - - /** - * Whether this document manifest replaces another. - */ - @Child(name="supercedes", type={DocumentManifest.class}, order=8, min=0, max=1) - @Description(shortDefinition="If this document manifest replaces another", formalDefinition="Whether this document manifest replaces another." ) - protected Reference supercedes; - - /** - * The actual object that is the target of the reference (Whether this document manifest replaces another.) - */ - protected DocumentManifest supercedesTarget; - - /** - * Human-readable description of the source document. This is sometimes known as the "title". - */ - @Child(name="description", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) - protected StringType description; - - /** - * A code specifying the level of confidentiality of this set of Documents. - */ - @Child(name="confidentiality", type={CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="Sensitivity of set of documents", formalDefinition="A code specifying the level of confidentiality of this set of Documents." ) - protected CodeableConcept confidentiality; - - /** - * The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed. - */ - @Child(name="content", type={DocumentReference.class, Binary.class, Media.class}, order=11, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contents of this set of documents", formalDefinition="The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed." ) - protected List content; - /** - * The actual objects that are the target of the reference (The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) - */ - protected List contentTarget; - - - private static final long serialVersionUID = 388610018L; - - public DocumentManifest() { - super(); - } - - public DocumentManifest(Identifier masterIdentifier, Enumeration status) { - super(); - this.masterIdentifier = masterIdentifier; - this.status = status; - } - - /** - * @return {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) - */ - public Identifier getMasterIdentifier() { - if (this.masterIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.masterIdentifier"); - else if (Configuration.doAutoCreate()) - this.masterIdentifier = new Identifier(); - return this.masterIdentifier; - } - - public boolean hasMasterIdentifier() { - return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); - } - - /** - * @param value {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) - */ - public DocumentManifest setMasterIdentifier(Identifier value) { - this.masterIdentifier = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - public List getSubject() { - if (this.subject == null) - this.subject = new ArrayList(); - return this.subject; - } - - public boolean hasSubject() { - if (this.subject == null) - return false; - for (Reference item : this.subject) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - // syntactic sugar - public Reference addSubject() { //3 - Reference t = new Reference(); - if (this.subject == null) - this.subject = new ArrayList(); - this.subject.add(t); - return t; - } - - /** - * @return {@link #subject} (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. Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) - */ - public List getSubjectTarget() { - if (this.subjectTarget == null) - this.subjectTarget = new ArrayList(); - return this.subjectTarget; - } - - /** - * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - 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} (A patient, practitioner, or organization for which this set of documents is intended.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - 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. A patient, practitioner, or organization for which this set of documents is intended.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) - */ - public DocumentManifest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - /** - * @return {@link #author} (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 who is responsible for adding the information to the document.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #created} (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).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (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).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DocumentManifest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @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 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(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public UriType getSourceElement() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.source"); - else if (Configuration.doAutoCreate()) - this.source = new UriType(); - return this.source; - } - - public boolean hasSourceElement() { - return this.source != null && !this.source.isEmpty(); - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public DocumentManifest setSourceElement(UriType value) { - this.source = value; - return this; - } - - /** - * @return Identifies the source system, application, or software that produced the document manifest. - */ - public String getSource() { - return this.source == null ? null : this.source.getValue(); - } - - /** - * @param value Identifies the source system, application, or software that produced the document manifest. - */ - public DocumentManifest setSource(String value) { - if (Utilities.noString(value)) - this.source = null; - else { - if (this.source == null) - this.source = new UriType(); - this.source.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DocumentManifest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this document manifest. - */ - public DocumentReferenceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this document manifest. - */ - public DocumentManifest setStatus(DocumentReferenceStatus value) { - if (this.status == null) - this.status = new Enumeration(DocumentReferenceStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #supercedes} (Whether this document manifest replaces another.) - */ - public Reference getSupercedes() { - if (this.supercedes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.supercedes"); - else if (Configuration.doAutoCreate()) - this.supercedes = new Reference(); - return this.supercedes; - } - - public boolean hasSupercedes() { - return this.supercedes != null && !this.supercedes.isEmpty(); - } - - /** - * @param value {@link #supercedes} (Whether this document manifest replaces another.) - */ - public DocumentManifest setSupercedes(Reference value) { - this.supercedes = value; - return this; - } - - /** - * @return {@link #supercedes} 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. (Whether this document manifest replaces another.) - */ - public DocumentManifest getSupercedesTarget() { - if (this.supercedesTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.supercedes"); - else if (Configuration.doAutoCreate()) - this.supercedesTarget = new DocumentManifest(); - return this.supercedesTarget; - } - - /** - * @param value {@link #supercedes} 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. (Whether this document manifest replaces another.) - */ - public DocumentManifest setSupercedesTarget(DocumentManifest value) { - this.supercedesTarget = value; - return this; - } - - /** - * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). 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 DocumentManifest.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 the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DocumentManifest setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the source document. This is sometimes known as the "title". - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the source document. This is sometimes known as the "title". - */ - public DocumentManifest setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #confidentiality} (A code specifying the level of confidentiality of this set of Documents.) - */ - public CodeableConcept getConfidentiality() { - if (this.confidentiality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.confidentiality"); - else if (Configuration.doAutoCreate()) - this.confidentiality = new CodeableConcept(); - return this.confidentiality; - } - - public boolean hasConfidentiality() { - return this.confidentiality != null && !this.confidentiality.isEmpty(); - } - - /** - * @param value {@link #confidentiality} (A code specifying the level of confidentiality of this set of Documents.) - */ - public DocumentManifest setConfidentiality(CodeableConcept value) { - this.confidentiality = value; - return this; - } - - /** - * @return {@link #content} (The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (Reference item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) - */ - // syntactic sugar - public Reference addContent() { //3 - Reference t = new Reference(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - /** - * @return {@link #content} (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 list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) - */ - public List getContentTarget() { - if (this.contentTarget == null) - this.contentTarget = new ArrayList(); - return this.contentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("masterIdentifier", "Identifier", "A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent, source record and workflow related identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|Organization)", "A patient, practitioner, or organization for which this set of documents is intended.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("created", "dateTime", "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).", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("source", "uri", "Identifies the source system, application, or software that produced the document manifest.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("status", "code", "The status of this document manifest.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("supercedes", "Reference(DocumentManifest)", "Whether this document manifest replaces another.", 0, java.lang.Integer.MAX_VALUE, supercedes)); - childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("confidentiality", "CodeableConcept", "A code specifying the level of confidentiality of this set of Documents.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); - childrenList.add(new Property("content", "Reference(DocumentReference|Binary|Media)", "The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public DocumentManifest copy() { - DocumentManifest dst = new DocumentManifest(); - copyValues(dst); - dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (subject != null) { - dst.subject = new ArrayList(); - for (Reference i : subject) - dst.subject.add(i.copy()); - }; - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.created = created == null ? null : created.copy(); - dst.source = source == null ? null : source.copy(); - dst.status = status == null ? null : status.copy(); - dst.supercedes = supercedes == null ? null : supercedes.copy(); - dst.description = description == null ? null : description.copy(); - dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (Reference i : content) - dst.content.add(i.copy()); - }; - return dst; - } - - protected DocumentManifest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (recipient == null || recipient.isEmpty()) && (type == null || type.isEmpty()) - && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) && (source == null || source.isEmpty()) - && (status == null || status.isEmpty()) && (supercedes == null || supercedes.isEmpty()) && (description == null || description.isEmpty()) - && (confidentiality == null || confidentiality.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DocumentManifest; - } - - @SearchParamDefinition(name="content", path="DocumentManifest.content", description="Contents of this set of documents", type="reference" ) - public static final String SP_CONTENT = "content"; - @SearchParamDefinition(name="author", path="DocumentManifest.author", description="Who and/or what authored the document", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="patient", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="supersedes", path="DocumentManifest.supercedes", description="If this document manifest replaces another", type="reference" ) - public static final String SP_SUPERSEDES = "supersedes"; - @SearchParamDefinition(name="status", path="DocumentManifest.status", description="current | superceded | entered in error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="created", path="DocumentManifest.created", description="When this document manifest created", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="confidentiality", path="DocumentManifest.confidentiality", description="Sensitivity of set of documents", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - @SearchParamDefinition(name="description", path="DocumentManifest.description", description="Human-readable description (title)", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="type", path="DocumentManifest.type", description="What kind of document set this is", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier|DocumentManifest.identifier", description="Unique Identifier for the set of documents", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="Intended to get notified about this set of documents", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - -} - + +/* + 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; +/** + * A manifest that defines a set of documents. + */ +@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") +public class DocumentManifest extends DomainResource { + + public enum DocumentReferenceStatus implements FhirEnum { + /** + * This is the current reference for this document. + */ + CURRENT, + /** + * This reference has been superseded by another reference. + */ + SUPERCEDED, + /** + * This reference was created in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CURRENT; + if ("superceded".equals(codeString)) + return SUPERCEDED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case SUPERCEDED: return "superceded"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return ""; + case SUPERCEDED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "This is the current reference for this document."; + case SUPERCEDED: return "This reference has been superseded by another reference."; + case ENTEREDINERROR: return "This reference was created in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "current"; + case SUPERCEDED: return "superceded"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + } + + public static class DocumentReferenceStatusEnumFactory implements EnumFactory { + public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return DocumentReferenceStatus.CURRENT; + if ("superceded".equals(codeString)) + return DocumentReferenceStatus.SUPERCEDED; + if ("entered in error".equals(codeString)) + return DocumentReferenceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException { + if (code == DocumentReferenceStatus.CURRENT) + return "current"; + if (code == DocumentReferenceStatus.SUPERCEDED) + return "superceded"; + if (code == DocumentReferenceStatus.ENTEREDINERROR) + return "entered in error"; + return "?"; + } + } + + /** + * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. + */ + @Child(name="masterIdentifier", type={Identifier.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Unique Identifier for the set of documents", formalDefinition="A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts." ) + protected Identifier masterIdentifier; + + /** + * Other identifiers associated with the document, including version independent, source record and workflow related identifiers. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the manifest", formalDefinition="Other identifiers associated with the document, including version independent, source record and workflow related identifiers." ) + protected List identifier; + + /** + * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). + */ + @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The subject of the set of documents", formalDefinition="Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case)." ) + protected List subject; + /** + * The actual objects that are the target of the reference (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + protected List subjectTarget; + + + /** + * A patient, practitioner, or organization for which this set of documents is intended. + */ + @Child(name="recipient", type={Patient.class, Practitioner.class, Organization.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intended to get notified about this set of documents", formalDefinition="A patient, practitioner, or organization for which this set of documents is intended." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (A patient, practitioner, or organization for which this set of documents is intended.) + */ + protected List recipientTarget; + + + /** + * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider. + */ + @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="What kind of document set this is", formalDefinition="Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider." ) + protected CodeableConcept type; + + /** + * Identifies who is responsible for adding the information to the document. + */ + @Child(name="author", type={Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) + */ + protected List authorTarget; + + + /** + * 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). + */ + @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="When this document manifest created", formalDefinition="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)." ) + protected DateTimeType created; + + /** + * Identifies the source system, application, or software that produced the document manifest. + */ + @Child(name="source", type={UriType.class}, order=6, min=0, max=1) + @Description(shortDefinition="The source system/application/software", formalDefinition="Identifies the source system, application, or software that produced the document manifest." ) + protected UriType source; + + /** + * The status of this document manifest. + */ + @Child(name="status", type={CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="current | superceded | entered in error", formalDefinition="The status of this document manifest." ) + protected Enumeration status; + + /** + * Whether this document manifest replaces another. + */ + @Child(name="supercedes", type={DocumentManifest.class}, order=8, min=0, max=1) + @Description(shortDefinition="If this document manifest replaces another", formalDefinition="Whether this document manifest replaces another." ) + protected Reference supercedes; + + /** + * The actual object that is the target of the reference (Whether this document manifest replaces another.) + */ + protected DocumentManifest supercedesTarget; + + /** + * Human-readable description of the source document. This is sometimes known as the "title". + */ + @Child(name="description", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) + protected StringType description; + + /** + * A code specifying the level of confidentiality of this set of Documents. + */ + @Child(name="confidentiality", type={CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="Sensitivity of set of documents", formalDefinition="A code specifying the level of confidentiality of this set of Documents." ) + protected CodeableConcept confidentiality; + + /** + * The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed. + */ + @Child(name="content", type={DocumentReference.class, Binary.class, Media.class}, order=11, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contents of this set of documents", formalDefinition="The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed." ) + protected List content; + /** + * The actual objects that are the target of the reference (The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) + */ + protected List contentTarget; + + + private static final long serialVersionUID = 388610018L; + + public DocumentManifest() { + super(); + } + + public DocumentManifest(Identifier masterIdentifier, Enumeration status) { + super(); + this.masterIdentifier = masterIdentifier; + this.status = status; + } + + /** + * @return {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) + */ + public Identifier getMasterIdentifier() { + if (this.masterIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.masterIdentifier"); + else if (Configuration.doAutoCreate()) + this.masterIdentifier = new Identifier(); + return this.masterIdentifier; + } + + public boolean hasMasterIdentifier() { + return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); + } + + /** + * @param value {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) + */ + public DocumentManifest setMasterIdentifier(Identifier value) { + this.masterIdentifier = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public List getSubject() { + if (this.subject == null) + this.subject = new ArrayList(); + return this.subject; + } + + public boolean hasSubject() { + if (this.subject == null) + return false; + for (Reference item : this.subject) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subject} (Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + // syntactic sugar + public Reference addSubject() { //3 + Reference t = new Reference(); + if (this.subject == null) + this.subject = new ArrayList(); + this.subject.add(t); + return t; + } + + /** + * @return {@link #subject} (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. Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).) + */ + public List getSubjectTarget() { + if (this.subjectTarget == null) + this.subjectTarget = new ArrayList(); + return this.subjectTarget; + } + + /** + * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + 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} (A patient, practitioner, or organization for which this set of documents is intended.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + 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. A patient, practitioner, or organization for which this set of documents is intended.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.) + */ + public DocumentManifest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + /** + * @return {@link #author} (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 who is responsible for adding the information to the document.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #created} (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).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (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).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DocumentManifest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @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 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(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public UriType getSourceElement() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.source"); + else if (Configuration.doAutoCreate()) + this.source = new UriType(); + return this.source; + } + + public boolean hasSourceElement() { + return this.source != null && !this.source.isEmpty(); + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value + */ + public DocumentManifest setSourceElement(UriType value) { + this.source = value; + return this; + } + + /** + * @return Identifies the source system, application, or software that produced the document manifest. + */ + public String getSource() { + return this.source == null ? null : this.source.getValue(); + } + + /** + * @param value Identifies the source system, application, or software that produced the document manifest. + */ + public DocumentManifest setSource(String value) { + if (Utilities.noString(value)) + this.source = null; + else { + if (this.source == null) + this.source = new UriType(); + this.source.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DocumentManifest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this document manifest. + */ + public DocumentReferenceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this document manifest. + */ + public DocumentManifest setStatus(DocumentReferenceStatus value) { + if (this.status == null) + this.status = new Enumeration(DocumentReferenceStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #supercedes} (Whether this document manifest replaces another.) + */ + public Reference getSupercedes() { + if (this.supercedes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.supercedes"); + else if (Configuration.doAutoCreate()) + this.supercedes = new Reference(); + return this.supercedes; + } + + public boolean hasSupercedes() { + return this.supercedes != null && !this.supercedes.isEmpty(); + } + + /** + * @param value {@link #supercedes} (Whether this document manifest replaces another.) + */ + public DocumentManifest setSupercedes(Reference value) { + this.supercedes = value; + return this; + } + + /** + * @return {@link #supercedes} 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. (Whether this document manifest replaces another.) + */ + public DocumentManifest getSupercedesTarget() { + if (this.supercedesTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.supercedes"); + else if (Configuration.doAutoCreate()) + this.supercedesTarget = new DocumentManifest(); + return this.supercedesTarget; + } + + /** + * @param value {@link #supercedes} 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. (Whether this document manifest replaces another.) + */ + public DocumentManifest setSupercedesTarget(DocumentManifest value) { + this.supercedesTarget = value; + return this; + } + + /** + * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). 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 DocumentManifest.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 the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DocumentManifest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the source document. This is sometimes known as the "title". + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the source document. This is sometimes known as the "title". + */ + public DocumentManifest setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #confidentiality} (A code specifying the level of confidentiality of this set of Documents.) + */ + public CodeableConcept getConfidentiality() { + if (this.confidentiality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentManifest.confidentiality"); + else if (Configuration.doAutoCreate()) + this.confidentiality = new CodeableConcept(); + return this.confidentiality; + } + + public boolean hasConfidentiality() { + return this.confidentiality != null && !this.confidentiality.isEmpty(); + } + + /** + * @param value {@link #confidentiality} (A code specifying the level of confidentiality of this set of Documents.) + */ + public DocumentManifest setConfidentiality(CodeableConcept value) { + this.confidentiality = value; + return this; + } + + /** + * @return {@link #content} (The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (Reference item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) + */ + // syntactic sugar + public Reference addContent() { //3 + Reference t = new Reference(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + /** + * @return {@link #content} (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 list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.) + */ + public List getContentTarget() { + if (this.contentTarget == null) + this.contentTarget = new ArrayList(); + return this.contentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("masterIdentifier", "Identifier", "A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent, source record and workflow related identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|Organization)", "A patient, practitioner, or organization for which this set of documents is intended.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("created", "dateTime", "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).", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("source", "uri", "Identifies the source system, application, or software that produced the document manifest.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("status", "code", "The status of this document manifest.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("supercedes", "Reference(DocumentManifest)", "Whether this document manifest replaces another.", 0, java.lang.Integer.MAX_VALUE, supercedes)); + childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("confidentiality", "CodeableConcept", "A code specifying the level of confidentiality of this set of Documents.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); + childrenList.add(new Property("content", "Reference(DocumentReference|Binary|Media)", "The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public DocumentManifest copy() { + DocumentManifest dst = new DocumentManifest(); + copyValues(dst); + dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (subject != null) { + dst.subject = new ArrayList(); + for (Reference i : subject) + dst.subject.add(i.copy()); + }; + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.created = created == null ? null : created.copy(); + dst.source = source == null ? null : source.copy(); + dst.status = status == null ? null : status.copy(); + dst.supercedes = supercedes == null ? null : supercedes.copy(); + dst.description = description == null ? null : description.copy(); + dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (Reference i : content) + dst.content.add(i.copy()); + }; + return dst; + } + + protected DocumentManifest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (recipient == null || recipient.isEmpty()) && (type == null || type.isEmpty()) + && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) && (source == null || source.isEmpty()) + && (status == null || status.isEmpty()) && (supercedes == null || supercedes.isEmpty()) && (description == null || description.isEmpty()) + && (confidentiality == null || confidentiality.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DocumentManifest; + } + + @SearchParamDefinition(name="content", path="DocumentManifest.content", description="Contents of this set of documents", type="reference" ) + public static final String SP_CONTENT = "content"; + @SearchParamDefinition(name="author", path="DocumentManifest.author", description="Who and/or what authored the document", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="patient", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="supersedes", path="DocumentManifest.supercedes", description="If this document manifest replaces another", type="reference" ) + public static final String SP_SUPERSEDES = "supersedes"; + @SearchParamDefinition(name="status", path="DocumentManifest.status", description="current | superceded | entered in error", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="created", path="DocumentManifest.created", description="When this document manifest created", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="confidentiality", path="DocumentManifest.confidentiality", description="Sensitivity of set of documents", type="token" ) + public static final String SP_CONFIDENTIALITY = "confidentiality"; + @SearchParamDefinition(name="description", path="DocumentManifest.description", description="Human-readable description (title)", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="type", path="DocumentManifest.type", description="What kind of document set this is", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier|DocumentManifest.identifier", description="Unique Identifier for the set of documents", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="Intended to get notified about this set of documents", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java index babbc1b6020..ed477bde6b5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java @@ -20,2106 +20,2106 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A reference to a document. - */ -@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") -public class DocumentReference extends DomainResource { - - public enum DocumentReferenceStatus implements FhirEnum { - /** - * This is the current reference for this document. - */ - CURRENT, - /** - * This reference has been superseded by another reference. - */ - SUPERCEDED, - /** - * This reference was created in error. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CURRENT; - if ("superceded".equals(codeString)) - return SUPERCEDED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case SUPERCEDED: return "superceded"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return ""; - case SUPERCEDED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "This is the current reference for this document."; - case SUPERCEDED: return "This reference has been superseded by another reference."; - case ENTEREDINERROR: return "This reference was created in error."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "current"; - case SUPERCEDED: return "superceded"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - } - - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return DocumentReferenceStatus.CURRENT; - if ("superceded".equals(codeString)) - return DocumentReferenceStatus.SUPERCEDED; - if ("entered in error".equals(codeString)) - return DocumentReferenceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException { - if (code == DocumentReferenceStatus.CURRENT) - return "current"; - if (code == DocumentReferenceStatus.SUPERCEDED) - return "superceded"; - if (code == DocumentReferenceStatus.ENTEREDINERROR) - return "entered in error"; - return "?"; - } - } - - public enum DocumentRelationshipType implements FhirEnum { - /** - * This document logically replaces or supercedes the target document. - */ - REPLACES, - /** - * This document was generated by transforming the target document (e.g. format or language conversion). - */ - TRANSFORMS, - /** - * This document is a signature of the target document. - */ - SIGNS, - /** - * This document adds additional information to the target document. - */ - APPENDS, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REPLACES; - if ("transforms".equals(codeString)) - return TRANSFORMS; - if ("signs".equals(codeString)) - return SIGNS; - if ("appends".equals(codeString)) - return APPENDS; - throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REPLACES: return "replaces"; - case TRANSFORMS: return "transforms"; - case SIGNS: return "signs"; - case APPENDS: return "appends"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REPLACES: return ""; - case TRANSFORMS: return ""; - case SIGNS: return ""; - case APPENDS: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REPLACES: return "This document logically replaces or supercedes the target document."; - case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion)."; - case SIGNS: return "This document is a signature of the target document."; - case APPENDS: return "This document adds additional information to the target document."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REPLACES: return "replaces"; - case TRANSFORMS: return "transforms"; - case SIGNS: return "signs"; - case APPENDS: return "appends"; - default: return "?"; - } - } - } - - public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { - public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("replaces".equals(codeString)) - return DocumentRelationshipType.REPLACES; - if ("transforms".equals(codeString)) - return DocumentRelationshipType.TRANSFORMS; - if ("signs".equals(codeString)) - return DocumentRelationshipType.SIGNS; - if ("appends".equals(codeString)) - return DocumentRelationshipType.APPENDS; - throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - public String toCode(DocumentRelationshipType code) throws IllegalArgumentException { - if (code == DocumentRelationshipType.REPLACES) - return "replaces"; - if (code == DocumentRelationshipType.TRANSFORMS) - return "transforms"; - if (code == DocumentRelationshipType.SIGNS) - return "signs"; - if (code == DocumentRelationshipType.APPENDS) - return "appends"; - return "?"; - } - } - - @Block() - public static class DocumentReferenceRelatesToComponent extends BackboneElement { - /** - * The type of relationship that this document has with anther document. - */ - @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this document has with anther document." ) - protected Enumeration code; - - /** - * The target document of this relationship. - */ - @Child(name="target", type={DocumentReference.class}, order=2, min=1, max=1) - @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The target document of this relationship.) - */ - protected DocumentReference targetTarget; - - private static final long serialVersionUID = -347257495L; - - public DocumentReferenceRelatesToComponent() { - super(); - } - - public DocumentReferenceRelatesToComponent(Enumeration code, Reference target) { - super(); - this.code = code; - this.target = target; - } - - /** - * @return {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public DocumentReferenceRelatesToComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return The type of relationship that this document has with anther document. - */ - public DocumentRelationshipType getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The type of relationship that this document has with anther document. - */ - public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { - if (this.code == null) - this.code = new Enumeration(DocumentRelationshipType.ENUM_FACTORY); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #target} (The target document of this relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The target document of this relationship.) - */ - public DocumentReferenceRelatesToComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 target document of this relationship.) - */ - public DocumentReference getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new DocumentReference(); - return this.targetTarget; - } - - /** - * @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 target document of this relationship.) - */ - public DocumentReferenceRelatesToComponent setTargetTarget(DocumentReference value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "The type of relationship that this document has with anther document.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public DocumentReferenceRelatesToComponent copy() { - DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - @Block() - public static class DocumentReferenceServiceComponent extends BackboneElement { - /** - * The type of the service that can be used to access the documents. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type of service (i.e. XDS.b)", formalDefinition="The type of the service that can be used to access the documents." ) - protected CodeableConcept type; - - /** - * Where the service end-point is located. - */ - @Child(name="address", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Where service is located (usually a URL)", formalDefinition="Where the service end-point is located." ) - protected StringType address; - - /** - * A list of named parameters that is used in the service call. - */ - @Child(name="parameter", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service call parameters", formalDefinition="A list of named parameters that is used in the service call." ) - protected List parameter; - - private static final long serialVersionUID = 1797455740L; - - public DocumentReferenceServiceComponent() { - super(); - } - - public DocumentReferenceServiceComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of the service that can be used to access the documents.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceServiceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the service that can be used to access the documents.) - */ - public DocumentReferenceServiceComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #address} (Where the service end-point is located.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value - */ - public StringType getAddressElement() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceServiceComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new StringType(); - return this.address; - } - - public boolean hasAddressElement() { - return this.address != null && !this.address.isEmpty(); - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Where the service end-point is located.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value - */ - public DocumentReferenceServiceComponent setAddressElement(StringType value) { - this.address = value; - return this; - } - - /** - * @return Where the service end-point is located. - */ - public String getAddress() { - return this.address == null ? null : this.address.getValue(); - } - - /** - * @param value Where the service end-point is located. - */ - public DocumentReferenceServiceComponent setAddress(String value) { - if (Utilities.noString(value)) - this.address = null; - else { - if (this.address == null) - this.address = new StringType(); - this.address.setValue(value); - } - return this; - } - - /** - * @return {@link #parameter} (A list of named parameters that is used in the service call.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (DocumentReferenceServiceParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (A list of named parameters that is used in the service call.) - */ - // syntactic sugar - public DocumentReferenceServiceParameterComponent addParameter() { //3 - DocumentReferenceServiceParameterComponent t = new DocumentReferenceServiceParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The type of the service that can be used to access the documents.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("address", "string", "Where the service end-point is located.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("parameter", "", "A list of named parameters that is used in the service call.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - public DocumentReferenceServiceComponent copy() { - DocumentReferenceServiceComponent dst = new DocumentReferenceServiceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.address = address == null ? null : address.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (DocumentReferenceServiceParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (address == null || address.isEmpty()) - && (parameter == null || parameter.isEmpty()); - } - - } - - @Block() - public static class DocumentReferenceServiceParameterComponent extends BackboneElement { - /** - * The name of a parameter. - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Parameter name in service call", formalDefinition="The name of a parameter." ) - protected StringType name; - - /** - * The value of the named parameter. - */ - @Child(name="value", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Parameter value for the name", formalDefinition="The value of the named parameter." ) - protected StringType value; - - private static final long serialVersionUID = 395259392L; - - public DocumentReferenceServiceParameterComponent() { - super(); - } - - public DocumentReferenceServiceParameterComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of a parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceServiceParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 a parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DocumentReferenceServiceParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of a parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of a parameter. - */ - public DocumentReferenceServiceParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the named parameter.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceServiceParameterComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the named parameter.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DocumentReferenceServiceParameterComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value of the named parameter. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value of the named parameter. - */ - public DocumentReferenceServiceParameterComponent setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of a parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value", "string", "The value of the named parameter.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public DocumentReferenceServiceParameterComponent copy() { - DocumentReferenceServiceParameterComponent dst = new DocumentReferenceServiceParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - @Block() - public static class DocumentReferenceContextComponent extends BackboneElement { - /** - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. - */ - @Child(name="event", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Main Clinical Acts Documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) - protected List event; - - /** - * The time period over which the service that is described by the document was provided. - */ - @Child(name="period", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Time of service that is being documented", formalDefinition="The time period over which the service that is described by the document was provided." ) - protected Period period; - - /** - * The kind of facility where the patient was seen. - */ - @Child(name="facilityType", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." ) - protected CodeableConcept facilityType; - - private static final long serialVersionUID = -1762960949L; - - public DocumentReferenceContextComponent() { - super(); - } - - /** - * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (CodeableConcept item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) - */ - // syntactic sugar - public CodeableConcept addEvent() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - /** - * @return {@link #period} (The time period over which the service that is described by the document was provided.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.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} (The time period over which the service that is described by the document was provided.) - */ - public DocumentReferenceContextComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #facilityType} (The kind of facility where the patient was seen.) - */ - public CodeableConcept getFacilityType() { - if (this.facilityType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.facilityType"); - else if (Configuration.doAutoCreate()) - this.facilityType = new CodeableConcept(); - return this.facilityType; - } - - public boolean hasFacilityType() { - return this.facilityType != null && !this.facilityType.isEmpty(); - } - - /** - * @param value {@link #facilityType} (The kind of facility where the patient was seen.) - */ - public DocumentReferenceContextComponent setFacilityType(CodeableConcept value) { - this.facilityType = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, java.lang.Integer.MAX_VALUE, facilityType)); - } - - public DocumentReferenceContextComponent copy() { - DocumentReferenceContextComponent dst = new DocumentReferenceContextComponent(); - copyValues(dst); - if (event != null) { - dst.event = new ArrayList(); - for (CodeableConcept i : event) - dst.event.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.facilityType = facilityType == null ? null : facilityType.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (period == null || period.isEmpty()) - && (facilityType == null || facilityType.isEmpty()); - } - - } - - /** - * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. - */ - @Child(name="masterIdentifier", type={Identifier.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Master Version Specific Identifier", formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document." ) - protected Identifier masterIdentifier; - - /** - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers. - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the document", formalDefinition="Other identifiers associated with the document, including version independent, source record and workflow related identifiers." ) - protected List identifier; - - /** - * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). - */ - @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class}, order=1, min=1, max=1) - @Description(shortDefinition="Who|what is the subject of the document", formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - protected Resource subjectTarget; - - /** - * Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.). - */ - @Child(name="type", type={CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="What kind of document this is (LOINC if possible)", formalDefinition="Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.)." ) - protected CodeableConcept type; - - /** - * A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type. - */ - @Child(name="class_", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Categorization of Document", formalDefinition="A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type." ) - protected CodeableConcept class_; - - /** - * Identifies who is responsible for adding the information to the document. - */ - @Child(name="author", type={Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) - */ - protected List authorTarget; - - - /** - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. - */ - @Child(name="custodian", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Org which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." ) - protected Reference custodian; - - /** - * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - protected Organization custodianTarget; - - /** - * A reference to a domain or server that manages policies under which the document is accessed and/or made available. - */ - @Child(name="policyManager", type={UriType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Manages access policies for the document", formalDefinition="A reference to a domain or server that manages policies under which the document is accessed and/or made available." ) - protected UriType policyManager; - - /** - * Which person or organization authenticates that this document is valid. - */ - @Child(name="authenticator", type={Practitioner.class, Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Who/What authenticated the document", formalDefinition="Which person or organization authenticates that this document is valid." ) - protected Reference authenticator; - - /** - * The actual object that is the target of the reference (Which person or organization authenticates that this document is valid.) - */ - protected Resource authenticatorTarget; - - /** - * When the document was created. - */ - @Child(name="created", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Document creation time", formalDefinition="When the document was created." ) - protected DateTimeType created; - - /** - * When the document reference was created. - */ - @Child(name="indexed", type={InstantType.class}, order=9, min=1, max=1) - @Description(shortDefinition="When this document reference created", formalDefinition="When the document reference was created." ) - protected InstantType indexed; - - /** - * The status of this document reference. - */ - @Child(name="status", type={CodeType.class}, order=10, min=1, max=1) - @Description(shortDefinition="current | superceded | entered in error", formalDefinition="The status of this document reference." ) - protected Enumeration status; - - /** - * The status of the underlying document. - */ - @Child(name="docStatus", type={CodeableConcept.class}, order=11, min=0, max=1) - @Description(shortDefinition="preliminary | final | appended | amended | entered in error", formalDefinition="The status of the underlying document." ) - protected CodeableConcept docStatus; - - /** - * Relationships that this document has with other document references that already exist. - */ - @Child(name="relatesTo", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." ) - protected List relatesTo; - - /** - * Human-readable description of the source document. This is sometimes known as the "title". - */ - @Child(name="description", type={StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) - protected StringType description; - - /** - * A code specifying the level of confidentiality of the XDS Document. - */ - @Child(name="confidentiality", type={CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Sensitivity of source document", formalDefinition="A code specifying the level of confidentiality of the XDS Document." ) - protected List confidentiality; - - /** - * The primary language in which the source document is written. - */ - @Child(name="primaryLanguage", type={CodeType.class}, order=15, min=0, max=1) - @Description(shortDefinition="The marked primary language for the document", formalDefinition="The primary language in which the source document is written." ) - protected CodeType primaryLanguage; - - /** - * The mime type of the source document. - */ - @Child(name="mimeType", type={CodeType.class}, order=16, min=1, max=1) - @Description(shortDefinition="Mime type, + maybe character encoding", formalDefinition="The mime type of the source document." ) - protected CodeType mimeType; - - /** - * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType. - */ - @Child(name="format", type={UriType.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Format/content rules for the document", formalDefinition="An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType." ) - protected List format; - - /** - * The size of the source document this reference refers to in bytes. - */ - @Child(name="size", type={IntegerType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Size of the document in bytes", formalDefinition="The size of the source document this reference refers to in bytes." ) - protected IntegerType size; - - /** - * A hash of the source document to ensure that changes have not occurred. - */ - @Child(name="hash", type={Base64BinaryType.class}, order=19, min=0, max=1) - @Description(shortDefinition="Base64 representation of SHA1", formalDefinition="A hash of the source document to ensure that changes have not occurred." ) - protected Base64BinaryType hash; - - /** - * A url at which the document can be accessed. - */ - @Child(name="location", type={UriType.class}, order=20, min=0, max=1) - @Description(shortDefinition="Where to access the document", formalDefinition="A url at which the document can be accessed." ) - protected UriType location; - - /** - * A description of a service call that can be used to retrieve the document. - */ - @Child(name="service", type={}, order=21, min=0, max=1) - @Description(shortDefinition="If access is not fully described by location", formalDefinition="A description of a service call that can be used to retrieve the document." ) - protected DocumentReferenceServiceComponent service; - - /** - * The clinical context in which the document was prepared. - */ - @Child(name="context", type={}, order=22, min=0, max=1) - @Description(shortDefinition="Clinical context of document", formalDefinition="The clinical context in which the document was prepared." ) - protected DocumentReferenceContextComponent context; - - private static final long serialVersionUID = -752030368L; - - public DocumentReference() { - super(); - } - - public DocumentReference(Identifier masterIdentifier, Reference subject, CodeableConcept type, InstantType indexed, Enumeration status, CodeType mimeType) { - super(); - this.masterIdentifier = masterIdentifier; - this.subject = subject; - this.type = type; - this.indexed = indexed; - this.status = status; - this.mimeType = mimeType; - } - - /** - * @return {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) - */ - public Identifier getMasterIdentifier() { - if (this.masterIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.masterIdentifier"); - else if (Configuration.doAutoCreate()) - this.masterIdentifier = new Identifier(); - return this.masterIdentifier; - } - - public boolean hasMasterIdentifier() { - return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); - } - - /** - * @param value {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) - */ - public DocumentReference setMasterIdentifier(Identifier value) { - this.masterIdentifier = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.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} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public DocumentReference 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. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public Resource getSubjectTarget() { - 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. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) - */ - public DocumentReference setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #type} (Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) - */ - public DocumentReference setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #class_} (A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type.) - */ - public CodeableConcept getClass_() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new CodeableConcept(); - return this.class_; - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type.) - */ - public DocumentReference setClass_(CodeableConcept value) { - this.class_ = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - /** - * @return {@link #author} (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 who is responsible for adding the information to the document.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public Reference getCustodian() { - if (this.custodian == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.custodian"); - else if (Configuration.doAutoCreate()) - this.custodian = new Reference(); - return this.custodian; - } - - public boolean hasCustodian() { - return this.custodian != null && !this.custodian.isEmpty(); - } - - /** - * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public DocumentReference setCustodian(Reference value) { - this.custodian = value; - return this; - } - - /** - * @return {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public Organization getCustodianTarget() { - if (this.custodianTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.custodian"); - else if (Configuration.doAutoCreate()) - this.custodianTarget = new Organization(); - return this.custodianTarget; - } - - /** - * @param value {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public DocumentReference setCustodianTarget(Organization value) { - this.custodianTarget = value; - return this; - } - - /** - * @return {@link #policyManager} (A reference to a domain or server that manages policies under which the document is accessed and/or made available.). This is the underlying object with id, value and extensions. The accessor "getPolicyManager" gives direct access to the value - */ - public UriType getPolicyManagerElement() { - if (this.policyManager == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.policyManager"); - else if (Configuration.doAutoCreate()) - this.policyManager = new UriType(); - return this.policyManager; - } - - public boolean hasPolicyManagerElement() { - return this.policyManager != null && !this.policyManager.isEmpty(); - } - - public boolean hasPolicyManager() { - return this.policyManager != null && !this.policyManager.isEmpty(); - } - - /** - * @param value {@link #policyManager} (A reference to a domain or server that manages policies under which the document is accessed and/or made available.). This is the underlying object with id, value and extensions. The accessor "getPolicyManager" gives direct access to the value - */ - public DocumentReference setPolicyManagerElement(UriType value) { - this.policyManager = value; - return this; - } - - /** - * @return A reference to a domain or server that manages policies under which the document is accessed and/or made available. - */ - public String getPolicyManager() { - return this.policyManager == null ? null : this.policyManager.getValue(); - } - - /** - * @param value A reference to a domain or server that manages policies under which the document is accessed and/or made available. - */ - public DocumentReference setPolicyManager(String value) { - if (Utilities.noString(value)) - this.policyManager = null; - else { - if (this.policyManager == null) - this.policyManager = new UriType(); - this.policyManager.setValue(value); - } - return this; - } - - /** - * @return {@link #authenticator} (Which person or organization authenticates that this document is valid.) - */ - public Reference getAuthenticator() { - if (this.authenticator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.authenticator"); - else if (Configuration.doAutoCreate()) - this.authenticator = new Reference(); - return this.authenticator; - } - - public boolean hasAuthenticator() { - return this.authenticator != null && !this.authenticator.isEmpty(); - } - - /** - * @param value {@link #authenticator} (Which person or organization authenticates that this document is valid.) - */ - public DocumentReference setAuthenticator(Reference value) { - this.authenticator = value; - return this; - } - - /** - * @return {@link #authenticator} 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. (Which person or organization authenticates that this document is valid.) - */ - public Resource getAuthenticatorTarget() { - return this.authenticatorTarget; - } - - /** - * @param value {@link #authenticator} 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. (Which person or organization authenticates that this document is valid.) - */ - public DocumentReference setAuthenticatorTarget(Resource value) { - this.authenticatorTarget = value; - return this; - } - - /** - * @return {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DocumentReference setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return When the document was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value When the document was created. - */ - public DocumentReference setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value - */ - public InstantType getIndexedElement() { - if (this.indexed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.indexed"); - else if (Configuration.doAutoCreate()) - this.indexed = new InstantType(); - return this.indexed; - } - - public boolean hasIndexedElement() { - return this.indexed != null && !this.indexed.isEmpty(); - } - - public boolean hasIndexed() { - return this.indexed != null && !this.indexed.isEmpty(); - } - - /** - * @param value {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value - */ - public DocumentReference setIndexedElement(InstantType value) { - this.indexed = value; - return this; - } - - /** - * @return When the document reference was created. - */ - public Date getIndexed() { - return this.indexed == null ? null : this.indexed.getValue(); - } - - /** - * @param value When the document reference was created. - */ - public DocumentReference setIndexed(Date value) { - if (this.indexed == null) - this.indexed = new InstantType(); - this.indexed.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DocumentReference setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this document reference. - */ - public DocumentReferenceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this document reference. - */ - public DocumentReference setStatus(DocumentReferenceStatus value) { - if (this.status == null) - this.status = new Enumeration(DocumentReferenceStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #docStatus} (The status of the underlying document.) - */ - public CodeableConcept getDocStatus() { - if (this.docStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.docStatus"); - else if (Configuration.doAutoCreate()) - this.docStatus = new CodeableConcept(); - return this.docStatus; - } - - public boolean hasDocStatus() { - return this.docStatus != null && !this.docStatus.isEmpty(); - } - - /** - * @param value {@link #docStatus} (The status of the underlying document.) - */ - public DocumentReference setDocStatus(CodeableConcept value) { - this.docStatus = value; - return this; - } - - /** - * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) - */ - public List getRelatesTo() { - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - return this.relatesTo; - } - - public boolean hasRelatesTo() { - if (this.relatesTo == null) - return false; - for (DocumentReferenceRelatesToComponent item : this.relatesTo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) - */ - // syntactic sugar - public DocumentReferenceRelatesToComponent addRelatesTo() { //3 - DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent(); - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - this.relatesTo.add(t); - return t; - } - - /** - * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). 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 DocumentReference.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 the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DocumentReference setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the source document. This is sometimes known as the "title". - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the source document. This is sometimes known as the "title". - */ - public DocumentReference setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #confidentiality} (A code specifying the level of confidentiality of the XDS Document.) - */ - public List getConfidentiality() { - if (this.confidentiality == null) - this.confidentiality = new ArrayList(); - return this.confidentiality; - } - - public boolean hasConfidentiality() { - if (this.confidentiality == null) - return false; - for (CodeableConcept item : this.confidentiality) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #confidentiality} (A code specifying the level of confidentiality of the XDS Document.) - */ - // syntactic sugar - public CodeableConcept addConfidentiality() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.confidentiality == null) - this.confidentiality = new ArrayList(); - this.confidentiality.add(t); - return t; - } - - /** - * @return {@link #primaryLanguage} (The primary language in which the source document is written.). This is the underlying object with id, value and extensions. The accessor "getPrimaryLanguage" gives direct access to the value - */ - public CodeType getPrimaryLanguageElement() { - if (this.primaryLanguage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.primaryLanguage"); - else if (Configuration.doAutoCreate()) - this.primaryLanguage = new CodeType(); - return this.primaryLanguage; - } - - public boolean hasPrimaryLanguageElement() { - return this.primaryLanguage != null && !this.primaryLanguage.isEmpty(); - } - - public boolean hasPrimaryLanguage() { - return this.primaryLanguage != null && !this.primaryLanguage.isEmpty(); - } - - /** - * @param value {@link #primaryLanguage} (The primary language in which the source document is written.). This is the underlying object with id, value and extensions. The accessor "getPrimaryLanguage" gives direct access to the value - */ - public DocumentReference setPrimaryLanguageElement(CodeType value) { - this.primaryLanguage = value; - return this; - } - - /** - * @return The primary language in which the source document is written. - */ - public String getPrimaryLanguage() { - return this.primaryLanguage == null ? null : this.primaryLanguage.getValue(); - } - - /** - * @param value The primary language in which the source document is written. - */ - public DocumentReference setPrimaryLanguage(String value) { - if (Utilities.noString(value)) - this.primaryLanguage = null; - else { - if (this.primaryLanguage == null) - this.primaryLanguage = new CodeType(); - this.primaryLanguage.setValue(value); - } - return this; - } - - /** - * @return {@link #mimeType} (The mime type of the source document.). This is the underlying object with id, value and extensions. The accessor "getMimeType" gives direct access to the value - */ - public CodeType getMimeTypeElement() { - if (this.mimeType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.mimeType"); - else if (Configuration.doAutoCreate()) - this.mimeType = new CodeType(); - return this.mimeType; - } - - public boolean hasMimeTypeElement() { - return this.mimeType != null && !this.mimeType.isEmpty(); - } - - public boolean hasMimeType() { - return this.mimeType != null && !this.mimeType.isEmpty(); - } - - /** - * @param value {@link #mimeType} (The mime type of the source document.). This is the underlying object with id, value and extensions. The accessor "getMimeType" gives direct access to the value - */ - public DocumentReference setMimeTypeElement(CodeType value) { - this.mimeType = value; - return this; - } - - /** - * @return The mime type of the source document. - */ - public String getMimeType() { - return this.mimeType == null ? null : this.mimeType.getValue(); - } - - /** - * @param value The mime type of the source document. - */ - public DocumentReference setMimeType(String value) { - if (this.mimeType == null) - this.mimeType = new CodeType(); - this.mimeType.setValue(value); - return this; - } - - /** - * @return {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) - */ - public List getFormat() { - if (this.format == null) - this.format = new ArrayList(); - return this.format; - } - - public boolean hasFormat() { - if (this.format == null) - return false; - for (UriType item : this.format) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) - */ - // syntactic sugar - public UriType addFormatElement() {//2 - UriType t = new UriType(); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return t; - } - - /** - * @param value {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) - */ - public DocumentReference addFormat(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return this; - } - - /** - * @param value {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) - */ - public boolean hasFormat(String value) { - if (this.format == null) - return false; - for (UriType v : this.format) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #size} (The size of the source document this reference refers to in bytes.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public IntegerType getSizeElement() { - if (this.size == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.size"); - else if (Configuration.doAutoCreate()) - this.size = new IntegerType(); - return this.size; - } - - public boolean hasSizeElement() { - return this.size != null && !this.size.isEmpty(); - } - - public boolean hasSize() { - return this.size != null && !this.size.isEmpty(); - } - - /** - * @param value {@link #size} (The size of the source document this reference refers to in bytes.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public DocumentReference setSizeElement(IntegerType value) { - this.size = value; - return this; - } - - /** - * @return The size of the source document this reference refers to in bytes. - */ - public int getSize() { - return this.size == null ? null : this.size.getValue(); - } - - /** - * @param value The size of the source document this reference refers to in bytes. - */ - public DocumentReference setSize(int value) { - if (value == -1) - this.size = null; - else { - if (this.size == null) - this.size = new IntegerType(); - this.size.setValue(value); - } - return this; - } - - /** - * @return {@link #hash} (A hash of the source document to ensure that changes have not occurred.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Base64BinaryType getHashElement() { - if (this.hash == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.hash"); - else if (Configuration.doAutoCreate()) - this.hash = new Base64BinaryType(); - return this.hash; - } - - public boolean hasHashElement() { - return this.hash != null && !this.hash.isEmpty(); - } - - public boolean hasHash() { - return this.hash != null && !this.hash.isEmpty(); - } - - /** - * @param value {@link #hash} (A hash of the source document to ensure that changes have not occurred.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public DocumentReference setHashElement(Base64BinaryType value) { - this.hash = value; - return this; - } - - /** - * @return A hash of the source document to ensure that changes have not occurred. - */ - public byte[] getHash() { - return this.hash == null ? null : this.hash.getValue(); - } - - /** - * @param value A hash of the source document to ensure that changes have not occurred. - */ - public DocumentReference setHash(byte[] value) { - if (value == null) - this.hash = null; - else { - if (this.hash == null) - this.hash = new Base64BinaryType(); - this.hash.setValue(value); - } - return this; - } - - /** - * @return {@link #location} (A url at which the document can be accessed.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value - */ - public UriType getLocationElement() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.location"); - else if (Configuration.doAutoCreate()) - this.location = new UriType(); - return this.location; - } - - public boolean hasLocationElement() { - return this.location != null && !this.location.isEmpty(); - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (A url at which the document can be accessed.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value - */ - public DocumentReference setLocationElement(UriType value) { - this.location = value; - return this; - } - - /** - * @return A url at which the document can be accessed. - */ - public String getLocation() { - return this.location == null ? null : this.location.getValue(); - } - - /** - * @param value A url at which the document can be accessed. - */ - public DocumentReference setLocation(String value) { - if (Utilities.noString(value)) - this.location = null; - else { - if (this.location == null) - this.location = new UriType(); - this.location.setValue(value); - } - return this; - } - - /** - * @return {@link #service} (A description of a service call that can be used to retrieve the document.) - */ - public DocumentReferenceServiceComponent getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.service"); - else if (Configuration.doAutoCreate()) - this.service = new DocumentReferenceServiceComponent(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A description of a service call that can be used to retrieve the document.) - */ - public DocumentReference setService(DocumentReferenceServiceComponent value) { - this.service = value; - return this; - } - - /** - * @return {@link #context} (The clinical context in which the document was prepared.) - */ - public DocumentReferenceContextComponent getContext() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.context"); - else if (Configuration.doAutoCreate()) - this.context = new DocumentReferenceContextComponent(); - return this.context; - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (The clinical context in which the document was prepared.) - */ - public DocumentReference setContext(DocumentReferenceContextComponent value) { - this.context = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("masterIdentifier", "Identifier", "Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent, source record and workflow related identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, java.lang.Integer.MAX_VALUE, custodian)); - childrenList.add(new Property("policyManager", "uri", "A reference to a domain or server that manages policies under which the document is accessed and/or made available.", 0, java.lang.Integer.MAX_VALUE, policyManager)); - childrenList.add(new Property("authenticator", "Reference(Practitioner|Organization)", "Which person or organization authenticates that this document is valid.", 0, java.lang.Integer.MAX_VALUE, authenticator)); - childrenList.add(new Property("created", "dateTime", "When the document was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("indexed", "instant", "When the document reference was created.", 0, java.lang.Integer.MAX_VALUE, indexed)); - childrenList.add(new Property("status", "code", "The status of this document reference.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("docStatus", "CodeableConcept", "The status of the underlying document.", 0, java.lang.Integer.MAX_VALUE, docStatus)); - childrenList.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo)); - childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("confidentiality", "CodeableConcept", "A code specifying the level of confidentiality of the XDS Document.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); - childrenList.add(new Property("primaryLanguage", "code", "The primary language in which the source document is written.", 0, java.lang.Integer.MAX_VALUE, primaryLanguage)); - childrenList.add(new Property("mimeType", "code", "The mime type of the source document.", 0, java.lang.Integer.MAX_VALUE, mimeType)); - childrenList.add(new Property("format", "uri", "An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("size", "integer", "The size of the source document this reference refers to in bytes.", 0, java.lang.Integer.MAX_VALUE, size)); - childrenList.add(new Property("hash", "base64Binary", "A hash of the source document to ensure that changes have not occurred.", 0, java.lang.Integer.MAX_VALUE, hash)); - childrenList.add(new Property("location", "uri", "A url at which the document can be accessed.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("service", "", "A description of a service call that can be used to retrieve the document.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("context", "", "The clinical context in which the document was prepared.", 0, java.lang.Integer.MAX_VALUE, context)); - } - - public DocumentReference copy() { - DocumentReference dst = new DocumentReference(); - copyValues(dst); - dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.type = type == null ? null : type.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.custodian = custodian == null ? null : custodian.copy(); - dst.policyManager = policyManager == null ? null : policyManager.copy(); - dst.authenticator = authenticator == null ? null : authenticator.copy(); - dst.created = created == null ? null : created.copy(); - dst.indexed = indexed == null ? null : indexed.copy(); - dst.status = status == null ? null : status.copy(); - dst.docStatus = docStatus == null ? null : docStatus.copy(); - if (relatesTo != null) { - dst.relatesTo = new ArrayList(); - for (DocumentReferenceRelatesToComponent i : relatesTo) - dst.relatesTo.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (confidentiality != null) { - dst.confidentiality = new ArrayList(); - for (CodeableConcept i : confidentiality) - dst.confidentiality.add(i.copy()); - }; - dst.primaryLanguage = primaryLanguage == null ? null : primaryLanguage.copy(); - dst.mimeType = mimeType == null ? null : mimeType.copy(); - if (format != null) { - dst.format = new ArrayList(); - for (UriType i : format) - dst.format.add(i.copy()); - }; - dst.size = size == null ? null : size.copy(); - dst.hash = hash == null ? null : hash.copy(); - dst.location = location == null ? null : location.copy(); - dst.service = service == null ? null : service.copy(); - dst.context = context == null ? null : context.copy(); - return dst; - } - - protected DocumentReference typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) - && (author == null || author.isEmpty()) && (custodian == null || custodian.isEmpty()) && (policyManager == null || policyManager.isEmpty()) - && (authenticator == null || authenticator.isEmpty()) && (created == null || created.isEmpty()) - && (indexed == null || indexed.isEmpty()) && (status == null || status.isEmpty()) && (docStatus == null || docStatus.isEmpty()) - && (relatesTo == null || relatesTo.isEmpty()) && (description == null || description.isEmpty()) - && (confidentiality == null || confidentiality.isEmpty()) && (primaryLanguage == null || primaryLanguage.isEmpty()) - && (mimeType == null || mimeType.isEmpty()) && (format == null || format.isEmpty()) && (size == null || size.isEmpty()) - && (hash == null || hash.isEmpty()) && (location == null || location.isEmpty()) && (service == null || service.isEmpty()) - && (context == null || context.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DocumentReference; - } - - @SearchParamDefinition(name="location", path="DocumentReference.location", description="Where to access the document", type="string" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="When this document reference created", type="date" ) - public static final String SP_INDEXED = "indexed"; - @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superceded | entered in error", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference" ) - public static final String SP_RELATESTO = "relatesto"; - @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" ) - public static final String SP_RELATION = "relation"; - @SearchParamDefinition(name="class", path="DocumentReference.class", description="Categorization of Document", type="token" ) - public static final String SP_CLASS = "class"; - @SearchParamDefinition(name="format", path="DocumentReference.format", description="Format/content rules for the document", type="token" ) - public static final String SP_FORMAT = "format"; - @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="Time of service that is being documented", type="date" ) - public static final String SP_PERIOD = "period"; - @SearchParamDefinition(name="type", path="DocumentReference.type", description="What kind of document this is (LOINC if possible)", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="Who/What authenticated the document", type="reference" ) - public static final String SP_AUTHENTICATOR = "authenticator"; - @SearchParamDefinition(name="size", path="DocumentReference.size", description="Size of the document in bytes", type="number" ) - public static final String SP_SIZE = "size"; - @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite" ) - public static final String SP_RELATIONSHIP = "relationship"; - @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Org which maintains the document", type="reference" ) - public static final String SP_CUSTODIAN = "custodian"; - @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="Kind of facility where patient was seen", type="token" ) - public static final String SP_FACILITY = "facility"; - @SearchParamDefinition(name="created", path="DocumentReference.created", description="Document creation time", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="Main Clinical Acts Documented", type="token" ) - public static final String SP_EVENT = "event"; - @SearchParamDefinition(name="confidentiality", path="DocumentReference.confidentiality", description="Sensitivity of source document", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description (title)", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="language", path="DocumentReference.primaryLanguage", description="The marked primary language for the document", type="token" ) - public static final String SP_LANGUAGE = "language"; - @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier|DocumentReference.identifier", description="Master Version Specific Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * A reference to a document. + */ +@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") +public class DocumentReference extends DomainResource { + + public enum DocumentReferenceStatus implements FhirEnum { + /** + * This is the current reference for this document. + */ + CURRENT, + /** + * This reference has been superseded by another reference. + */ + SUPERCEDED, + /** + * This reference was created in error. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CURRENT; + if ("superceded".equals(codeString)) + return SUPERCEDED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CURRENT: return "current"; + case SUPERCEDED: return "superceded"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CURRENT: return ""; + case SUPERCEDED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CURRENT: return "This is the current reference for this document."; + case SUPERCEDED: return "This reference has been superseded by another reference."; + case ENTEREDINERROR: return "This reference was created in error."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CURRENT: return "current"; + case SUPERCEDED: return "superceded"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + } + + public static class DocumentReferenceStatusEnumFactory implements EnumFactory { + public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("current".equals(codeString)) + return DocumentReferenceStatus.CURRENT; + if ("superceded".equals(codeString)) + return DocumentReferenceStatus.SUPERCEDED; + if ("entered in error".equals(codeString)) + return DocumentReferenceStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); + } + public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException { + if (code == DocumentReferenceStatus.CURRENT) + return "current"; + if (code == DocumentReferenceStatus.SUPERCEDED) + return "superceded"; + if (code == DocumentReferenceStatus.ENTEREDINERROR) + return "entered in error"; + return "?"; + } + } + + public enum DocumentRelationshipType implements FhirEnum { + /** + * This document logically replaces or supercedes the target document. + */ + REPLACES, + /** + * This document was generated by transforming the target document (e.g. format or language conversion). + */ + TRANSFORMS, + /** + * This document is a signature of the target document. + */ + SIGNS, + /** + * This document adds additional information to the target document. + */ + APPENDS, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REPLACES; + if ("transforms".equals(codeString)) + return TRANSFORMS; + if ("signs".equals(codeString)) + return SIGNS; + if ("appends".equals(codeString)) + return APPENDS; + throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REPLACES: return "replaces"; + case TRANSFORMS: return "transforms"; + case SIGNS: return "signs"; + case APPENDS: return "appends"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REPLACES: return ""; + case TRANSFORMS: return ""; + case SIGNS: return ""; + case APPENDS: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REPLACES: return "This document logically replaces or supercedes the target document."; + case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion)."; + case SIGNS: return "This document is a signature of the target document."; + case APPENDS: return "This document adds additional information to the target document."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REPLACES: return "replaces"; + case TRANSFORMS: return "transforms"; + case SIGNS: return "signs"; + case APPENDS: return "appends"; + default: return "?"; + } + } + } + + public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { + public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("replaces".equals(codeString)) + return DocumentRelationshipType.REPLACES; + if ("transforms".equals(codeString)) + return DocumentRelationshipType.TRANSFORMS; + if ("signs".equals(codeString)) + return DocumentRelationshipType.SIGNS; + if ("appends".equals(codeString)) + return DocumentRelationshipType.APPENDS; + throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); + } + public String toCode(DocumentRelationshipType code) throws IllegalArgumentException { + if (code == DocumentRelationshipType.REPLACES) + return "replaces"; + if (code == DocumentRelationshipType.TRANSFORMS) + return "transforms"; + if (code == DocumentRelationshipType.SIGNS) + return "signs"; + if (code == DocumentRelationshipType.APPENDS) + return "appends"; + return "?"; + } + } + + @Block() + public static class DocumentReferenceRelatesToComponent extends BackboneElement { + /** + * The type of relationship that this document has with anther document. + */ + @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this document has with anther document." ) + protected Enumeration code; + + /** + * The target document of this relationship. + */ + @Child(name="target", type={DocumentReference.class}, order=2, min=1, max=1) + @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The target document of this relationship.) + */ + protected DocumentReference targetTarget; + + private static final long serialVersionUID = -347257495L; + + public DocumentReferenceRelatesToComponent() { + super(); + } + + public DocumentReferenceRelatesToComponent(Enumeration code, Reference target) { + super(); + this.code = code; + this.target = target; + } + + /** + * @return {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public DocumentReferenceRelatesToComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return The type of relationship that this document has with anther document. + */ + public DocumentRelationshipType getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value The type of relationship that this document has with anther document. + */ + public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { + if (this.code == null) + this.code = new Enumeration(DocumentRelationshipType.ENUM_FACTORY); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #target} (The target document of this relationship.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The target document of this relationship.) + */ + public DocumentReferenceRelatesToComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 target document of this relationship.) + */ + public DocumentReference getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new DocumentReference(); + return this.targetTarget; + } + + /** + * @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 target document of this relationship.) + */ + public DocumentReferenceRelatesToComponent setTargetTarget(DocumentReference value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "The type of relationship that this document has with anther document.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public DocumentReferenceRelatesToComponent copy() { + DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class DocumentReferenceServiceComponent extends BackboneElement { + /** + * The type of the service that can be used to access the documents. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of service (i.e. XDS.b)", formalDefinition="The type of the service that can be used to access the documents." ) + protected CodeableConcept type; + + /** + * Where the service end-point is located. + */ + @Child(name="address", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Where service is located (usually a URL)", formalDefinition="Where the service end-point is located." ) + protected StringType address; + + /** + * A list of named parameters that is used in the service call. + */ + @Child(name="parameter", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service call parameters", formalDefinition="A list of named parameters that is used in the service call." ) + protected List parameter; + + private static final long serialVersionUID = 1797455740L; + + public DocumentReferenceServiceComponent() { + super(); + } + + public DocumentReferenceServiceComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The type of the service that can be used to access the documents.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceServiceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the service that can be used to access the documents.) + */ + public DocumentReferenceServiceComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #address} (Where the service end-point is located.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value + */ + public StringType getAddressElement() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceServiceComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new StringType(); + return this.address; + } + + public boolean hasAddressElement() { + return this.address != null && !this.address.isEmpty(); + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Where the service end-point is located.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value + */ + public DocumentReferenceServiceComponent setAddressElement(StringType value) { + this.address = value; + return this; + } + + /** + * @return Where the service end-point is located. + */ + public String getAddress() { + return this.address == null ? null : this.address.getValue(); + } + + /** + * @param value Where the service end-point is located. + */ + public DocumentReferenceServiceComponent setAddress(String value) { + if (Utilities.noString(value)) + this.address = null; + else { + if (this.address == null) + this.address = new StringType(); + this.address.setValue(value); + } + return this; + } + + /** + * @return {@link #parameter} (A list of named parameters that is used in the service call.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (DocumentReferenceServiceParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (A list of named parameters that is used in the service call.) + */ + // syntactic sugar + public DocumentReferenceServiceParameterComponent addParameter() { //3 + DocumentReferenceServiceParameterComponent t = new DocumentReferenceServiceParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The type of the service that can be used to access the documents.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("address", "string", "Where the service end-point is located.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("parameter", "", "A list of named parameters that is used in the service call.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + public DocumentReferenceServiceComponent copy() { + DocumentReferenceServiceComponent dst = new DocumentReferenceServiceComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.address = address == null ? null : address.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (DocumentReferenceServiceParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (address == null || address.isEmpty()) + && (parameter == null || parameter.isEmpty()); + } + + } + + @Block() + public static class DocumentReferenceServiceParameterComponent extends BackboneElement { + /** + * The name of a parameter. + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Parameter name in service call", formalDefinition="The name of a parameter." ) + protected StringType name; + + /** + * The value of the named parameter. + */ + @Child(name="value", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Parameter value for the name", formalDefinition="The value of the named parameter." ) + protected StringType value; + + private static final long serialVersionUID = 395259392L; + + public DocumentReferenceServiceParameterComponent() { + super(); + } + + public DocumentReferenceServiceParameterComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name of a parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceServiceParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 a parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public DocumentReferenceServiceParameterComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of a parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of a parameter. + */ + public DocumentReferenceServiceParameterComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the named parameter.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceServiceParameterComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the named parameter.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DocumentReferenceServiceParameterComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The value of the named parameter. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value of the named parameter. + */ + public DocumentReferenceServiceParameterComponent setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of a parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value", "string", "The value of the named parameter.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public DocumentReferenceServiceParameterComponent copy() { + DocumentReferenceServiceParameterComponent dst = new DocumentReferenceServiceParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + @Block() + public static class DocumentReferenceContextComponent extends BackboneElement { + /** + * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + */ + @Child(name="event", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Main Clinical Acts Documented", formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act." ) + protected List event; + + /** + * The time period over which the service that is described by the document was provided. + */ + @Child(name="period", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time of service that is being documented", formalDefinition="The time period over which the service that is described by the document was provided." ) + protected Period period; + + /** + * The kind of facility where the patient was seen. + */ + @Child(name="facilityType", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." ) + protected CodeableConcept facilityType; + + private static final long serialVersionUID = -1762960949L; + + public DocumentReferenceContextComponent() { + super(); + } + + /** + * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (CodeableConcept item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.) + */ + // syntactic sugar + public CodeableConcept addEvent() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + /** + * @return {@link #period} (The time period over which the service that is described by the document was provided.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.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} (The time period over which the service that is described by the document was provided.) + */ + public DocumentReferenceContextComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #facilityType} (The kind of facility where the patient was seen.) + */ + public CodeableConcept getFacilityType() { + if (this.facilityType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReferenceContextComponent.facilityType"); + else if (Configuration.doAutoCreate()) + this.facilityType = new CodeableConcept(); + return this.facilityType; + } + + public boolean hasFacilityType() { + return this.facilityType != null && !this.facilityType.isEmpty(); + } + + /** + * @param value {@link #facilityType} (The kind of facility where the patient was seen.) + */ + public DocumentReferenceContextComponent setFacilityType(CodeableConcept value) { + this.facilityType = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "CodeableConcept", "This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a 'History and Physical Report' in which the procedure being documented is necessarily a 'History and Physical' act.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, java.lang.Integer.MAX_VALUE, facilityType)); + } + + public DocumentReferenceContextComponent copy() { + DocumentReferenceContextComponent dst = new DocumentReferenceContextComponent(); + copyValues(dst); + if (event != null) { + dst.event = new ArrayList(); + for (CodeableConcept i : event) + dst.event.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.facilityType = facilityType == null ? null : facilityType.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (period == null || period.isEmpty()) + && (facilityType == null || facilityType.isEmpty()); + } + + } + + /** + * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. + */ + @Child(name="masterIdentifier", type={Identifier.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Master Version Specific Identifier", formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document." ) + protected Identifier masterIdentifier; + + /** + * Other identifiers associated with the document, including version independent, source record and workflow related identifiers. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the document", formalDefinition="Other identifiers associated with the document, including version independent, source record and workflow related identifiers." ) + protected List identifier; + + /** + * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). + */ + @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class}, order=1, min=1, max=1) + @Description(shortDefinition="Who|what is the subject of the document", formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + protected Resource subjectTarget; + + /** + * Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.). + */ + @Child(name="type", type={CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="What kind of document this is (LOINC if possible)", formalDefinition="Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.)." ) + protected CodeableConcept type; + + /** + * A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type. + */ + @Child(name="class_", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Categorization of Document", formalDefinition="A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type." ) + protected CodeableConcept class_; + + /** + * Identifies who is responsible for adding the information to the document. + */ + @Child(name="author", type={Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) + protected List author; + /** + * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) + */ + protected List authorTarget; + + + /** + * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. + */ + @Child(name="custodian", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Org which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." ) + protected Reference custodian; + + /** + * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + protected Organization custodianTarget; + + /** + * A reference to a domain or server that manages policies under which the document is accessed and/or made available. + */ + @Child(name="policyManager", type={UriType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Manages access policies for the document", formalDefinition="A reference to a domain or server that manages policies under which the document is accessed and/or made available." ) + protected UriType policyManager; + + /** + * Which person or organization authenticates that this document is valid. + */ + @Child(name="authenticator", type={Practitioner.class, Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Who/What authenticated the document", formalDefinition="Which person or organization authenticates that this document is valid." ) + protected Reference authenticator; + + /** + * The actual object that is the target of the reference (Which person or organization authenticates that this document is valid.) + */ + protected Resource authenticatorTarget; + + /** + * When the document was created. + */ + @Child(name="created", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Document creation time", formalDefinition="When the document was created." ) + protected DateTimeType created; + + /** + * When the document reference was created. + */ + @Child(name="indexed", type={InstantType.class}, order=9, min=1, max=1) + @Description(shortDefinition="When this document reference created", formalDefinition="When the document reference was created." ) + protected InstantType indexed; + + /** + * The status of this document reference. + */ + @Child(name="status", type={CodeType.class}, order=10, min=1, max=1) + @Description(shortDefinition="current | superceded | entered in error", formalDefinition="The status of this document reference." ) + protected Enumeration status; + + /** + * The status of the underlying document. + */ + @Child(name="docStatus", type={CodeableConcept.class}, order=11, min=0, max=1) + @Description(shortDefinition="preliminary | final | appended | amended | entered in error", formalDefinition="The status of the underlying document." ) + protected CodeableConcept docStatus; + + /** + * Relationships that this document has with other document references that already exist. + */ + @Child(name="relatesTo", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." ) + protected List relatesTo; + + /** + * Human-readable description of the source document. This is sometimes known as the "title". + */ + @Child(name="description", type={StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the 'title'." ) + protected StringType description; + + /** + * A code specifying the level of confidentiality of the XDS Document. + */ + @Child(name="confidentiality", type={CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Sensitivity of source document", formalDefinition="A code specifying the level of confidentiality of the XDS Document." ) + protected List confidentiality; + + /** + * The primary language in which the source document is written. + */ + @Child(name="primaryLanguage", type={CodeType.class}, order=15, min=0, max=1) + @Description(shortDefinition="The marked primary language for the document", formalDefinition="The primary language in which the source document is written." ) + protected CodeType primaryLanguage; + + /** + * The mime type of the source document. + */ + @Child(name="mimeType", type={CodeType.class}, order=16, min=1, max=1) + @Description(shortDefinition="Mime type, + maybe character encoding", formalDefinition="The mime type of the source document." ) + protected CodeType mimeType; + + /** + * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType. + */ + @Child(name="format", type={UriType.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Format/content rules for the document", formalDefinition="An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType." ) + protected List format; + + /** + * The size of the source document this reference refers to in bytes. + */ + @Child(name="size", type={IntegerType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Size of the document in bytes", formalDefinition="The size of the source document this reference refers to in bytes." ) + protected IntegerType size; + + /** + * A hash of the source document to ensure that changes have not occurred. + */ + @Child(name="hash", type={Base64BinaryType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Base64 representation of SHA1", formalDefinition="A hash of the source document to ensure that changes have not occurred." ) + protected Base64BinaryType hash; + + /** + * A url at which the document can be accessed. + */ + @Child(name="location", type={UriType.class}, order=20, min=0, max=1) + @Description(shortDefinition="Where to access the document", formalDefinition="A url at which the document can be accessed." ) + protected UriType location; + + /** + * A description of a service call that can be used to retrieve the document. + */ + @Child(name="service", type={}, order=21, min=0, max=1) + @Description(shortDefinition="If access is not fully described by location", formalDefinition="A description of a service call that can be used to retrieve the document." ) + protected DocumentReferenceServiceComponent service; + + /** + * The clinical context in which the document was prepared. + */ + @Child(name="context", type={}, order=22, min=0, max=1) + @Description(shortDefinition="Clinical context of document", formalDefinition="The clinical context in which the document was prepared." ) + protected DocumentReferenceContextComponent context; + + private static final long serialVersionUID = -752030368L; + + public DocumentReference() { + super(); + } + + public DocumentReference(Identifier masterIdentifier, Reference subject, CodeableConcept type, InstantType indexed, Enumeration status, CodeType mimeType) { + super(); + this.masterIdentifier = masterIdentifier; + this.subject = subject; + this.type = type; + this.indexed = indexed; + this.status = status; + this.mimeType = mimeType; + } + + /** + * @return {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) + */ + public Identifier getMasterIdentifier() { + if (this.masterIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.masterIdentifier"); + else if (Configuration.doAutoCreate()) + this.masterIdentifier = new Identifier(); + return this.masterIdentifier; + } + + public boolean hasMasterIdentifier() { + return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); + } + + /** + * @param value {@link #masterIdentifier} (Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.) + */ + public DocumentReference setMasterIdentifier(Identifier value) { + this.masterIdentifier = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Other identifiers associated with the document, including version independent, source record and workflow related identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.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} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public DocumentReference 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. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public Resource getSubjectTarget() { + 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. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).) + */ + public DocumentReference setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #type} (Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.).) + */ + public DocumentReference setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #class_} (A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type.) + */ + public CodeableConcept getClass_() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new CodeableConcept(); + return this.class_; + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type.) + */ + public DocumentReference setClass_(CodeableConcept value) { + this.class_ = value; + return this; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + public List getAuthor() { + if (this.author == null) + this.author = new ArrayList(); + return this.author; + } + + public boolean hasAuthor() { + if (this.author == null) + return false; + for (Reference item : this.author) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #author} (Identifies who is responsible for adding the information to the document.) + */ + // syntactic sugar + public Reference addAuthor() { //3 + Reference t = new Reference(); + if (this.author == null) + this.author = new ArrayList(); + this.author.add(t); + return t; + } + + /** + * @return {@link #author} (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 who is responsible for adding the information to the document.) + */ + public List getAuthorTarget() { + if (this.authorTarget == null) + this.authorTarget = new ArrayList(); + return this.authorTarget; + } + + /** + * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public Reference getCustodian() { + if (this.custodian == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.custodian"); + else if (Configuration.doAutoCreate()) + this.custodian = new Reference(); + return this.custodian; + } + + public boolean hasCustodian() { + return this.custodian != null && !this.custodian.isEmpty(); + } + + /** + * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public DocumentReference setCustodian(Reference value) { + this.custodian = value; + return this; + } + + /** + * @return {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public Organization getCustodianTarget() { + if (this.custodianTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.custodian"); + else if (Configuration.doAutoCreate()) + this.custodianTarget = new Organization(); + return this.custodianTarget; + } + + /** + * @param value {@link #custodian} 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 organization or group who is responsible for ongoing maintenance of and access to the document.) + */ + public DocumentReference setCustodianTarget(Organization value) { + this.custodianTarget = value; + return this; + } + + /** + * @return {@link #policyManager} (A reference to a domain or server that manages policies under which the document is accessed and/or made available.). This is the underlying object with id, value and extensions. The accessor "getPolicyManager" gives direct access to the value + */ + public UriType getPolicyManagerElement() { + if (this.policyManager == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.policyManager"); + else if (Configuration.doAutoCreate()) + this.policyManager = new UriType(); + return this.policyManager; + } + + public boolean hasPolicyManagerElement() { + return this.policyManager != null && !this.policyManager.isEmpty(); + } + + public boolean hasPolicyManager() { + return this.policyManager != null && !this.policyManager.isEmpty(); + } + + /** + * @param value {@link #policyManager} (A reference to a domain or server that manages policies under which the document is accessed and/or made available.). This is the underlying object with id, value and extensions. The accessor "getPolicyManager" gives direct access to the value + */ + public DocumentReference setPolicyManagerElement(UriType value) { + this.policyManager = value; + return this; + } + + /** + * @return A reference to a domain or server that manages policies under which the document is accessed and/or made available. + */ + public String getPolicyManager() { + return this.policyManager == null ? null : this.policyManager.getValue(); + } + + /** + * @param value A reference to a domain or server that manages policies under which the document is accessed and/or made available. + */ + public DocumentReference setPolicyManager(String value) { + if (Utilities.noString(value)) + this.policyManager = null; + else { + if (this.policyManager == null) + this.policyManager = new UriType(); + this.policyManager.setValue(value); + } + return this; + } + + /** + * @return {@link #authenticator} (Which person or organization authenticates that this document is valid.) + */ + public Reference getAuthenticator() { + if (this.authenticator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.authenticator"); + else if (Configuration.doAutoCreate()) + this.authenticator = new Reference(); + return this.authenticator; + } + + public boolean hasAuthenticator() { + return this.authenticator != null && !this.authenticator.isEmpty(); + } + + /** + * @param value {@link #authenticator} (Which person or organization authenticates that this document is valid.) + */ + public DocumentReference setAuthenticator(Reference value) { + this.authenticator = value; + return this; + } + + /** + * @return {@link #authenticator} 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. (Which person or organization authenticates that this document is valid.) + */ + public Resource getAuthenticatorTarget() { + return this.authenticatorTarget; + } + + /** + * @param value {@link #authenticator} 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. (Which person or organization authenticates that this document is valid.) + */ + public DocumentReference setAuthenticatorTarget(Resource value) { + this.authenticatorTarget = value; + return this; + } + + /** + * @return {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DocumentReference setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return When the document was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value When the document was created. + */ + public DocumentReference setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value + */ + public InstantType getIndexedElement() { + if (this.indexed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.indexed"); + else if (Configuration.doAutoCreate()) + this.indexed = new InstantType(); + return this.indexed; + } + + public boolean hasIndexedElement() { + return this.indexed != null && !this.indexed.isEmpty(); + } + + public boolean hasIndexed() { + return this.indexed != null && !this.indexed.isEmpty(); + } + + /** + * @param value {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value + */ + public DocumentReference setIndexedElement(InstantType value) { + this.indexed = value; + return this; + } + + /** + * @return When the document reference was created. + */ + public Date getIndexed() { + return this.indexed == null ? null : this.indexed.getValue(); + } + + /** + * @param value When the document reference was created. + */ + public DocumentReference setIndexed(Date value) { + if (this.indexed == null) + this.indexed = new InstantType(); + this.indexed.setValue(value); + return this; + } + + /** + * @return {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public DocumentReference setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of this document reference. + */ + public DocumentReferenceStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of this document reference. + */ + public DocumentReference setStatus(DocumentReferenceStatus value) { + if (this.status == null) + this.status = new Enumeration(DocumentReferenceStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #docStatus} (The status of the underlying document.) + */ + public CodeableConcept getDocStatus() { + if (this.docStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.docStatus"); + else if (Configuration.doAutoCreate()) + this.docStatus = new CodeableConcept(); + return this.docStatus; + } + + public boolean hasDocStatus() { + return this.docStatus != null && !this.docStatus.isEmpty(); + } + + /** + * @param value {@link #docStatus} (The status of the underlying document.) + */ + public DocumentReference setDocStatus(CodeableConcept value) { + this.docStatus = value; + return this; + } + + /** + * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) + */ + public List getRelatesTo() { + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + return this.relatesTo; + } + + public boolean hasRelatesTo() { + if (this.relatesTo == null) + return false; + for (DocumentReferenceRelatesToComponent item : this.relatesTo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) + */ + // syntactic sugar + public DocumentReferenceRelatesToComponent addRelatesTo() { //3 + DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent(); + if (this.relatesTo == null) + this.relatesTo = new ArrayList(); + this.relatesTo.add(t); + return t; + } + + /** + * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). 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 DocumentReference.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 the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public DocumentReference setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of the source document. This is sometimes known as the "title". + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of the source document. This is sometimes known as the "title". + */ + public DocumentReference setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #confidentiality} (A code specifying the level of confidentiality of the XDS Document.) + */ + public List getConfidentiality() { + if (this.confidentiality == null) + this.confidentiality = new ArrayList(); + return this.confidentiality; + } + + public boolean hasConfidentiality() { + if (this.confidentiality == null) + return false; + for (CodeableConcept item : this.confidentiality) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #confidentiality} (A code specifying the level of confidentiality of the XDS Document.) + */ + // syntactic sugar + public CodeableConcept addConfidentiality() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.confidentiality == null) + this.confidentiality = new ArrayList(); + this.confidentiality.add(t); + return t; + } + + /** + * @return {@link #primaryLanguage} (The primary language in which the source document is written.). This is the underlying object with id, value and extensions. The accessor "getPrimaryLanguage" gives direct access to the value + */ + public CodeType getPrimaryLanguageElement() { + if (this.primaryLanguage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.primaryLanguage"); + else if (Configuration.doAutoCreate()) + this.primaryLanguage = new CodeType(); + return this.primaryLanguage; + } + + public boolean hasPrimaryLanguageElement() { + return this.primaryLanguage != null && !this.primaryLanguage.isEmpty(); + } + + public boolean hasPrimaryLanguage() { + return this.primaryLanguage != null && !this.primaryLanguage.isEmpty(); + } + + /** + * @param value {@link #primaryLanguage} (The primary language in which the source document is written.). This is the underlying object with id, value and extensions. The accessor "getPrimaryLanguage" gives direct access to the value + */ + public DocumentReference setPrimaryLanguageElement(CodeType value) { + this.primaryLanguage = value; + return this; + } + + /** + * @return The primary language in which the source document is written. + */ + public String getPrimaryLanguage() { + return this.primaryLanguage == null ? null : this.primaryLanguage.getValue(); + } + + /** + * @param value The primary language in which the source document is written. + */ + public DocumentReference setPrimaryLanguage(String value) { + if (Utilities.noString(value)) + this.primaryLanguage = null; + else { + if (this.primaryLanguage == null) + this.primaryLanguage = new CodeType(); + this.primaryLanguage.setValue(value); + } + return this; + } + + /** + * @return {@link #mimeType} (The mime type of the source document.). This is the underlying object with id, value and extensions. The accessor "getMimeType" gives direct access to the value + */ + public CodeType getMimeTypeElement() { + if (this.mimeType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.mimeType"); + else if (Configuration.doAutoCreate()) + this.mimeType = new CodeType(); + return this.mimeType; + } + + public boolean hasMimeTypeElement() { + return this.mimeType != null && !this.mimeType.isEmpty(); + } + + public boolean hasMimeType() { + return this.mimeType != null && !this.mimeType.isEmpty(); + } + + /** + * @param value {@link #mimeType} (The mime type of the source document.). This is the underlying object with id, value and extensions. The accessor "getMimeType" gives direct access to the value + */ + public DocumentReference setMimeTypeElement(CodeType value) { + this.mimeType = value; + return this; + } + + /** + * @return The mime type of the source document. + */ + public String getMimeType() { + return this.mimeType == null ? null : this.mimeType.getValue(); + } + + /** + * @param value The mime type of the source document. + */ + public DocumentReference setMimeType(String value) { + if (this.mimeType == null) + this.mimeType = new CodeType(); + this.mimeType.setValue(value); + return this; + } + + /** + * @return {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) + */ + public List getFormat() { + if (this.format == null) + this.format = new ArrayList(); + return this.format; + } + + public boolean hasFormat() { + if (this.format == null) + return false; + for (UriType item : this.format) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) + */ + // syntactic sugar + public UriType addFormatElement() {//2 + UriType t = new UriType(); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return t; + } + + /** + * @param value {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) + */ + public DocumentReference addFormat(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.format == null) + this.format = new ArrayList(); + this.format.add(t); + return this; + } + + /** + * @param value {@link #format} (An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.) + */ + public boolean hasFormat(String value) { + if (this.format == null) + return false; + for (UriType v : this.format) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #size} (The size of the source document this reference refers to in bytes.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public IntegerType getSizeElement() { + if (this.size == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.size"); + else if (Configuration.doAutoCreate()) + this.size = new IntegerType(); + return this.size; + } + + public boolean hasSizeElement() { + return this.size != null && !this.size.isEmpty(); + } + + public boolean hasSize() { + return this.size != null && !this.size.isEmpty(); + } + + /** + * @param value {@link #size} (The size of the source document this reference refers to in bytes.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value + */ + public DocumentReference setSizeElement(IntegerType value) { + this.size = value; + return this; + } + + /** + * @return The size of the source document this reference refers to in bytes. + */ + public int getSize() { + return this.size == null ? null : this.size.getValue(); + } + + /** + * @param value The size of the source document this reference refers to in bytes. + */ + public DocumentReference setSize(int value) { + if (value == -1) + this.size = null; + else { + if (this.size == null) + this.size = new IntegerType(); + this.size.setValue(value); + } + return this; + } + + /** + * @return {@link #hash} (A hash of the source document to ensure that changes have not occurred.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public Base64BinaryType getHashElement() { + if (this.hash == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.hash"); + else if (Configuration.doAutoCreate()) + this.hash = new Base64BinaryType(); + return this.hash; + } + + public boolean hasHashElement() { + return this.hash != null && !this.hash.isEmpty(); + } + + public boolean hasHash() { + return this.hash != null && !this.hash.isEmpty(); + } + + /** + * @param value {@link #hash} (A hash of the source document to ensure that changes have not occurred.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value + */ + public DocumentReference setHashElement(Base64BinaryType value) { + this.hash = value; + return this; + } + + /** + * @return A hash of the source document to ensure that changes have not occurred. + */ + public byte[] getHash() { + return this.hash == null ? null : this.hash.getValue(); + } + + /** + * @param value A hash of the source document to ensure that changes have not occurred. + */ + public DocumentReference setHash(byte[] value) { + if (value == null) + this.hash = null; + else { + if (this.hash == null) + this.hash = new Base64BinaryType(); + this.hash.setValue(value); + } + return this; + } + + /** + * @return {@link #location} (A url at which the document can be accessed.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value + */ + public UriType getLocationElement() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.location"); + else if (Configuration.doAutoCreate()) + this.location = new UriType(); + return this.location; + } + + public boolean hasLocationElement() { + return this.location != null && !this.location.isEmpty(); + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (A url at which the document can be accessed.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value + */ + public DocumentReference setLocationElement(UriType value) { + this.location = value; + return this; + } + + /** + * @return A url at which the document can be accessed. + */ + public String getLocation() { + return this.location == null ? null : this.location.getValue(); + } + + /** + * @param value A url at which the document can be accessed. + */ + public DocumentReference setLocation(String value) { + if (Utilities.noString(value)) + this.location = null; + else { + if (this.location == null) + this.location = new UriType(); + this.location.setValue(value); + } + return this; + } + + /** + * @return {@link #service} (A description of a service call that can be used to retrieve the document.) + */ + public DocumentReferenceServiceComponent getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.service"); + else if (Configuration.doAutoCreate()) + this.service = new DocumentReferenceServiceComponent(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (A description of a service call that can be used to retrieve the document.) + */ + public DocumentReference setService(DocumentReferenceServiceComponent value) { + this.service = value; + return this; + } + + /** + * @return {@link #context} (The clinical context in which the document was prepared.) + */ + public DocumentReferenceContextComponent getContext() { + if (this.context == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DocumentReference.context"); + else if (Configuration.doAutoCreate()) + this.context = new DocumentReferenceContextComponent(); + return this.context; + } + + public boolean hasContext() { + return this.context != null && !this.context.isEmpty(); + } + + /** + * @param value {@link #context} (The clinical context in which the document was prepared.) + */ + public DocumentReference setContext(DocumentReferenceContextComponent value) { + this.context = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("masterIdentifier", "Identifier", "Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent, source record and workflow related identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, java.lang.Integer.MAX_VALUE, custodian)); + childrenList.add(new Property("policyManager", "uri", "A reference to a domain or server that manages policies under which the document is accessed and/or made available.", 0, java.lang.Integer.MAX_VALUE, policyManager)); + childrenList.add(new Property("authenticator", "Reference(Practitioner|Organization)", "Which person or organization authenticates that this document is valid.", 0, java.lang.Integer.MAX_VALUE, authenticator)); + childrenList.add(new Property("created", "dateTime", "When the document was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("indexed", "instant", "When the document reference was created.", 0, java.lang.Integer.MAX_VALUE, indexed)); + childrenList.add(new Property("status", "code", "The status of this document reference.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("docStatus", "CodeableConcept", "The status of the underlying document.", 0, java.lang.Integer.MAX_VALUE, docStatus)); + childrenList.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo)); + childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the 'title'.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("confidentiality", "CodeableConcept", "A code specifying the level of confidentiality of the XDS Document.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); + childrenList.add(new Property("primaryLanguage", "code", "The primary language in which the source document is written.", 0, java.lang.Integer.MAX_VALUE, primaryLanguage)); + childrenList.add(new Property("mimeType", "code", "The mime type of the source document.", 0, java.lang.Integer.MAX_VALUE, mimeType)); + childrenList.add(new Property("format", "uri", "An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, format)); + childrenList.add(new Property("size", "integer", "The size of the source document this reference refers to in bytes.", 0, java.lang.Integer.MAX_VALUE, size)); + childrenList.add(new Property("hash", "base64Binary", "A hash of the source document to ensure that changes have not occurred.", 0, java.lang.Integer.MAX_VALUE, hash)); + childrenList.add(new Property("location", "uri", "A url at which the document can be accessed.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("service", "", "A description of a service call that can be used to retrieve the document.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("context", "", "The clinical context in which the document was prepared.", 0, java.lang.Integer.MAX_VALUE, context)); + } + + public DocumentReference copy() { + DocumentReference dst = new DocumentReference(); + copyValues(dst); + dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.type = type == null ? null : type.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + if (author != null) { + dst.author = new ArrayList(); + for (Reference i : author) + dst.author.add(i.copy()); + }; + dst.custodian = custodian == null ? null : custodian.copy(); + dst.policyManager = policyManager == null ? null : policyManager.copy(); + dst.authenticator = authenticator == null ? null : authenticator.copy(); + dst.created = created == null ? null : created.copy(); + dst.indexed = indexed == null ? null : indexed.copy(); + dst.status = status == null ? null : status.copy(); + dst.docStatus = docStatus == null ? null : docStatus.copy(); + if (relatesTo != null) { + dst.relatesTo = new ArrayList(); + for (DocumentReferenceRelatesToComponent i : relatesTo) + dst.relatesTo.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (confidentiality != null) { + dst.confidentiality = new ArrayList(); + for (CodeableConcept i : confidentiality) + dst.confidentiality.add(i.copy()); + }; + dst.primaryLanguage = primaryLanguage == null ? null : primaryLanguage.copy(); + dst.mimeType = mimeType == null ? null : mimeType.copy(); + if (format != null) { + dst.format = new ArrayList(); + for (UriType i : format) + dst.format.add(i.copy()); + }; + dst.size = size == null ? null : size.copy(); + dst.hash = hash == null ? null : hash.copy(); + dst.location = location == null ? null : location.copy(); + dst.service = service == null ? null : service.copy(); + dst.context = context == null ? null : context.copy(); + return dst; + } + + protected DocumentReference typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) + && (author == null || author.isEmpty()) && (custodian == null || custodian.isEmpty()) && (policyManager == null || policyManager.isEmpty()) + && (authenticator == null || authenticator.isEmpty()) && (created == null || created.isEmpty()) + && (indexed == null || indexed.isEmpty()) && (status == null || status.isEmpty()) && (docStatus == null || docStatus.isEmpty()) + && (relatesTo == null || relatesTo.isEmpty()) && (description == null || description.isEmpty()) + && (confidentiality == null || confidentiality.isEmpty()) && (primaryLanguage == null || primaryLanguage.isEmpty()) + && (mimeType == null || mimeType.isEmpty()) && (format == null || format.isEmpty()) && (size == null || size.isEmpty()) + && (hash == null || hash.isEmpty()) && (location == null || location.isEmpty()) && (service == null || service.isEmpty()) + && (context == null || context.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DocumentReference; + } + + @SearchParamDefinition(name="location", path="DocumentReference.location", description="Where to access the document", type="string" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="When this document reference created", type="date" ) + public static final String SP_INDEXED = "indexed"; + @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superceded | entered in error", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference" ) + public static final String SP_RELATESTO = "relatesto"; + @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" ) + public static final String SP_RELATION = "relation"; + @SearchParamDefinition(name="class", path="DocumentReference.class", description="Categorization of Document", type="token" ) + public static final String SP_CLASS = "class"; + @SearchParamDefinition(name="format", path="DocumentReference.format", description="Format/content rules for the document", type="token" ) + public static final String SP_FORMAT = "format"; + @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="Time of service that is being documented", type="date" ) + public static final String SP_PERIOD = "period"; + @SearchParamDefinition(name="type", path="DocumentReference.type", description="What kind of document this is (LOINC if possible)", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="Who/What authenticated the document", type="reference" ) + public static final String SP_AUTHENTICATOR = "authenticator"; + @SearchParamDefinition(name="size", path="DocumentReference.size", description="Size of the document in bytes", type="number" ) + public static final String SP_SIZE = "size"; + @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite" ) + public static final String SP_RELATIONSHIP = "relationship"; + @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="Who|what is the subject of the document", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Org which maintains the document", type="reference" ) + public static final String SP_CUSTODIAN = "custodian"; + @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="Kind of facility where patient was seen", type="token" ) + public static final String SP_FACILITY = "facility"; + @SearchParamDefinition(name="created", path="DocumentReference.created", description="Document creation time", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="Main Clinical Acts Documented", type="token" ) + public static final String SP_EVENT = "event"; + @SearchParamDefinition(name="confidentiality", path="DocumentReference.confidentiality", description="Sensitivity of source document", type="token" ) + public static final String SP_CONFIDENTIALITY = "confidentiality"; + @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description (title)", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="language", path="DocumentReference.primaryLanguage", description="The marked primary language for the document", type="token" ) + public static final String SP_LANGUAGE = "language"; + @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier|DocumentReference.identifier", description="Master Version Specific Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java index ed5d059c051..8413e09b847 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java @@ -20,224 +20,224 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * - */ -@ResourceDef(name="DomainResource", profile="http://hl7.org/fhir/Profile/DomainResource") -public abstract class DomainResource extends Resource { - - /** - * A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - */ - @Child(name="text", type={Narrative.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) - protected Narrative text; - - /** - * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. - */ - @Child(name="contained", type={Resource.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) - protected List contained; - - /** - * May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. - */ - @Child(name="extension", type={Extension.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) - protected List extension; - - /** - * May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. - */ - @Child(name="modifierExtension", type={Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) - protected List modifierExtension; - - private static final long serialVersionUID = -970285559L; - - public DomainResource() { - super(); - } - - /** - * @return {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) - */ - public Narrative getText() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DomainResource.text"); - else if (Configuration.doAutoCreate()) - this.text = new Narrative(); - return this.text; - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) - */ - public DomainResource setText(Narrative value) { - this.text = value; - return this; - } - - /** - * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) - */ - public List getContained() { - if (this.contained == null) - this.contained = new ArrayList(); - return this.contained; - } - - public boolean hasContained() { - if (this.contained == null) - return false; - for (Resource item : this.contained) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) - */ - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - public List getExtension() { - if (this.extension == null) - this.extension = new ArrayList(); - return this.extension; - } - - public boolean hasExtension() { - if (this.extension == null) - return false; - for (Extension item : this.extension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - // syntactic sugar - public Extension addExtension() { //3 - Extension t = new Extension(); - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return t; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - public List getModifierExtension() { - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - return this.modifierExtension; - } - - public boolean hasModifierExtension() { - if (this.modifierExtension == null) - return false; - for (Extension item : this.modifierExtension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - // syntactic sugar - public Extension addModifierExtension() { //3 - Extension t = new Extension(); - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return t; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); - childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); - childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); - } - - public abstract DomainResource copy(); - - public void copyValues(DomainResource dst) { - dst.text = text == null ? null : text.copy(); - if (contained != null) { - dst.contained = new ArrayList(); - for (Resource i : contained) - dst.contained.add(i.copy()); - }; - if (extension != null) { - dst.extension = new ArrayList(); - for (Extension i : extension) - dst.extension.add(i.copy()); - }; - if (modifierExtension != null) { - dst.modifierExtension = new ArrayList(); - for (Extension i : modifierExtension) - dst.modifierExtension.add(i.copy()); - }; - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty()) - && (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty()) - ; - } - - -} - + +/* + 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.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; +/** + * + */ +@ResourceDef(name="DomainResource", profile="http://hl7.org/fhir/Profile/DomainResource") +public abstract class DomainResource extends Resource { + + /** + * A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. + */ + @Child(name="text", type={Narrative.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) + protected Narrative text; + + /** + * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. + */ + @Child(name="contained", type={Resource.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) + protected List contained; + + /** + * May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + */ + @Child(name="extension", type={Extension.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) + protected List extension; + + /** + * May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + */ + @Child(name="modifierExtension", type={Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) + protected List modifierExtension; + + private static final long serialVersionUID = -970285559L; + + public DomainResource() { + super(); + } + + /** + * @return {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) + */ + public Narrative getText() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DomainResource.text"); + else if (Configuration.doAutoCreate()) + this.text = new Narrative(); + return this.text; + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) + */ + public DomainResource setText(Narrative value) { + this.text = value; + return this; + } + + /** + * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) + */ + public List getContained() { + if (this.contained == null) + this.contained = new ArrayList(); + return this.contained; + } + + public boolean hasContained() { + if (this.contained == null) + return false; + for (Resource item : this.contained) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) + */ + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + public List getExtension() { + if (this.extension == null) + this.extension = new ArrayList(); + return this.extension; + } + + public boolean hasExtension() { + if (this.extension == null) + return false; + for (Extension item : this.extension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + // syntactic sugar + public Extension addExtension() { //3 + Extension t = new Extension(); + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return t; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + public List getModifierExtension() { + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + return this.modifierExtension; + } + + public boolean hasModifierExtension() { + if (this.modifierExtension == null) + return false; + for (Extension item : this.modifierExtension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) + */ + // syntactic sugar + public Extension addModifierExtension() { //3 + Extension t = new Extension(); + if (this.modifierExtension == null) + this.modifierExtension = new ArrayList(); + this.modifierExtension.add(t); + return t; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); + childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); + childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); + } + + public abstract DomainResource copy(); + + public void copyValues(DomainResource dst) { + dst.text = text == null ? null : text.copy(); + if (contained != null) { + dst.contained = new ArrayList(); + for (Resource i : contained) + dst.contained.add(i.copy()); + }; + if (extension != null) { + dst.extension = new ArrayList(); + for (Extension i : extension) + dst.extension.add(i.copy()); + }; + if (modifierExtension != null) { + dst.modifierExtension = new ArrayList(); + for (Extension i : modifierExtension) + dst.modifierExtension.add(i.copy()); + }; + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty()) + && (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java index 42a1bd42d7e..9fb66c3ff89 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java @@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Duration") -public class Duration extends Quantity { - - private static final long serialVersionUID = -483422721L; - - public Duration copy() { - Duration dst = new Duration(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.units = units == null ? null : units.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Duration typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - + +/* + 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Duration") +public class Duration extends Quantity { + + private static final long serialVersionUID = -483422721L; + + public Duration copy() { + Duration dst = new Duration(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.units = units == null ? null : units.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Duration typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java index 897c732c086..d79c7a17d77 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java @@ -20,169 +20,169 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * Base definition for all elements in a resource. - */ -public abstract class Element extends Base { - - /** - * unique id for the element within a resource (for internal references). - */ - @Child(name="id", type={IdType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="xml:id (or equivalent in JSON)", formalDefinition="unique id for the element within a resource (for internal references)." ) - protected IdType id; - - /** - * May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. - */ - @Child(name="extension", type={Extension.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) - protected List extension; - - private static final long serialVersionUID = -158027598L; - - public Element() { - super(); - } - - /** - * @return {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public IdType getIdElement() { - if (this.id == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Element.id"); - else if (Configuration.doAutoCreate()) - this.id = new IdType(); - return this.id; - } - - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); - } - - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); - } - - /** - * @param value {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public Element setIdElement(IdType value) { - this.id = value; - return this; - } - - /** - * @return unique id for the element within a resource (for internal references). - */ - public String getId() { - return this.id == null ? null : this.id.getValue(); - } - - /** - * @param value unique id for the element within a resource (for internal references). - */ - public Element setId(String value) { - if (Utilities.noString(value)) - this.id = null; - else { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); - } - return this; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - public List getExtension() { - if (this.extension == null) - this.extension = new ArrayList(); - return this.extension; - } - - public boolean hasExtension() { - if (this.extension == null) - return false; - for (Extension item : this.extension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - // syntactic sugar - public Extension addExtension() { //3 - Extension t = new Extension(); - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return t; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("id", "id", "unique id for the element within a resource (for internal references).", 0, java.lang.Integer.MAX_VALUE, id)); - childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); - } - - public abstract Element copy(); - - public void copyValues(Element dst) { - dst.id = id == null ? null : id.copy(); - if (extension != null) { - dst.extension = new ArrayList(); - for (Extension i : extension) - dst.extension.add(i.copy()); - }; - } - - public boolean isEmpty() { - return super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty()) - ; - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * Base definition for all elements in a resource. + */ +public abstract class Element extends Base { + + /** + * unique id for the element within a resource (for internal references). + */ + @Child(name="id", type={IdType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="xml:id (or equivalent in JSON)", formalDefinition="unique id for the element within a resource (for internal references)." ) + protected IdType id; + + /** + * May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + */ + @Child(name="extension", type={Extension.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) + protected List extension; + + private static final long serialVersionUID = -158027598L; + + public Element() { + super(); + } + + /** + * @return {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public IdType getIdElement() { + if (this.id == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Element.id"); + else if (Configuration.doAutoCreate()) + this.id = new IdType(); + return this.id; + } + + public boolean hasIdElement() { + return this.id != null && !this.id.isEmpty(); + } + + public boolean hasId() { + return this.id != null && !this.id.isEmpty(); + } + + /** + * @param value {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public Element setIdElement(IdType value) { + this.id = value; + return this; + } + + /** + * @return unique id for the element within a resource (for internal references). + */ + public String getId() { + return this.id == null ? null : this.id.getValue(); + } + + /** + * @param value unique id for the element within a resource (for internal references). + */ + public Element setId(String value) { + if (Utilities.noString(value)) + this.id = null; + else { + if (this.id == null) + this.id = new IdType(); + this.id.setValue(value); + } + return this; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + public List getExtension() { + if (this.extension == null) + this.extension = new ArrayList(); + return this.extension; + } + + public boolean hasExtension() { + if (this.extension == null) + return false; + for (Extension item : this.extension) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) + */ + // syntactic sugar + public Extension addExtension() { //3 + Extension t = new Extension(); + if (this.extension == null) + this.extension = new ArrayList(); + this.extension.add(t); + return t; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("id", "id", "unique id for the element within a resource (for internal references).", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); + } + + public abstract Element copy(); + + public void copyValues(Element dst) { + dst.id = id == null ? null : id.copy(); + if (extension != null) { + dst.extension = new ArrayList(); + for (Extension i : extension) + dst.extension.add(i.copy()); + }; + } + + public boolean isEmpty() { + return super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java index c1ca4fb5360..062e5d3c8e5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java @@ -20,3033 +20,3033 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * Captures constraints on each element within the resource, profile, or extension. - */ -@DatatypeDef(name="ElementDefinition") -public class ElementDefinition extends Type implements ICompositeType{ - - public enum PropertyRepresentation implements FhirEnum { - /** - * In XML, this property is represented as an attribute not an element. - */ - XMLATTR, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case XMLATTR: return "xmlAttr"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case XMLATTR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case XMLATTR: return "In XML, this property is represented as an attribute not an element."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case XMLATTR: return "xmlAttr"; - default: return "?"; - } - } - } - - public static class PropertyRepresentationEnumFactory implements EnumFactory { - 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 IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); - } - public String toCode(PropertyRepresentation code) throws IllegalArgumentException { - if (code == PropertyRepresentation.XMLATTR) - return "xmlAttr"; - return "?"; - } - } - - public enum ResourceSlicingRules implements FhirEnum { - /** - * No additional content is allowed other than that described by the slices in this profile. - */ - CLOSED, - /** - * Additional content is allowed anywhere in the list. - */ - OPEN, - /** - * Additional content is allowed, but only at the end of the list. - */ - OPENATEND, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CLOSED; - if ("open".equals(codeString)) - return OPEN; - if ("openAtEnd".equals(codeString)) - return OPENATEND; - throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CLOSED: return "closed"; - case OPEN: return "open"; - case OPENATEND: return "openAtEnd"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CLOSED: return ""; - case OPEN: return ""; - case OPENATEND: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CLOSED: return "No additional content is allowed other than that described by the slices in this profile."; - case OPEN: return "Additional content is allowed anywhere in the list."; - case OPENATEND: return "Additional content is allowed, but only at the end of the list."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CLOSED: return "closed"; - case OPEN: return "open"; - case OPENATEND: return "openAtEnd"; - default: return "?"; - } - } - } - - public static class ResourceSlicingRulesEnumFactory implements EnumFactory { - public ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("closed".equals(codeString)) - return ResourceSlicingRules.CLOSED; - if ("open".equals(codeString)) - return ResourceSlicingRules.OPEN; - if ("openAtEnd".equals(codeString)) - return ResourceSlicingRules.OPENATEND; - throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); - } - public String toCode(ResourceSlicingRules code) throws IllegalArgumentException { - if (code == ResourceSlicingRules.CLOSED) - return "closed"; - if (code == ResourceSlicingRules.OPEN) - return "open"; - if (code == ResourceSlicingRules.OPENATEND) - return "openAtEnd"; - return "?"; - } - } - - public enum ResourceAggregationMode implements FhirEnum { - /** - * The reference is a local reference to a contained resource. - */ - CONTAINED, - /** - * The reference to a resource that has to be resolved externally to the resource that includes the reference. - */ - REFERENCED, - /** - * The resource the reference points to will be found in the same bundle as the resource that includes the reference. - */ - BUNDLED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CONTAINED; - if ("referenced".equals(codeString)) - return REFERENCED; - if ("bundled".equals(codeString)) - return BUNDLED; - throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CONTAINED: return "contained"; - case REFERENCED: return "referenced"; - case BUNDLED: return "bundled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONTAINED: return ""; - case REFERENCED: return ""; - case BUNDLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONTAINED: return "The reference is a local reference to a contained resource."; - case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference."; - case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONTAINED: return "contained"; - case REFERENCED: return "referenced"; - case BUNDLED: return "bundled"; - default: return "?"; - } - } - } - - public static class ResourceAggregationModeEnumFactory implements EnumFactory { - public ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("contained".equals(codeString)) - return ResourceAggregationMode.CONTAINED; - if ("referenced".equals(codeString)) - return ResourceAggregationMode.REFERENCED; - if ("bundled".equals(codeString)) - return ResourceAggregationMode.BUNDLED; - throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); - } - public String toCode(ResourceAggregationMode code) throws IllegalArgumentException { - if (code == ResourceAggregationMode.CONTAINED) - return "contained"; - if (code == ResourceAggregationMode.REFERENCED) - return "referenced"; - if (code == ResourceAggregationMode.BUNDLED) - return "bundled"; - return "?"; - } - } - - public enum ConstraintSeverity implements FhirEnum { - /** - * If the constraint is violated, the resource is not conformant. - */ - ERROR, - /** - * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. - */ - WARNING, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ERROR: return "error"; - case WARNING: return "warning"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ERROR: return ""; - case WARNING: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ERROR: return "If the constraint is violated, the resource is not conformant."; - case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ERROR: return "error"; - case WARNING: return "warning"; - default: return "?"; - } - } - } - - public static class ConstraintSeverityEnumFactory implements EnumFactory { - public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("error".equals(codeString)) - return ConstraintSeverity.ERROR; - if ("warning".equals(codeString)) - return ConstraintSeverity.WARNING; - throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); - } - public String toCode(ConstraintSeverity code) throws IllegalArgumentException { - if (code == ConstraintSeverity.ERROR) - return "error"; - if (code == ConstraintSeverity.WARNING) - return "warning"; - return "?"; - } - } - - 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. - */ - REQUIRED, - /** - * For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant. - */ - PREFERRED, - /** - * The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs. - */ - EXAMPLE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REQUIRED; - if ("preferred".equals(codeString)) - return PREFERRED; - if ("example".equals(codeString)) - return EXAMPLE; - throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case PREFERRED: return "preferred"; - case EXAMPLE: return "example"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return ""; - case PREFERRED: return ""; - case EXAMPLE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "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."; - case PREFERRED: return "For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant."; - case EXAMPLE: return "The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "required"; - case PREFERRED: return "preferred"; - case EXAMPLE: return "example"; - default: return "?"; - } - } - } - - public static class BindingConformanceEnumFactory implements EnumFactory { - public BindingConformance fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return BindingConformance.REQUIRED; - if ("preferred".equals(codeString)) - return BindingConformance.PREFERRED; - if ("example".equals(codeString)) - return BindingConformance.EXAMPLE; - throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); - } - public String toCode(BindingConformance code) throws IllegalArgumentException { - if (code == BindingConformance.REQUIRED) - return "required"; - if (code == BindingConformance.PREFERRED) - return "preferred"; - if (code == BindingConformance.EXAMPLE) - return "example"; - return "?"; - } - } - - public static class ElementDefinitionSlicingComponent extends Element { - /** - * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. - */ - @Child(name="discriminator", type={IdType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Element values that used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." ) - protected List discriminator; - - /** - * A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - @Child(name="description", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." ) - protected StringType description; - - /** - * If the matching elements have to occur in the same order as defined in the profile. - */ - @Child(name="ordered", type={BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." ) - protected BooleanType ordered; - - /** - * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - @Child(name="rules", type={CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." ) - protected Enumeration rules; - - private static final long serialVersionUID = 598129403L; - - public ElementDefinitionSlicingComponent() { - super(); - } - - public ElementDefinitionSlicingComponent(Enumeration rules) { - super(); - this.rules = rules; - } - - /** - * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public List getDiscriminator() { - if (this.discriminator == null) - this.discriminator = new ArrayList(); - return this.discriminator; - } - - public boolean hasDiscriminator() { - if (this.discriminator == null) - return false; - for (IdType item : this.discriminator) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - // syntactic sugar - public IdType addDiscriminatorElement() {//2 - IdType t = new IdType(); - if (this.discriminator == null) - this.discriminator = new ArrayList(); - this.discriminator.add(t); - return t; - } - - /** - * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public ElementDefinitionSlicingComponent addDiscriminator(String value) { //1 - IdType t = new IdType(); - t.setValue(value); - if (this.discriminator == null) - this.discriminator = new ArrayList(); - this.discriminator.add(t); - return this; - } - - /** - * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public boolean hasDiscriminator(String value) { - if (this.discriminator == null) - return false; - for (IdType v : this.discriminator) - if (v.equals(value)) // id - return true; - return false; - } - - /** - * @return {@link #description} (A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). 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 ElementDefinitionSlicingComponent.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} (A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - public ElementDefinitionSlicingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public BooleanType getOrderedElement() { - if (this.ordered == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered"); - else if (Configuration.doAutoCreate()) - this.ordered = new BooleanType(); - return this.ordered; - } - - public boolean hasOrderedElement() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - public boolean hasOrdered() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - /** - * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { - this.ordered = value; - return this; - } - - /** - * @return If the matching elements have to occur in the same order as defined in the profile. - */ - public boolean getOrdered() { - return this.ordered == null ? false : this.ordered.getValue(); - } - - /** - * @param value If the matching elements have to occur in the same order as defined in the profile. - */ - public ElementDefinitionSlicingComponent setOrdered(boolean value) { - if (value == false) - this.ordered = null; - else { - if (this.ordered == null) - this.ordered = new BooleanType(); - this.ordered.setValue(value); - } - return this; - } - - /** - * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value - */ - public Enumeration getRulesElement() { - if (this.rules == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules"); - else if (Configuration.doAutoCreate()) - this.rules = new Enumeration(); - return this.rules; - } - - public boolean hasRulesElement() { - return this.rules != null && !this.rules.isEmpty(); - } - - public boolean hasRules() { - return this.rules != null && !this.rules.isEmpty(); - } - - /** - * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setRulesElement(Enumeration value) { - this.rules = value; - return this; - } - - /** - * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - public ResourceSlicingRules getRules() { - return this.rules == null ? null : this.rules.getValue(); - } - - /** - * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - public ElementDefinitionSlicingComponent setRules(ResourceSlicingRules value) { - if (this.rules == null) - this.rules = new Enumeration(ResourceSlicingRules.ENUM_FACTORY); - this.rules.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("discriminator", "id", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator)); - childrenList.add(new Property("description", "string", "A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, java.lang.Integer.MAX_VALUE, ordered)); - childrenList.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, java.lang.Integer.MAX_VALUE, rules)); - } - - public ElementDefinitionSlicingComponent copy() { - ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent(); - copyValues(dst); - if (discriminator != null) { - dst.discriminator = new ArrayList(); - for (IdType i : discriminator) - dst.discriminator.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.ordered = ordered == null ? null : ordered.copy(); - dst.rules = rules == null ? null : rules.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (discriminator == null || discriminator.isEmpty()) && (description == null || description.isEmpty()) - && (ordered == null || ordered.isEmpty()) && (rules == null || rules.isEmpty()); - } - - } - - public static class TypeRefComponent extends Element { - /** - * Name of Data type or Resource that is a(or the) type used for this element. - */ - @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of Data type or Resource", formalDefinition="Name of Data type or Resource that is a(or the) type used for this element." ) - protected CodeType code; - - /** - * Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. - */ - @Child(name="profile", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Profile.structure to apply", formalDefinition="Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile." ) - protected UriType profile; - - /** - * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. - */ - @Child(name="aggregation", type={CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." ) - protected List> aggregation; - - private static final long serialVersionUID = -1527133887L; - - public TypeRefComponent() { - super(); - } - - public TypeRefComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TypeRefComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public TypeRefComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Name of Data type or Resource that is a(or the) type used for this element. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Name of Data type or Resource that is a(or the) type used for this element. - */ - public TypeRefComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value - */ - public UriType getProfileElement() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TypeRefComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new UriType(); - return this.profile; - } - - public boolean hasProfileElement() { - return this.profile != null && !this.profile.isEmpty(); - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value - */ - public TypeRefComponent setProfileElement(UriType value) { - this.profile = value; - return this; - } - - /** - * @return Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. - */ - public String getProfile() { - return this.profile == null ? null : this.profile.getValue(); - } - - /** - * @param value Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. - */ - public TypeRefComponent setProfile(String value) { - if (Utilities.noString(value)) - this.profile = null; - else { - if (this.profile == null) - this.profile = new UriType(); - this.profile.setValue(value); - } - return this; - } - - /** - * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public List> getAggregation() { - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - return this.aggregation; - } - - public boolean hasAggregation() { - if (this.aggregation == null) - return false; - for (Enumeration item : this.aggregation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - // syntactic sugar - public Enumeration addAggregationElement() {//2 - Enumeration t = new Enumeration(); - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - this.aggregation.add(t); - return t; - } - - /** - * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public TypeRefComponent addAggregation(ResourceAggregationMode value) { //1 - Enumeration t = new Enumeration(); - t.setValue(value); - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - this.aggregation.add(t); - return this; - } - - /** - * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public boolean hasAggregation(ResourceAggregationMode value) { - if (this.aggregation == null) - return false; - for (Enumeration v : this.aggregation) - if (v.equals(value)) // code - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Name of Data type or Resource that is a(or the) type used for this element.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("profile", "uri", "Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation)); - } - - public TypeRefComponent copy() { - TypeRefComponent dst = new TypeRefComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (aggregation != null) { - dst.aggregation = new ArrayList>(); - for (Enumeration i : aggregation) - dst.aggregation.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (profile == null || profile.isEmpty()) - && (aggregation == null || aggregation.isEmpty()); - } - - } - - public static class ElementDefinitionConstraintComponent extends Element { - /** - * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - @Child(name="key", type={IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality." ) - protected IdType key; - - /** - * Used to label the constraint in OCL or in short displays incapable of displaying the full human description. - */ - @Child(name="name", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Short human label", formalDefinition="Used to label the constraint in OCL or in short displays incapable of displaying the full human description." ) - protected StringType name; - - /** - * Identifies the impact constraint violation has on the conformance of the instance. - */ - @Child(name="severity", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." ) - protected Enumeration severity; - - /** - * Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - @Child(name="human", type={StringType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." ) - protected StringType human; - - /** - * An XPath expression of constraint that can be executed to see if this constraint is met. - */ - @Child(name="xpath", type={StringType.class}, order=5, min=1, max=1) - @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." ) - protected StringType xpath; - - private static final long serialVersionUID = -1195616532L; - - public ElementDefinitionConstraintComponent() { - super(); - } - - public ElementDefinitionConstraintComponent(IdType key, Enumeration severity, StringType human, StringType xpath) { - super(); - this.key = key; - this.severity = severity; - this.human = human; - this.xpath = xpath; - } - - /** - * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value - */ - public IdType getKeyElement() { - if (this.key == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key"); - else if (Configuration.doAutoCreate()) - this.key = new IdType(); - return this.key; - } - - public boolean hasKeyElement() { - return this.key != null && !this.key.isEmpty(); - } - - public boolean hasKey() { - return this.key != null && !this.key.isEmpty(); - } - - /** - * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setKeyElement(IdType value) { - this.key = value; - return this; - } - - /** - * @return Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - public String getKey() { - return this.key == null ? null : this.key.getValue(); - } - - /** - * @param value Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - public ElementDefinitionConstraintComponent setKey(String value) { - if (this.key == null) - this.key = new IdType(); - this.key.setValue(value); - return this; - } - - /** - * @return {@link #name} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Used to label the constraint in OCL or in short displays incapable of displaying the full human description. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Used to label the constraint in OCL or in short displays incapable of displaying the full human description. - */ - public ElementDefinitionConstraintComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(); - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Identifies the impact constraint violation has on the conformance of the instance. - */ - public ConstraintSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Identifies the impact constraint violation has on the conformance of the instance. - */ - public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { - if (this.severity == null) - this.severity = new Enumeration(ConstraintSeverity.ENUM_FACTORY); - this.severity.setValue(value); - return this; - } - - /** - * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value - */ - public StringType getHumanElement() { - if (this.human == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human"); - else if (Configuration.doAutoCreate()) - this.human = new StringType(); - return this.human; - } - - public boolean hasHumanElement() { - return this.human != null && !this.human.isEmpty(); - } - - public boolean hasHuman() { - return this.human != null && !this.human.isEmpty(); - } - - /** - * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setHumanElement(StringType value) { - this.human = value; - return this; - } - - /** - * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - public String getHuman() { - return this.human == null ? null : this.human.getValue(); - } - - /** - * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - public ElementDefinitionConstraintComponent setHuman(String value) { - if (this.human == null) - this.human = new StringType(); - this.human.setValue(value); - return this; - } - - /** - * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public StringType getXpathElement() { - if (this.xpath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath"); - else if (Configuration.doAutoCreate()) - this.xpath = new StringType(); - return this.xpath; - } - - public boolean hasXpathElement() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - public boolean hasXpath() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - /** - * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setXpathElement(StringType value) { - this.xpath = value; - return this; - } - - /** - * @return An XPath expression of constraint that can be executed to see if this constraint is met. - */ - public String getXpath() { - return this.xpath == null ? null : this.xpath.getValue(); - } - - /** - * @param value An XPath expression of constraint that can be executed to see if this constraint is met. - */ - public ElementDefinitionConstraintComponent setXpath(String value) { - if (this.xpath == null) - this.xpath = new StringType(); - this.xpath.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.", 0, java.lang.Integer.MAX_VALUE, key)); - childrenList.add(new Property("name", "string", "Used to label the constraint in OCL or in short displays incapable of displaying the full human description.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, java.lang.Integer.MAX_VALUE, human)); - childrenList.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, xpath)); - } - - public ElementDefinitionConstraintComponent copy() { - ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent(); - copyValues(dst); - dst.key = key == null ? null : key.copy(); - dst.name = name == null ? null : name.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.human = human == null ? null : human.copy(); - dst.xpath = xpath == null ? null : xpath.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (key == null || key.isEmpty()) && (name == null || name.isEmpty()) - && (severity == null || severity.isEmpty()) && (human == null || human.isEmpty()) && (xpath == null || xpath.isEmpty()) - ; - } - - } - - public static class ElementDefinitionBindingComponent extends Element { - /** - * A descriptive name for this - can be useful for generating implementation artifacts. - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Descriptive Name", formalDefinition="A descriptive name for this - can be useful for generating implementation artifacts." ) - protected StringType name; - - /** - * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. - */ - @Child(name="isExtensible", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Can additional codes be used?", formalDefinition="If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone." ) - protected BooleanType isExtensible; - - /** - * Indicates the degree of conformance expectations associated with this binding. - */ - @Child(name="conformance", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="required | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding." ) - protected Enumeration conformance; - - /** - * Describes the intended use of this particular set of codes. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) - protected StringType description; - - /** - * Points to the value set or external definition that identifies the set of codes to be used. - */ - @Child(name="reference", type={UriType.class, ValueSet.class}, order=5, min=0, max=1) - @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition that identifies the set of codes to be used." ) - protected Type reference; - - private static final long serialVersionUID = 1041151319L; - - public ElementDefinitionBindingComponent() { - super(); - } - - public ElementDefinitionBindingComponent(StringType name, BooleanType isExtensible) { - super(); - this.name = name; - this.isExtensible = isExtensible; - } - - /** - * @return {@link #name} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinitionBindingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A descriptive name for this - can be useful for generating implementation artifacts. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A descriptive name for this - can be useful for generating implementation artifacts. - */ - public ElementDefinitionBindingComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value - */ - public BooleanType getIsExtensibleElement() { - if (this.isExtensible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.isExtensible"); - else if (Configuration.doAutoCreate()) - this.isExtensible = new BooleanType(); - return this.isExtensible; - } - - public boolean hasIsExtensibleElement() { - return this.isExtensible != null && !this.isExtensible.isEmpty(); - } - - public boolean hasIsExtensible() { - return this.isExtensible != null && !this.isExtensible.isEmpty(); - } - - /** - * @param value {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value - */ - public ElementDefinitionBindingComponent setIsExtensibleElement(BooleanType value) { - this.isExtensible = value; - return this; - } - - /** - * @return If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. - */ - public boolean getIsExtensible() { - return this.isExtensible == null ? false : this.isExtensible.getValue(); - } - - /** - * @param value If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. - */ - public ElementDefinitionBindingComponent setIsExtensible(boolean value) { - if (this.isExtensible == null) - this.isExtensible = new BooleanType(); - this.isExtensible.setValue(value); - return this; - } - - /** - * @return {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value - */ - public Enumeration getConformanceElement() { - if (this.conformance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.conformance"); - else if (Configuration.doAutoCreate()) - this.conformance = new Enumeration(); - return this.conformance; - } - - public boolean hasConformanceElement() { - return this.conformance != null && !this.conformance.isEmpty(); - } - - public boolean hasConformance() { - return this.conformance != null && !this.conformance.isEmpty(); - } - - /** - * @param value {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value - */ - public ElementDefinitionBindingComponent setConformanceElement(Enumeration value) { - this.conformance = value; - return this; - } - - /** - * @return Indicates the degree of conformance expectations associated with this binding. - */ - public BindingConformance getConformance() { - return this.conformance == null ? null : this.conformance.getValue(); - } - - /** - * @param value Indicates the degree of conformance expectations associated with this binding. - */ - public ElementDefinitionBindingComponent setConformance(BindingConformance value) { - if (value == null) - this.conformance = null; - else { - if (this.conformance == null) - this.conformance = new Enumeration(BindingConformance.ENUM_FACTORY); - this.conformance.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Describes the intended use of this particular set of codes.). 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 ElementDefinitionBindingComponent.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} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Describes the intended use of this particular set of codes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Describes the intended use of this particular set of codes. - */ - public ElementDefinitionBindingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) - */ - public Type getReference() { - return this.reference; - } - - /** - * @return {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) - */ - public UriType getReferenceUriType() throws Exception { - if (!(this.reference instanceof UriType)) - throw new Exception("Type mismatch: the type UriType was expected, but "+this.reference.getClass().getName()+" was encountered"); - return (UriType) this.reference; - } - - /** - * @return {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) - */ - public Reference getReferenceReference() throws Exception { - if (!(this.reference instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reference.getClass().getName()+" was encountered"); - return (Reference) this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) - */ - public ElementDefinitionBindingComponent setReference(Type value) { - this.reference = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "A descriptive name for this - can be useful for generating implementation artifacts.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("isExtensible", "boolean", "If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.", 0, java.lang.Integer.MAX_VALUE, isExtensible)); - childrenList.add(new Property("conformance", "code", "Indicates the degree of conformance expectations associated with this binding.", 0, java.lang.Integer.MAX_VALUE, conformance)); - childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("reference[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, reference)); - } - - public ElementDefinitionBindingComponent copy() { - ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.isExtensible = isExtensible == null ? null : isExtensible.copy(); - dst.conformance = conformance == null ? null : conformance.copy(); - dst.description = description == null ? null : description.copy(); - dst.reference = reference == null ? null : reference.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (isExtensible == null || isExtensible.isEmpty()) - && (conformance == null || conformance.isEmpty()) && (description == null || description.isEmpty()) - && (reference == null || reference.isEmpty()); - } - - } - - public static class ElementDefinitionMappingComponent extends Element { - /** - * An internal reference to the definition of a mapping. - */ - @Child(name="identity", type={IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." ) - protected IdType identity; - - /** - * Expresses what part of the target specification corresponds to this element. - */ - @Child(name="map", type={StringType.class}, order=2, 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 = -450627426L; - - public ElementDefinitionMappingComponent() { - super(); - } - - public ElementDefinitionMappingComponent(IdType identity, StringType map) { - super(); - this.identity = identity; - this.map = map; - } - - /** - * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public ElementDefinitionMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An internal reference to the definition of a mapping. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An internal reference to the definition of a mapping. - */ - public ElementDefinitionMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public StringType getMapElement() { - if (this.map == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map"); - else if (Configuration.doAutoCreate()) - this.map = new StringType(); - return this.map; - } - - public boolean hasMapElement() { - return this.map != null && !this.map.isEmpty(); - } - - public boolean hasMap() { - return this.map != null && !this.map.isEmpty(); - } - - /** - * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public ElementDefinitionMappingComponent setMapElement(StringType value) { - this.map = value; - return this; - } - - /** - * @return Expresses what part of the target specification corresponds to this element. - */ - public String getMap() { - return this.map == null ? null : this.map.getValue(); - } - - /** - * @param value Expresses what part of the target specification corresponds to this element. - */ - public ElementDefinitionMappingComponent setMap(String value) { - if (this.map == null) - this.map = new StringType(); - this.map.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); - } - - public ElementDefinitionMappingComponent copy() { - ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.map = map == null ? null : map.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (map == null || map.isEmpty()) - ; - } - - } - - /** - * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - @Child(name="path", type={StringType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="The path of the element (see the Detailed Descriptions)", formalDefinition="The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension." ) - protected StringType path; - - /** - * Codes that define how this element is represented in instances, when the deviation varies from the normal case. - */ - @Child(name="representation", type={CodeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="How this element is represented in instances", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." ) - protected List> representation; - - /** - * The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name for this particular element definition (reference target)", formalDefinition="The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element." ) - protected StringType name; - - /** - * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). - */ - @Child(name="slicing", type={}, order=2, min=0, max=1) - @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." ) - protected ElementDefinitionSlicingComponent slicing; - - /** - * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). - */ - @Child(name="short_", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Concise definition for xml presentation", formalDefinition="A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)." ) - protected StringType short_; - - /** - * The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - @Child(name="formal", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Full formal definition in human language", formalDefinition="The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." ) - protected StringType formal; - - /** - * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - @Child(name="comments", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Comments about the use of this element", formalDefinition="Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc." ) - protected StringType comments; - - /** - * Explains why this element is needed and why it's been constrained as it has. - */ - @Child(name="requirements", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this element is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * Identifies additional names by which this element might also be known. - */ - @Child(name="synonym", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) - protected List synonym; - - /** - * The minimum number of times this element SHALL appear in the instance. - */ - @Child(name="min", type={IntegerType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." ) - protected IntegerType min; - - /** - * The maximum number of times this element is permitted to appear in the instance. - */ - @Child(name="max", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." ) - protected StringType max; - - /** - * The data type or resource that the value of this element is permitted to be. - */ - @Child(name="type", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." ) - protected List type; - - /** - * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. - */ - @Child(name="nameReference", type={StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="To another element constraint (by element.name)", formalDefinition="Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element." ) - protected StringType nameReference; - - /** - * The value that should be used if there is no value stated in the instance. - */ - @Child(name="defaultValue", type={}, order=12, min=0, max=1) - @Description(shortDefinition="Specified value it missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance." ) - protected org.hl7.fhir.instance.model.Type defaultValue; - - /** - * The Implicit meaning that is to be understood when this element is missing. - */ - @Child(name="meaningWhenMissing", type={StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing." ) - protected StringType meaningWhenMissing; - - /** - * Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. - */ - @Child(name="fixed", type={}, order=14, min=0, max=1) - @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." ) - protected org.hl7.fhir.instance.model.Type fixed; - - /** - * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.). - */ - @Child(name="pattern", type={}, order=15, min=0, max=1) - @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.)." ) - protected org.hl7.fhir.instance.model.Type pattern; - - /** - * An example value for this element. - */ - @Child(name="example", type={}, order=16, min=0, max=1) - @Description(shortDefinition="Example value: [as defined for type]", formalDefinition="An example value for this element." ) - protected org.hl7.fhir.instance.model.Type example; - - /** - * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - @Child(name="maxLength", type={IntegerType.class}, order=17, min=0, max=1) - @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." ) - protected IntegerType maxLength; - - /** - * A reference to an invariant that may make additional statements about the cardinality or value in the instance. - */ - @Child(name="condition", type={IdType.class}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." ) - protected List condition; - - /** - * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. - */ - @Child(name="constraint", type={}, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." ) - protected List constraint; - - /** - * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. - */ - @Child(name="mustSupport", type={BooleanType.class}, order=20, min=0, max=1) - @Description(shortDefinition="If the element must supported", formalDefinition="If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported." ) - protected BooleanType mustSupport; - - /** - * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - @Child(name="isModifier", type={BooleanType.class}, order=21, min=0, max=1) - @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." ) - protected BooleanType isModifier; - - /** - * Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - @Child(name="isSummary", type={BooleanType.class}, order=22, min=0, max=1) - @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." ) - protected BooleanType isSummary; - - /** - * Binds to a value set if this element is coded (code, Coding, CodeableConcept). - */ - @Child(name="binding", type={}, order=23, min=0, max=1) - @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) - protected ElementDefinitionBindingComponent binding; - - /** - * Identifies a concept from an external specification that roughly corresponds to this element. - */ - @Child(name="mapping", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) - protected List mapping; - - private static final long serialVersionUID = 2094512467L; - - public ElementDefinition() { - super(); - } - - public ElementDefinition(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ElementDefinition setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - public ElementDefinition setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public List> getRepresentation() { - if (this.representation == null) - this.representation = new ArrayList>(); - return this.representation; - } - - public boolean hasRepresentation() { - if (this.representation == null) - return false; - for (Enumeration item : this.representation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - // syntactic sugar - public Enumeration addRepresentationElement() {//2 - Enumeration t = new Enumeration(); - if (this.representation == null) - this.representation = new ArrayList>(); - this.representation.add(t); - return t; - } - - /** - * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public ElementDefinition addRepresentation(PropertyRepresentation value) { //1 - Enumeration t = new Enumeration(); - t.setValue(value); - if (this.representation == null) - this.representation = new ArrayList>(); - this.representation.add(t); - return this; - } - - /** - * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public boolean hasRepresentation(PropertyRepresentation value) { - if (this.representation == null) - return false; - for (Enumeration v : this.representation) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #name} (The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. - */ - public ElementDefinition setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) - */ - public ElementDefinitionSlicingComponent getSlicing() { - if (this.slicing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.slicing"); - else if (Configuration.doAutoCreate()) - this.slicing = new ElementDefinitionSlicingComponent(); - return this.slicing; - } - - public boolean hasSlicing() { - return this.slicing != null && !this.slicing.isEmpty(); - } - - /** - * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) - */ - public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { - this.slicing = value; - return this; - } - - /** - * @return {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value - */ - public StringType getShortElement() { - if (this.short_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.short_"); - else if (Configuration.doAutoCreate()) - this.short_ = new StringType(); - return this.short_; - } - - public boolean hasShortElement() { - return this.short_ != null && !this.short_.isEmpty(); - } - - public boolean hasShort() { - return this.short_ != null && !this.short_.isEmpty(); - } - - /** - * @param value {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value - */ - public ElementDefinition setShortElement(StringType value) { - this.short_ = value; - return this; - } - - /** - * @return A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). - */ - public String getShort() { - return this.short_ == null ? null : this.short_.getValue(); - } - - /** - * @param value A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). - */ - public ElementDefinition setShort(String value) { - if (Utilities.noString(value)) - this.short_ = null; - else { - if (this.short_ == null) - this.short_ = new StringType(); - this.short_.setValue(value); - } - return this; - } - - /** - * @return {@link #formal} (The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getFormal" gives direct access to the value - */ - public StringType getFormalElement() { - if (this.formal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.formal"); - else if (Configuration.doAutoCreate()) - this.formal = new StringType(); - return this.formal; - } - - public boolean hasFormalElement() { - return this.formal != null && !this.formal.isEmpty(); - } - - public boolean hasFormal() { - return this.formal != null && !this.formal.isEmpty(); - } - - /** - * @param value {@link #formal} (The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getFormal" gives direct access to the value - */ - public ElementDefinition setFormalElement(StringType value) { - this.formal = value; - return this; - } - - /** - * @return The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - public String getFormal() { - return this.formal == null ? null : this.formal.getValue(); - } - - /** - * @param value The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - public ElementDefinition setFormal(String value) { - if (Utilities.noString(value)) - this.formal = null; - else { - if (this.formal == null) - this.formal = new StringType(); - this.formal.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ElementDefinition setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public ElementDefinition setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ElementDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this element is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this element is needed and why it's been constrained as it has. - */ - public ElementDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - public List getSynonym() { - if (this.synonym == null) - this.synonym = new ArrayList(); - return this.synonym; - } - - public boolean hasSynonym() { - if (this.synonym == null) - return false; - for (StringType item : this.synonym) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - // syntactic sugar - public StringType addSynonymElement() {//2 - StringType t = new StringType(); - if (this.synonym == null) - this.synonym = new ArrayList(); - this.synonym.add(t); - return t; - } - - /** - * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - public ElementDefinition addSynonym(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.synonym == null) - this.synonym = new ArrayList(); - this.synonym.add(t); - return this; - } - - /** - * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) - */ - public boolean hasSynonym(String value) { - if (this.synonym == null) - return false; - for (StringType v : this.synonym) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). 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 ElementDefinition.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 element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public ElementDefinition setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this element SHALL appear in the instance. - */ - public int getMin() { - return this.min == null ? null : this.min.getValue(); - } - - /** - * @param value The minimum number of times this element SHALL appear in the instance. - */ - public ElementDefinition setMin(int value) { - if (value == -1) - this.min = null; - else { - 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 instance.). 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 ElementDefinition.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 instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public ElementDefinition setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the instance. - */ - 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 instance. - */ - public ElementDefinition setMax(String value) { - if (Utilities.noString(value)) - this.max = null; - else { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (TypeRefComponent item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) - */ - // syntactic sugar - public TypeRefComponent addType() { //3 - TypeRefComponent t = new TypeRefComponent(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value - */ - public StringType getNameReferenceElement() { - if (this.nameReference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.nameReference"); - else if (Configuration.doAutoCreate()) - this.nameReference = new StringType(); - return this.nameReference; - } - - public boolean hasNameReferenceElement() { - return this.nameReference != null && !this.nameReference.isEmpty(); - } - - public boolean hasNameReference() { - return this.nameReference != null && !this.nameReference.isEmpty(); - } - - /** - * @param value {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value - */ - public ElementDefinition setNameReferenceElement(StringType value) { - this.nameReference = value; - return this; - } - - /** - * @return Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. - */ - public String getNameReference() { - return this.nameReference == null ? null : this.nameReference.getValue(); - } - - /** - * @param value Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. - */ - public ElementDefinition setNameReference(String value) { - if (Utilities.noString(value)) - this.nameReference = null; - else { - if (this.nameReference == null) - this.nameReference = new StringType(); - this.nameReference.setValue(value); - } - return this; - } - - /** - * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) - */ - public org.hl7.fhir.instance.model.Type getDefaultValue() { - return this.defaultValue; - } - - public boolean hasDefaultValue() { - return this.defaultValue != null && !this.defaultValue.isEmpty(); - } - - /** - * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) - */ - public ElementDefinition setDefaultValue(org.hl7.fhir.instance.model.Type value) { - this.defaultValue = value; - return this; - } - - /** - * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value - */ - public StringType getMeaningWhenMissingElement() { - if (this.meaningWhenMissing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing"); - else if (Configuration.doAutoCreate()) - this.meaningWhenMissing = new StringType(); - return this.meaningWhenMissing; - } - - public boolean hasMeaningWhenMissingElement() { - return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); - } - - public boolean hasMeaningWhenMissing() { - return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); - } - - /** - * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value - */ - public ElementDefinition setMeaningWhenMissingElement(StringType value) { - this.meaningWhenMissing = value; - return this; - } - - /** - * @return The Implicit meaning that is to be understood when this element is missing. - */ - public String getMeaningWhenMissing() { - return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue(); - } - - /** - * @param value The Implicit meaning that is to be understood when this element is missing. - */ - public ElementDefinition setMeaningWhenMissing(String value) { - if (Utilities.noString(value)) - this.meaningWhenMissing = null; - else { - if (this.meaningWhenMissing == null) - this.meaningWhenMissing = new StringType(); - this.meaningWhenMissing.setValue(value); - } - return this; - } - - /** - * @return {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) - */ - public org.hl7.fhir.instance.model.Type getFixed() { - return this.fixed; - } - - public boolean hasFixed() { - return this.fixed != null && !this.fixed.isEmpty(); - } - - /** - * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) - */ - public ElementDefinition setFixed(org.hl7.fhir.instance.model.Type value) { - this.fixed = value; - return this; - } - - /** - * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) - */ - public org.hl7.fhir.instance.model.Type getPattern() { - return this.pattern; - } - - public boolean hasPattern() { - return this.pattern != null && !this.pattern.isEmpty(); - } - - /** - * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) - */ - public ElementDefinition setPattern(org.hl7.fhir.instance.model.Type value) { - this.pattern = value; - return this; - } - - /** - * @return {@link #example} (An example value for this element.) - */ - public org.hl7.fhir.instance.model.Type getExample() { - return this.example; - } - - public boolean hasExample() { - return this.example != null && !this.example.isEmpty(); - } - - /** - * @param value {@link #example} (An example value for this element.) - */ - public ElementDefinition setExample(org.hl7.fhir.instance.model.Type value) { - this.example = value; - return this; - } - - /** - * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public IntegerType getMaxLengthElement() { - if (this.maxLength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.maxLength"); - else if (Configuration.doAutoCreate()) - this.maxLength = new IntegerType(); - return this.maxLength; - } - - public boolean hasMaxLengthElement() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - public boolean hasMaxLength() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - /** - * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public ElementDefinition setMaxLengthElement(IntegerType value) { - this.maxLength = value; - return this; - } - - /** - * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - public int getMaxLength() { - return this.maxLength == null ? null : this.maxLength.getValue(); - } - - /** - * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - public ElementDefinition setMaxLength(int value) { - if (value == -1) - this.maxLength = null; - else { - if (this.maxLength == null) - this.maxLength = new IntegerType(); - this.maxLength.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (IdType item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - // syntactic sugar - public IdType addConditionElement() {//2 - IdType t = new IdType(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public ElementDefinition addCondition(String value) { //1 - IdType t = new IdType(); - t.setValue(value); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - /** - * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public boolean hasCondition(String value) { - if (this.condition == null) - return false; - for (IdType v : this.condition) - if (v.equals(value)) // id - return true; - return false; - } - - /** - * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) - */ - public List getConstraint() { - if (this.constraint == null) - this.constraint = new ArrayList(); - return this.constraint; - } - - public boolean hasConstraint() { - if (this.constraint == null) - return false; - for (ElementDefinitionConstraintComponent item : this.constraint) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) - */ - // syntactic sugar - public ElementDefinitionConstraintComponent addConstraint() { //3 - ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent(); - if (this.constraint == null) - this.constraint = new ArrayList(); - this.constraint.add(t); - return t; - } - - /** - * @return {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value - */ - public BooleanType getMustSupportElement() { - if (this.mustSupport == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.mustSupport"); - else if (Configuration.doAutoCreate()) - this.mustSupport = new BooleanType(); - return this.mustSupport; - } - - public boolean hasMustSupportElement() { - return this.mustSupport != null && !this.mustSupport.isEmpty(); - } - - public boolean hasMustSupport() { - return this.mustSupport != null && !this.mustSupport.isEmpty(); - } - - /** - * @param value {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value - */ - public ElementDefinition setMustSupportElement(BooleanType value) { - this.mustSupport = value; - return this; - } - - /** - * @return If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. - */ - public boolean getMustSupport() { - return this.mustSupport == null ? false : this.mustSupport.getValue(); - } - - /** - * @param value If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. - */ - public ElementDefinition setMustSupport(boolean value) { - if (value == false) - this.mustSupport = null; - else { - if (this.mustSupport == null) - this.mustSupport = new BooleanType(); - this.mustSupport.setValue(value); - } - return this; - } - - /** - * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value - */ - public BooleanType getIsModifierElement() { - if (this.isModifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.isModifier"); - else if (Configuration.doAutoCreate()) - this.isModifier = new BooleanType(); - return this.isModifier; - } - - public boolean hasIsModifierElement() { - return this.isModifier != null && !this.isModifier.isEmpty(); - } - - public boolean hasIsModifier() { - return this.isModifier != null && !this.isModifier.isEmpty(); - } - - /** - * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value - */ - public ElementDefinition setIsModifierElement(BooleanType value) { - this.isModifier = value; - return this; - } - - /** - * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - public boolean getIsModifier() { - return this.isModifier == null ? false : this.isModifier.getValue(); - } - - /** - * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - public ElementDefinition setIsModifier(boolean value) { - if (value == false) - this.isModifier = null; - else { - if (this.isModifier == null) - this.isModifier = new BooleanType(); - this.isModifier.setValue(value); - } - return this; - } - - /** - * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value - */ - public BooleanType getIsSummaryElement() { - if (this.isSummary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.isSummary"); - else if (Configuration.doAutoCreate()) - this.isSummary = new BooleanType(); - return this.isSummary; - } - - public boolean hasIsSummaryElement() { - return this.isSummary != null && !this.isSummary.isEmpty(); - } - - public boolean hasIsSummary() { - return this.isSummary != null && !this.isSummary.isEmpty(); - } - - /** - * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value - */ - public ElementDefinition setIsSummaryElement(BooleanType value) { - this.isSummary = value; - return this; - } - - /** - * @return Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - public boolean getIsSummary() { - return this.isSummary == null ? false : this.isSummary.getValue(); - } - - /** - * @param value Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - public ElementDefinition setIsSummary(boolean value) { - if (value == false) - this.isSummary = null; - else { - if (this.isSummary == null) - this.isSummary = new BooleanType(); - this.isSummary.setValue(value); - } - return this; - } - - /** - * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public ElementDefinitionBindingComponent getBinding() { - if (this.binding == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.binding"); - else if (Configuration.doAutoCreate()) - this.binding = new ElementDefinitionBindingComponent(); - return this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { - this.binding = value; - return this; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (ElementDefinitionMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - // syntactic sugar - public ElementDefinitionMappingComponent addMapping() { //3 - ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation)); - childrenList.add(new Property("name", "string", "The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, java.lang.Integer.MAX_VALUE, slicing)); - childrenList.add(new Property("short", "string", "A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).", 0, java.lang.Integer.MAX_VALUE, short_)); - childrenList.add(new Property("formal", "string", "The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, java.lang.Integer.MAX_VALUE, formal)); - childrenList.add(new Property("comments", "string", "Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); - 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("min", "integer", "The minimum number of times this element SHALL appear in the instance.", 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 instance.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("nameReference", "string", "Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.", 0, java.lang.Integer.MAX_VALUE, nameReference)); - childrenList.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance.", 0, java.lang.Integer.MAX_VALUE, defaultValue)); - childrenList.add(new Property("meaningWhenMissing", "string", "The Implicit meaning that is to be understood when this element is missing.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); - childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); - childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); - childrenList.add(new Property("example[x]", "*", "An example value for this element.", 0, java.lang.Integer.MAX_VALUE, example)); - childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); - childrenList.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint)); - childrenList.add(new Property("mustSupport", "boolean", "If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); - childrenList.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, java.lang.Integer.MAX_VALUE, isModifier)); - childrenList.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, java.lang.Integer.MAX_VALUE, isSummary)); - 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)); - childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); - } - - public ElementDefinition copy() { - ElementDefinition dst = new ElementDefinition(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - if (representation != null) { - dst.representation = new ArrayList>(); - for (Enumeration i : representation) - dst.representation.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.slicing = slicing == null ? null : slicing.copy(); - dst.short_ = short_ == null ? null : short_.copy(); - dst.formal = formal == null ? null : formal.copy(); - dst.comments = comments == null ? null : comments.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - if (synonym != null) { - dst.synonym = new ArrayList(); - for (StringType i : synonym) - dst.synonym.add(i.copy()); - }; - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (TypeRefComponent i : type) - dst.type.add(i.copy()); - }; - dst.nameReference = nameReference == null ? null : nameReference.copy(); - dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); - dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); - dst.fixed = fixed == null ? null : fixed.copy(); - dst.pattern = pattern == null ? null : pattern.copy(); - dst.example = example == null ? null : example.copy(); - dst.maxLength = maxLength == null ? null : maxLength.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (IdType i : condition) - dst.condition.add(i.copy()); - }; - if (constraint != null) { - dst.constraint = new ArrayList(); - for (ElementDefinitionConstraintComponent i : constraint) - dst.constraint.add(i.copy()); - }; - dst.mustSupport = mustSupport == null ? null : mustSupport.copy(); - dst.isModifier = isModifier == null ? null : isModifier.copy(); - dst.isSummary = isSummary == null ? null : isSummary.copy(); - dst.binding = binding == null ? null : binding.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (ElementDefinitionMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - return dst; - } - - protected ElementDefinition typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (representation == null || representation.isEmpty()) - && (name == null || name.isEmpty()) && (slicing == null || slicing.isEmpty()) && (short_ == null || short_.isEmpty()) - && (formal == null || formal.isEmpty()) && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (synonym == null || synonym.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) - && (type == null || type.isEmpty()) && (nameReference == null || nameReference.isEmpty()) - && (defaultValue == null || defaultValue.isEmpty()) && (meaningWhenMissing == null || meaningWhenMissing.isEmpty()) - && (fixed == null || fixed.isEmpty()) && (pattern == null || pattern.isEmpty()) && (example == null || example.isEmpty()) - && (maxLength == null || maxLength.isEmpty()) && (condition == null || condition.isEmpty()) - && (constraint == null || constraint.isEmpty()) && (mustSupport == null || mustSupport.isEmpty()) - && (isModifier == null || isModifier.isEmpty()) && (isSummary == null || isSummary.isEmpty()) - && (binding == null || binding.isEmpty()) && (mapping == null || mapping.isEmpty()); - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * Captures constraints on each element within the resource, profile, or extension. + */ +@DatatypeDef(name="ElementDefinition") +public class ElementDefinition extends Type implements ICompositeType{ + + public enum PropertyRepresentation implements FhirEnum { + /** + * In XML, this property is represented as an attribute not an element. + */ + XMLATTR, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case XMLATTR: return "xmlAttr"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case XMLATTR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case XMLATTR: return "In XML, this property is represented as an attribute not an element."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case XMLATTR: return "xmlAttr"; + default: return "?"; + } + } + } + + public static class PropertyRepresentationEnumFactory implements EnumFactory { + 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 IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); + } + public String toCode(PropertyRepresentation code) throws IllegalArgumentException { + if (code == PropertyRepresentation.XMLATTR) + return "xmlAttr"; + return "?"; + } + } + + public enum ResourceSlicingRules implements FhirEnum { + /** + * No additional content is allowed other than that described by the slices in this profile. + */ + CLOSED, + /** + * Additional content is allowed anywhere in the list. + */ + OPEN, + /** + * Additional content is allowed, but only at the end of the list. + */ + OPENATEND, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CLOSED; + if ("open".equals(codeString)) + return OPEN; + if ("openAtEnd".equals(codeString)) + return OPENATEND; + throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CLOSED: return "closed"; + case OPEN: return "open"; + case OPENATEND: return "openAtEnd"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CLOSED: return ""; + case OPEN: return ""; + case OPENATEND: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CLOSED: return "No additional content is allowed other than that described by the slices in this profile."; + case OPEN: return "Additional content is allowed anywhere in the list."; + case OPENATEND: return "Additional content is allowed, but only at the end of the list."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CLOSED: return "closed"; + case OPEN: return "open"; + case OPENATEND: return "openAtEnd"; + default: return "?"; + } + } + } + + public static class ResourceSlicingRulesEnumFactory implements EnumFactory { + public ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("closed".equals(codeString)) + return ResourceSlicingRules.CLOSED; + if ("open".equals(codeString)) + return ResourceSlicingRules.OPEN; + if ("openAtEnd".equals(codeString)) + return ResourceSlicingRules.OPENATEND; + throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); + } + public String toCode(ResourceSlicingRules code) throws IllegalArgumentException { + if (code == ResourceSlicingRules.CLOSED) + return "closed"; + if (code == ResourceSlicingRules.OPEN) + return "open"; + if (code == ResourceSlicingRules.OPENATEND) + return "openAtEnd"; + return "?"; + } + } + + public enum ResourceAggregationMode implements FhirEnum { + /** + * The reference is a local reference to a contained resource. + */ + CONTAINED, + /** + * The reference to a resource that has to be resolved externally to the resource that includes the reference. + */ + REFERENCED, + /** + * The resource the reference points to will be found in the same bundle as the resource that includes the reference. + */ + BUNDLED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CONTAINED; + if ("referenced".equals(codeString)) + return REFERENCED; + if ("bundled".equals(codeString)) + return BUNDLED; + throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CONTAINED: return "contained"; + case REFERENCED: return "referenced"; + case BUNDLED: return "bundled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CONTAINED: return ""; + case REFERENCED: return ""; + case BUNDLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CONTAINED: return "The reference is a local reference to a contained resource."; + case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference."; + case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CONTAINED: return "contained"; + case REFERENCED: return "referenced"; + case BUNDLED: return "bundled"; + default: return "?"; + } + } + } + + public static class ResourceAggregationModeEnumFactory implements EnumFactory { + public ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("contained".equals(codeString)) + return ResourceAggregationMode.CONTAINED; + if ("referenced".equals(codeString)) + return ResourceAggregationMode.REFERENCED; + if ("bundled".equals(codeString)) + return ResourceAggregationMode.BUNDLED; + throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); + } + public String toCode(ResourceAggregationMode code) throws IllegalArgumentException { + if (code == ResourceAggregationMode.CONTAINED) + return "contained"; + if (code == ResourceAggregationMode.REFERENCED) + return "referenced"; + if (code == ResourceAggregationMode.BUNDLED) + return "bundled"; + return "?"; + } + } + + public enum ConstraintSeverity implements FhirEnum { + /** + * If the constraint is violated, the resource is not conformant. + */ + ERROR, + /** + * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. + */ + WARNING, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ERROR: return "error"; + case WARNING: return "warning"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ERROR: return ""; + case WARNING: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ERROR: return "If the constraint is violated, the resource is not conformant."; + case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ERROR: return "error"; + case WARNING: return "warning"; + default: return "?"; + } + } + } + + public static class ConstraintSeverityEnumFactory implements EnumFactory { + public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("error".equals(codeString)) + return ConstraintSeverity.ERROR; + if ("warning".equals(codeString)) + return ConstraintSeverity.WARNING; + throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); + } + public String toCode(ConstraintSeverity code) throws IllegalArgumentException { + if (code == ConstraintSeverity.ERROR) + return "error"; + if (code == ConstraintSeverity.WARNING) + return "warning"; + return "?"; + } + } + + 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. + */ + REQUIRED, + /** + * For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant. + */ + PREFERRED, + /** + * The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs. + */ + EXAMPLE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REQUIRED; + if ("preferred".equals(codeString)) + return PREFERRED; + if ("example".equals(codeString)) + return EXAMPLE; + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUIRED: return "required"; + case PREFERRED: return "preferred"; + case EXAMPLE: return "example"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUIRED: return ""; + case PREFERRED: return ""; + case EXAMPLE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUIRED: return "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."; + case PREFERRED: return "For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant."; + case EXAMPLE: return "The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUIRED: return "required"; + case PREFERRED: return "preferred"; + case EXAMPLE: return "example"; + default: return "?"; + } + } + } + + public static class BindingConformanceEnumFactory implements EnumFactory { + public BindingConformance fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("required".equals(codeString)) + return BindingConformance.REQUIRED; + if ("preferred".equals(codeString)) + return BindingConformance.PREFERRED; + if ("example".equals(codeString)) + return BindingConformance.EXAMPLE; + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); + } + public String toCode(BindingConformance code) throws IllegalArgumentException { + if (code == BindingConformance.REQUIRED) + return "required"; + if (code == BindingConformance.PREFERRED) + return "preferred"; + if (code == BindingConformance.EXAMPLE) + return "example"; + return "?"; + } + } + + public static class ElementDefinitionSlicingComponent extends Element { + /** + * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. + */ + @Child(name="discriminator", type={IdType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Element values that used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." ) + protected List discriminator; + + /** + * A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." ) + protected StringType description; + + /** + * If the matching elements have to occur in the same order as defined in the profile. + */ + @Child(name="ordered", type={BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." ) + protected BooleanType ordered; + + /** + * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + @Child(name="rules", type={CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." ) + protected Enumeration rules; + + private static final long serialVersionUID = 598129403L; + + public ElementDefinitionSlicingComponent() { + super(); + } + + public ElementDefinitionSlicingComponent(Enumeration rules) { + super(); + this.rules = rules; + } + + /** + * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public List getDiscriminator() { + if (this.discriminator == null) + this.discriminator = new ArrayList(); + return this.discriminator; + } + + public boolean hasDiscriminator() { + if (this.discriminator == null) + return false; + for (IdType item : this.discriminator) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + // syntactic sugar + public IdType addDiscriminatorElement() {//2 + IdType t = new IdType(); + if (this.discriminator == null) + this.discriminator = new ArrayList(); + this.discriminator.add(t); + return t; + } + + /** + * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public ElementDefinitionSlicingComponent addDiscriminator(String value) { //1 + IdType t = new IdType(); + t.setValue(value); + if (this.discriminator == null) + this.discriminator = new ArrayList(); + this.discriminator.add(t); + return this; + } + + /** + * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) + */ + public boolean hasDiscriminator(String value) { + if (this.discriminator == null) + return false; + for (IdType v : this.discriminator) + if (v.equals(value)) // id + return true; + return false; + } + + /** + * @return {@link #description} (A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). 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 ElementDefinitionSlicingComponent.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} (A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + */ + public ElementDefinitionSlicingComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public BooleanType getOrderedElement() { + if (this.ordered == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered"); + else if (Configuration.doAutoCreate()) + this.ordered = new BooleanType(); + return this.ordered; + } + + public boolean hasOrderedElement() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + public boolean hasOrdered() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + /** + * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { + this.ordered = value; + return this; + } + + /** + * @return If the matching elements have to occur in the same order as defined in the profile. + */ + public boolean getOrdered() { + return this.ordered == null ? false : this.ordered.getValue(); + } + + /** + * @param value If the matching elements have to occur in the same order as defined in the profile. + */ + public ElementDefinitionSlicingComponent setOrdered(boolean value) { + if (value == false) + this.ordered = null; + else { + if (this.ordered == null) + this.ordered = new BooleanType(); + this.ordered.setValue(value); + } + return this; + } + + /** + * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value + */ + public Enumeration getRulesElement() { + if (this.rules == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules"); + else if (Configuration.doAutoCreate()) + this.rules = new Enumeration(); + return this.rules; + } + + public boolean hasRulesElement() { + return this.rules != null && !this.rules.isEmpty(); + } + + public boolean hasRules() { + return this.rules != null && !this.rules.isEmpty(); + } + + /** + * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value + */ + public ElementDefinitionSlicingComponent setRulesElement(Enumeration value) { + this.rules = value; + return this; + } + + /** + * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + public ResourceSlicingRules getRules() { + return this.rules == null ? null : this.rules.getValue(); + } + + /** + * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + */ + public ElementDefinitionSlicingComponent setRules(ResourceSlicingRules value) { + if (this.rules == null) + this.rules = new Enumeration(ResourceSlicingRules.ENUM_FACTORY); + this.rules.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("discriminator", "id", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator)); + childrenList.add(new Property("description", "string", "A humane readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, java.lang.Integer.MAX_VALUE, ordered)); + childrenList.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, java.lang.Integer.MAX_VALUE, rules)); + } + + public ElementDefinitionSlicingComponent copy() { + ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent(); + copyValues(dst); + if (discriminator != null) { + dst.discriminator = new ArrayList(); + for (IdType i : discriminator) + dst.discriminator.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.ordered = ordered == null ? null : ordered.copy(); + dst.rules = rules == null ? null : rules.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (discriminator == null || discriminator.isEmpty()) && (description == null || description.isEmpty()) + && (ordered == null || ordered.isEmpty()) && (rules == null || rules.isEmpty()); + } + + } + + public static class TypeRefComponent extends Element { + /** + * Name of Data type or Resource that is a(or the) type used for this element. + */ + @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of Data type or Resource", formalDefinition="Name of Data type or Resource that is a(or the) type used for this element." ) + protected CodeType code; + + /** + * Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + */ + @Child(name="profile", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Profile.structure to apply", formalDefinition="Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile." ) + protected UriType profile; + + /** + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. + */ + @Child(name="aggregation", type={CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." ) + protected List> aggregation; + + private static final long serialVersionUID = -1527133887L; + + public TypeRefComponent() { + super(); + } + + public TypeRefComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TypeRefComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public TypeRefComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Name of Data type or Resource that is a(or the) type used for this element. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Name of Data type or Resource that is a(or the) type used for this element. + */ + public TypeRefComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value + */ + public UriType getProfileElement() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TypeRefComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new UriType(); + return this.profile; + } + + public boolean hasProfileElement() { + return this.profile != null && !this.profile.isEmpty(); + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value + */ + public TypeRefComponent setProfileElement(UriType value) { + this.profile = value; + return this; + } + + /** + * @return Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + */ + public String getProfile() { + return this.profile == null ? null : this.profile.getValue(); + } + + /** + * @param value Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + */ + public TypeRefComponent setProfile(String value) { + if (Utilities.noString(value)) + this.profile = null; + else { + if (this.profile == null) + this.profile = new UriType(); + this.profile.setValue(value); + } + return this; + } + + /** + * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public List> getAggregation() { + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + return this.aggregation; + } + + public boolean hasAggregation() { + if (this.aggregation == null) + return false; + for (Enumeration item : this.aggregation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + // syntactic sugar + public Enumeration addAggregationElement() {//2 + Enumeration t = new Enumeration(); + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + this.aggregation.add(t); + return t; + } + + /** + * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public TypeRefComponent addAggregation(ResourceAggregationMode value) { //1 + Enumeration t = new Enumeration(); + t.setValue(value); + if (this.aggregation == null) + this.aggregation = new ArrayList>(); + this.aggregation.add(t); + return this; + } + + /** + * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) + */ + public boolean hasAggregation(ResourceAggregationMode value) { + if (this.aggregation == null) + return false; + for (Enumeration v : this.aggregation) + if (v.equals(value)) // code + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Name of Data type or Resource that is a(or the) type used for this element.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("profile", "uri", "Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation)); + } + + public TypeRefComponent copy() { + TypeRefComponent dst = new TypeRefComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.profile = profile == null ? null : profile.copy(); + if (aggregation != null) { + dst.aggregation = new ArrayList>(); + for (Enumeration i : aggregation) + dst.aggregation.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (profile == null || profile.isEmpty()) + && (aggregation == null || aggregation.isEmpty()); + } + + } + + public static class ElementDefinitionConstraintComponent extends Element { + /** + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + @Child(name="key", type={IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality." ) + protected IdType key; + + /** + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + */ + @Child(name="name", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Short human label", formalDefinition="Used to label the constraint in OCL or in short displays incapable of displaying the full human description." ) + protected StringType name; + + /** + * Identifies the impact constraint violation has on the conformance of the instance. + */ + @Child(name="severity", type={CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." ) + protected Enumeration severity; + + /** + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + @Child(name="human", type={StringType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." ) + protected StringType human; + + /** + * An XPath expression of constraint that can be executed to see if this constraint is met. + */ + @Child(name="xpath", type={StringType.class}, order=5, min=1, max=1) + @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." ) + protected StringType xpath; + + private static final long serialVersionUID = -1195616532L; + + public ElementDefinitionConstraintComponent() { + super(); + } + + public ElementDefinitionConstraintComponent(IdType key, Enumeration severity, StringType human, StringType xpath) { + super(); + this.key = key; + this.severity = severity; + this.human = human; + this.xpath = xpath; + } + + /** + * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value + */ + public IdType getKeyElement() { + if (this.key == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key"); + else if (Configuration.doAutoCreate()) + this.key = new IdType(); + return this.key; + } + + public boolean hasKeyElement() { + return this.key != null && !this.key.isEmpty(); + } + + public boolean hasKey() { + return this.key != null && !this.key.isEmpty(); + } + + /** + * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setKeyElement(IdType value) { + this.key = value; + return this; + } + + /** + * @return Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + public String getKey() { + return this.key == null ? null : this.key.getValue(); + } + + /** + * @param value Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + */ + public ElementDefinitionConstraintComponent setKey(String value) { + if (this.key == null) + this.key = new IdType(); + this.key.setValue(value); + return this; + } + + /** + * @return {@link #name} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (Used to label the constraint in OCL or in short displays incapable of displaying the full human description.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + */ + public ElementDefinitionConstraintComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(); + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Identifies the impact constraint violation has on the conformance of the instance. + */ + public ConstraintSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Identifies the impact constraint violation has on the conformance of the instance. + */ + public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { + if (this.severity == null) + this.severity = new Enumeration(ConstraintSeverity.ENUM_FACTORY); + this.severity.setValue(value); + return this; + } + + /** + * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value + */ + public StringType getHumanElement() { + if (this.human == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human"); + else if (Configuration.doAutoCreate()) + this.human = new StringType(); + return this.human; + } + + public boolean hasHumanElement() { + return this.human != null && !this.human.isEmpty(); + } + + public boolean hasHuman() { + return this.human != null && !this.human.isEmpty(); + } + + /** + * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setHumanElement(StringType value) { + this.human = value; + return this; + } + + /** + * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + public String getHuman() { + return this.human == null ? null : this.human.getValue(); + } + + /** + * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + */ + public ElementDefinitionConstraintComponent setHuman(String value) { + if (this.human == null) + this.human = new StringType(); + this.human.setValue(value); + return this; + } + + /** + * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public StringType getXpathElement() { + if (this.xpath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath"); + else if (Configuration.doAutoCreate()) + this.xpath = new StringType(); + return this.xpath; + } + + public boolean hasXpathElement() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + public boolean hasXpath() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + /** + * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public ElementDefinitionConstraintComponent setXpathElement(StringType value) { + this.xpath = value; + return this; + } + + /** + * @return An XPath expression of constraint that can be executed to see if this constraint is met. + */ + public String getXpath() { + return this.xpath == null ? null : this.xpath.getValue(); + } + + /** + * @param value An XPath expression of constraint that can be executed to see if this constraint is met. + */ + public ElementDefinitionConstraintComponent setXpath(String value) { + if (this.xpath == null) + this.xpath = new StringType(); + this.xpath.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.", 0, java.lang.Integer.MAX_VALUE, key)); + childrenList.add(new Property("name", "string", "Used to label the constraint in OCL or in short displays incapable of displaying the full human description.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, java.lang.Integer.MAX_VALUE, human)); + childrenList.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, xpath)); + } + + public ElementDefinitionConstraintComponent copy() { + ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent(); + copyValues(dst); + dst.key = key == null ? null : key.copy(); + dst.name = name == null ? null : name.copy(); + dst.severity = severity == null ? null : severity.copy(); + dst.human = human == null ? null : human.copy(); + dst.xpath = xpath == null ? null : xpath.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (key == null || key.isEmpty()) && (name == null || name.isEmpty()) + && (severity == null || severity.isEmpty()) && (human == null || human.isEmpty()) && (xpath == null || xpath.isEmpty()) + ; + } + + } + + public static class ElementDefinitionBindingComponent extends Element { + /** + * A descriptive name for this - can be useful for generating implementation artifacts. + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Descriptive Name", formalDefinition="A descriptive name for this - can be useful for generating implementation artifacts." ) + protected StringType name; + + /** + * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. + */ + @Child(name="isExtensible", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Can additional codes be used?", formalDefinition="If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone." ) + protected BooleanType isExtensible; + + /** + * Indicates the degree of conformance expectations associated with this binding. + */ + @Child(name="conformance", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="required | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding." ) + protected Enumeration conformance; + + /** + * Describes the intended use of this particular set of codes. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) + protected StringType description; + + /** + * Points to the value set or external definition that identifies the set of codes to be used. + */ + @Child(name="reference", type={UriType.class, ValueSet.class}, order=5, min=0, max=1) + @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition that identifies the set of codes to be used." ) + protected Type reference; + + private static final long serialVersionUID = 1041151319L; + + public ElementDefinitionBindingComponent() { + super(); + } + + public ElementDefinitionBindingComponent(StringType name, BooleanType isExtensible) { + super(); + this.name = name; + this.isExtensible = isExtensible; + } + + /** + * @return {@link #name} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A descriptive name for this - can be useful for generating implementation artifacts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinitionBindingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A descriptive name for this - can be useful for generating implementation artifacts. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A descriptive name for this - can be useful for generating implementation artifacts. + */ + public ElementDefinitionBindingComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value + */ + public BooleanType getIsExtensibleElement() { + if (this.isExtensible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.isExtensible"); + else if (Configuration.doAutoCreate()) + this.isExtensible = new BooleanType(); + return this.isExtensible; + } + + public boolean hasIsExtensibleElement() { + return this.isExtensible != null && !this.isExtensible.isEmpty(); + } + + public boolean hasIsExtensible() { + return this.isExtensible != null && !this.isExtensible.isEmpty(); + } + + /** + * @param value {@link #isExtensible} (If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.). This is the underlying object with id, value and extensions. The accessor "getIsExtensible" gives direct access to the value + */ + public ElementDefinitionBindingComponent setIsExtensibleElement(BooleanType value) { + this.isExtensible = value; + return this; + } + + /** + * @return If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. + */ + public boolean getIsExtensible() { + return this.isExtensible == null ? false : this.isExtensible.getValue(); + } + + /** + * @param value If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone. + */ + public ElementDefinitionBindingComponent setIsExtensible(boolean value) { + if (this.isExtensible == null) + this.isExtensible = new BooleanType(); + this.isExtensible.setValue(value); + return this; + } + + /** + * @return {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value + */ + public Enumeration getConformanceElement() { + if (this.conformance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.conformance"); + else if (Configuration.doAutoCreate()) + this.conformance = new Enumeration(); + return this.conformance; + } + + public boolean hasConformanceElement() { + return this.conformance != null && !this.conformance.isEmpty(); + } + + public boolean hasConformance() { + return this.conformance != null && !this.conformance.isEmpty(); + } + + /** + * @param value {@link #conformance} (Indicates the degree of conformance expectations associated with this binding.). This is the underlying object with id, value and extensions. The accessor "getConformance" gives direct access to the value + */ + public ElementDefinitionBindingComponent setConformanceElement(Enumeration value) { + this.conformance = value; + return this; + } + + /** + * @return Indicates the degree of conformance expectations associated with this binding. + */ + public BindingConformance getConformance() { + return this.conformance == null ? null : this.conformance.getValue(); + } + + /** + * @param value Indicates the degree of conformance expectations associated with this binding. + */ + public ElementDefinitionBindingComponent setConformance(BindingConformance value) { + if (value == null) + this.conformance = null; + else { + if (this.conformance == null) + this.conformance = new Enumeration(BindingConformance.ENUM_FACTORY); + this.conformance.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Describes the intended use of this particular set of codes.). 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 ElementDefinitionBindingComponent.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} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Describes the intended use of this particular set of codes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Describes the intended use of this particular set of codes. + */ + public ElementDefinitionBindingComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) + */ + public Type getReference() { + return this.reference; + } + + /** + * @return {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) + */ + public UriType getReferenceUriType() throws Exception { + if (!(this.reference instanceof UriType)) + throw new Exception("Type mismatch: the type UriType was expected, but "+this.reference.getClass().getName()+" was encountered"); + return (UriType) this.reference; + } + + /** + * @return {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) + */ + public Reference getReferenceReference() throws Exception { + if (!(this.reference instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reference.getClass().getName()+" was encountered"); + return (Reference) this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Points to the value set or external definition that identifies the set of codes to be used.) + */ + public ElementDefinitionBindingComponent setReference(Type value) { + this.reference = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "A descriptive name for this - can be useful for generating implementation artifacts.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("isExtensible", "boolean", "If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone.", 0, java.lang.Integer.MAX_VALUE, isExtensible)); + childrenList.add(new Property("conformance", "code", "Indicates the degree of conformance expectations associated with this binding.", 0, java.lang.Integer.MAX_VALUE, conformance)); + childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("reference[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, reference)); + } + + public ElementDefinitionBindingComponent copy() { + ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.isExtensible = isExtensible == null ? null : isExtensible.copy(); + dst.conformance = conformance == null ? null : conformance.copy(); + dst.description = description == null ? null : description.copy(); + dst.reference = reference == null ? null : reference.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (isExtensible == null || isExtensible.isEmpty()) + && (conformance == null || conformance.isEmpty()) && (description == null || description.isEmpty()) + && (reference == null || reference.isEmpty()); + } + + } + + public static class ElementDefinitionMappingComponent extends Element { + /** + * An internal reference to the definition of a mapping. + */ + @Child(name="identity", type={IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." ) + protected IdType identity; + + /** + * Expresses what part of the target specification corresponds to this element. + */ + @Child(name="map", type={StringType.class}, order=2, 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 = -450627426L; + + public ElementDefinitionMappingComponent() { + super(); + } + + public ElementDefinitionMappingComponent(IdType identity, StringType map) { + super(); + this.identity = identity; + this.map = map; + } + + /** + * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public ElementDefinitionMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An internal reference to the definition of a mapping. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An internal reference to the definition of a mapping. + */ + public ElementDefinitionMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public StringType getMapElement() { + if (this.map == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map"); + else if (Configuration.doAutoCreate()) + this.map = new StringType(); + return this.map; + } + + public boolean hasMapElement() { + return this.map != null && !this.map.isEmpty(); + } + + public boolean hasMap() { + return this.map != null && !this.map.isEmpty(); + } + + /** + * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value + */ + public ElementDefinitionMappingComponent setMapElement(StringType value) { + this.map = value; + return this; + } + + /** + * @return Expresses what part of the target specification corresponds to this element. + */ + public String getMap() { + return this.map == null ? null : this.map.getValue(); + } + + /** + * @param value Expresses what part of the target specification corresponds to this element. + */ + public ElementDefinitionMappingComponent setMap(String value) { + if (this.map == null) + this.map = new StringType(); + this.map.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, java.lang.Integer.MAX_VALUE, identity)); + childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); + } + + public ElementDefinitionMappingComponent copy() { + ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.map = map == null ? null : map.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (map == null || map.isEmpty()) + ; + } + + } + + /** + * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + @Child(name="path", type={StringType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="The path of the element (see the Detailed Descriptions)", formalDefinition="The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension." ) + protected StringType path; + + /** + * Codes that define how this element is represented in instances, when the deviation varies from the normal case. + */ + @Child(name="representation", type={CodeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="How this element is represented in instances", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." ) + protected List> representation; + + /** + * The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name for this particular element definition (reference target)", formalDefinition="The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element." ) + protected StringType name; + + /** + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). + */ + @Child(name="slicing", type={}, order=2, min=0, max=1) + @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." ) + protected ElementDefinitionSlicingComponent slicing; + + /** + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + */ + @Child(name="short_", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Concise definition for xml presentation", formalDefinition="A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification)." ) + protected StringType short_; + + /** + * The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + @Child(name="formal", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Full formal definition in human language", formalDefinition="The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." ) + protected StringType formal; + + /** + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + @Child(name="comments", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Comments about the use of this element", formalDefinition="Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc." ) + protected StringType comments; + + /** + * Explains why this element is needed and why it's been constrained as it has. + */ + @Child(name="requirements", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this element is needed and why it's been constrained as it has." ) + protected StringType requirements; + + /** + * Identifies additional names by which this element might also be known. + */ + @Child(name="synonym", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) + protected List synonym; + + /** + * The minimum number of times this element SHALL appear in the instance. + */ + @Child(name="min", type={IntegerType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." ) + protected IntegerType min; + + /** + * The maximum number of times this element is permitted to appear in the instance. + */ + @Child(name="max", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." ) + protected StringType max; + + /** + * The data type or resource that the value of this element is permitted to be. + */ + @Child(name="type", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." ) + protected List type; + + /** + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + */ + @Child(name="nameReference", type={StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="To another element constraint (by element.name)", formalDefinition="Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element." ) + protected StringType nameReference; + + /** + * The value that should be used if there is no value stated in the instance. + */ + @Child(name="defaultValue", type={}, order=12, min=0, max=1) + @Description(shortDefinition="Specified value it missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance." ) + protected org.hl7.fhir.instance.model.Type defaultValue; + + /** + * The Implicit meaning that is to be understood when this element is missing. + */ + @Child(name="meaningWhenMissing", type={StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing." ) + protected StringType meaningWhenMissing; + + /** + * Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. + */ + @Child(name="fixed", type={}, order=14, min=0, max=1) + @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." ) + protected org.hl7.fhir.instance.model.Type fixed; + + /** + * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.). + */ + @Child(name="pattern", type={}, order=15, min=0, max=1) + @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.)." ) + protected org.hl7.fhir.instance.model.Type pattern; + + /** + * An example value for this element. + */ + @Child(name="example", type={}, order=16, min=0, max=1) + @Description(shortDefinition="Example value: [as defined for type]", formalDefinition="An example value for this element." ) + protected org.hl7.fhir.instance.model.Type example; + + /** + * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + @Child(name="maxLength", type={IntegerType.class}, order=17, min=0, max=1) + @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." ) + protected IntegerType maxLength; + + /** + * A reference to an invariant that may make additional statements about the cardinality or value in the instance. + */ + @Child(name="condition", type={IdType.class}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." ) + protected List condition; + + /** + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. + */ + @Child(name="constraint", type={}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." ) + protected List constraint; + + /** + * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + */ + @Child(name="mustSupport", type={BooleanType.class}, order=20, min=0, max=1) + @Description(shortDefinition="If the element must supported", formalDefinition="If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported." ) + protected BooleanType mustSupport; + + /** + * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + @Child(name="isModifier", type={BooleanType.class}, order=21, min=0, max=1) + @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." ) + protected BooleanType isModifier; + + /** + * Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + @Child(name="isSummary", type={BooleanType.class}, order=22, min=0, max=1) + @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." ) + protected BooleanType isSummary; + + /** + * Binds to a value set if this element is coded (code, Coding, CodeableConcept). + */ + @Child(name="binding", type={}, order=23, min=0, max=1) + @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) + protected ElementDefinitionBindingComponent binding; + + /** + * Identifies a concept from an external specification that roughly corresponds to this element. + */ + @Child(name="mapping", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) + protected List mapping; + + private static final long serialVersionUID = 2094512467L; + + public ElementDefinition() { + super(); + } + + public ElementDefinition(StringType path) { + super(); + this.path = path; + } + + /** + * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public StringType getPathElement() { + if (this.path == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.path"); + else if (Configuration.doAutoCreate()) + this.path = new StringType(); + return this.path; + } + + public boolean hasPathElement() { + return this.path != null && !this.path.isEmpty(); + } + + public boolean hasPath() { + return this.path != null && !this.path.isEmpty(); + } + + /** + * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value + */ + public ElementDefinition setPathElement(StringType value) { + this.path = value; + return this; + } + + /** + * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + public String getPath() { + return this.path == null ? null : this.path.getValue(); + } + + /** + * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + */ + public ElementDefinition setPath(String value) { + if (this.path == null) + this.path = new StringType(); + this.path.setValue(value); + return this; + } + + /** + * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public List> getRepresentation() { + if (this.representation == null) + this.representation = new ArrayList>(); + return this.representation; + } + + public boolean hasRepresentation() { + if (this.representation == null) + return false; + for (Enumeration item : this.representation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + // syntactic sugar + public Enumeration addRepresentationElement() {//2 + Enumeration t = new Enumeration(); + if (this.representation == null) + this.representation = new ArrayList>(); + this.representation.add(t); + return t; + } + + /** + * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public ElementDefinition addRepresentation(PropertyRepresentation value) { //1 + Enumeration t = new Enumeration(); + t.setValue(value); + if (this.representation == null) + this.representation = new ArrayList>(); + this.representation.add(t); + return this; + } + + /** + * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) + */ + public boolean hasRepresentation(PropertyRepresentation value) { + if (this.representation == null) + return false; + for (Enumeration v : this.representation) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #name} (The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ElementDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + */ + public ElementDefinition setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) + */ + public ElementDefinitionSlicingComponent getSlicing() { + if (this.slicing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.slicing"); + else if (Configuration.doAutoCreate()) + this.slicing = new ElementDefinitionSlicingComponent(); + return this.slicing; + } + + public boolean hasSlicing() { + return this.slicing != null && !this.slicing.isEmpty(); + } + + /** + * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) + */ + public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { + this.slicing = value; + return this; + } + + /** + * @return {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value + */ + public StringType getShortElement() { + if (this.short_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.short_"); + else if (Configuration.doAutoCreate()) + this.short_ = new StringType(); + return this.short_; + } + + public boolean hasShortElement() { + return this.short_ != null && !this.short_.isEmpty(); + } + + public boolean hasShort() { + return this.short_ != null && !this.short_.isEmpty(); + } + + /** + * @param value {@link #short_} (A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value + */ + public ElementDefinition setShortElement(StringType value) { + this.short_ = value; + return this; + } + + /** + * @return A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + */ + public String getShort() { + return this.short_ == null ? null : this.short_.getValue(); + } + + /** + * @param value A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + */ + public ElementDefinition setShort(String value) { + if (Utilities.noString(value)) + this.short_ = null; + else { + if (this.short_ == null) + this.short_ = new StringType(); + this.short_.setValue(value); + } + return this; + } + + /** + * @return {@link #formal} (The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getFormal" gives direct access to the value + */ + public StringType getFormalElement() { + if (this.formal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.formal"); + else if (Configuration.doAutoCreate()) + this.formal = new StringType(); + return this.formal; + } + + public boolean hasFormalElement() { + return this.formal != null && !this.formal.isEmpty(); + } + + public boolean hasFormal() { + return this.formal != null && !this.formal.isEmpty(); + } + + /** + * @param value {@link #formal} (The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getFormal" gives direct access to the value + */ + public ElementDefinition setFormalElement(StringType value) { + this.formal = value; + return this; + } + + /** + * @return The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + public String getFormal() { + return this.formal == null ? null : this.formal.getValue(); + } + + /** + * @param value The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + */ + public ElementDefinition setFormal(String value) { + if (Utilities.noString(value)) + this.formal = null; + else { + if (this.formal == null) + this.formal = new StringType(); + this.formal.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ElementDefinition setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + */ + public ElementDefinition setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (Explains why this element is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ElementDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return Explains why this element is needed and why it's been constrained as it has. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value Explains why this element is needed and why it's been constrained as it has. + */ + public ElementDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + public List getSynonym() { + if (this.synonym == null) + this.synonym = new ArrayList(); + return this.synonym; + } + + public boolean hasSynonym() { + if (this.synonym == null) + return false; + for (StringType item : this.synonym) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + // syntactic sugar + public StringType addSynonymElement() {//2 + StringType t = new StringType(); + if (this.synonym == null) + this.synonym = new ArrayList(); + this.synonym.add(t); + return t; + } + + /** + * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + public ElementDefinition addSynonym(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.synonym == null) + this.synonym = new ArrayList(); + this.synonym.add(t); + return this; + } + + /** + * @param value {@link #synonym} (Identifies additional names by which this element might also be known.) + */ + public boolean hasSynonym(String value) { + if (this.synonym == null) + return false; + for (StringType v : this.synonym) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). 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 ElementDefinition.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 element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public ElementDefinition setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return The minimum number of times this element SHALL appear in the instance. + */ + public int getMin() { + return this.min == null ? null : this.min.getValue(); + } + + /** + * @param value The minimum number of times this element SHALL appear in the instance. + */ + public ElementDefinition setMin(int value) { + if (value == -1) + this.min = null; + else { + 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 instance.). 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 ElementDefinition.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 instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public ElementDefinition setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return The maximum number of times this element is permitted to appear in the instance. + */ + 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 instance. + */ + public ElementDefinition setMax(String value) { + if (Utilities.noString(value)) + this.max = null; + else { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (TypeRefComponent item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) + */ + // syntactic sugar + public TypeRefComponent addType() { //3 + TypeRefComponent t = new TypeRefComponent(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value + */ + public StringType getNameReferenceElement() { + if (this.nameReference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.nameReference"); + else if (Configuration.doAutoCreate()) + this.nameReference = new StringType(); + return this.nameReference; + } + + public boolean hasNameReferenceElement() { + return this.nameReference != null && !this.nameReference.isEmpty(); + } + + public boolean hasNameReference() { + return this.nameReference != null && !this.nameReference.isEmpty(); + } + + /** + * @param value {@link #nameReference} (Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getNameReference" gives direct access to the value + */ + public ElementDefinition setNameReferenceElement(StringType value) { + this.nameReference = value; + return this; + } + + /** + * @return Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + */ + public String getNameReference() { + return this.nameReference == null ? null : this.nameReference.getValue(); + } + + /** + * @param value Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + */ + public ElementDefinition setNameReference(String value) { + if (Utilities.noString(value)) + this.nameReference = null; + else { + if (this.nameReference == null) + this.nameReference = new StringType(); + this.nameReference.setValue(value); + } + return this; + } + + /** + * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) + */ + public org.hl7.fhir.instance.model.Type getDefaultValue() { + return this.defaultValue; + } + + public boolean hasDefaultValue() { + return this.defaultValue != null && !this.defaultValue.isEmpty(); + } + + /** + * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance.) + */ + public ElementDefinition setDefaultValue(org.hl7.fhir.instance.model.Type value) { + this.defaultValue = value; + return this; + } + + /** + * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value + */ + public StringType getMeaningWhenMissingElement() { + if (this.meaningWhenMissing == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing"); + else if (Configuration.doAutoCreate()) + this.meaningWhenMissing = new StringType(); + return this.meaningWhenMissing; + } + + public boolean hasMeaningWhenMissingElement() { + return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); + } + + public boolean hasMeaningWhenMissing() { + return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); + } + + /** + * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value + */ + public ElementDefinition setMeaningWhenMissingElement(StringType value) { + this.meaningWhenMissing = value; + return this; + } + + /** + * @return The Implicit meaning that is to be understood when this element is missing. + */ + public String getMeaningWhenMissing() { + return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue(); + } + + /** + * @param value The Implicit meaning that is to be understood when this element is missing. + */ + public ElementDefinition setMeaningWhenMissing(String value) { + if (Utilities.noString(value)) + this.meaningWhenMissing = null; + else { + if (this.meaningWhenMissing == null) + this.meaningWhenMissing = new StringType(); + this.meaningWhenMissing.setValue(value); + } + return this; + } + + /** + * @return {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) + */ + public org.hl7.fhir.instance.model.Type getFixed() { + return this.fixed; + } + + public boolean hasFixed() { + return this.fixed != null && !this.fixed.isEmpty(); + } + + /** + * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) + */ + public ElementDefinition setFixed(org.hl7.fhir.instance.model.Type value) { + this.fixed = value; + return this; + } + + /** + * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) + */ + public org.hl7.fhir.instance.model.Type getPattern() { + return this.pattern; + } + + public boolean hasPattern() { + return this.pattern != null && !this.pattern.isEmpty(); + } + + /** + * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).) + */ + public ElementDefinition setPattern(org.hl7.fhir.instance.model.Type value) { + this.pattern = value; + return this; + } + + /** + * @return {@link #example} (An example value for this element.) + */ + public org.hl7.fhir.instance.model.Type getExample() { + return this.example; + } + + public boolean hasExample() { + return this.example != null && !this.example.isEmpty(); + } + + /** + * @param value {@link #example} (An example value for this element.) + */ + public ElementDefinition setExample(org.hl7.fhir.instance.model.Type value) { + this.example = value; + return this; + } + + /** + * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public IntegerType getMaxLengthElement() { + if (this.maxLength == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.maxLength"); + else if (Configuration.doAutoCreate()) + this.maxLength = new IntegerType(); + return this.maxLength; + } + + public boolean hasMaxLengthElement() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + public boolean hasMaxLength() { + return this.maxLength != null && !this.maxLength.isEmpty(); + } + + /** + * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value + */ + public ElementDefinition setMaxLengthElement(IntegerType value) { + this.maxLength = value; + return this; + } + + /** + * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + public int getMaxLength() { + return this.maxLength == null ? null : this.maxLength.getValue(); + } + + /** + * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + */ + public ElementDefinition setMaxLength(int value) { + if (value == -1) + this.maxLength = null; + else { + if (this.maxLength == null) + this.maxLength = new IntegerType(); + this.maxLength.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (IdType item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + // syntactic sugar + public IdType addConditionElement() {//2 + IdType t = new IdType(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public ElementDefinition addCondition(String value) { //1 + IdType t = new IdType(); + t.setValue(value); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return this; + } + + /** + * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) + */ + public boolean hasCondition(String value) { + if (this.condition == null) + return false; + for (IdType v : this.condition) + if (v.equals(value)) // id + return true; + return false; + } + + /** + * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) + */ + public List getConstraint() { + if (this.constraint == null) + this.constraint = new ArrayList(); + return this.constraint; + } + + public boolean hasConstraint() { + if (this.constraint == null) + return false; + for (ElementDefinitionConstraintComponent item : this.constraint) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) + */ + // syntactic sugar + public ElementDefinitionConstraintComponent addConstraint() { //3 + ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent(); + if (this.constraint == null) + this.constraint = new ArrayList(); + this.constraint.add(t); + return t; + } + + /** + * @return {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value + */ + public BooleanType getMustSupportElement() { + if (this.mustSupport == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.mustSupport"); + else if (Configuration.doAutoCreate()) + this.mustSupport = new BooleanType(); + return this.mustSupport; + } + + public boolean hasMustSupportElement() { + return this.mustSupport != null && !this.mustSupport.isEmpty(); + } + + public boolean hasMustSupport() { + return this.mustSupport != null && !this.mustSupport.isEmpty(); + } + + /** + * @param value {@link #mustSupport} (If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value + */ + public ElementDefinition setMustSupportElement(BooleanType value) { + this.mustSupport = value; + return this; + } + + /** + * @return If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + */ + public boolean getMustSupport() { + return this.mustSupport == null ? false : this.mustSupport.getValue(); + } + + /** + * @param value If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + */ + public ElementDefinition setMustSupport(boolean value) { + if (value == false) + this.mustSupport = null; + else { + if (this.mustSupport == null) + this.mustSupport = new BooleanType(); + this.mustSupport.setValue(value); + } + return this; + } + + /** + * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value + */ + public BooleanType getIsModifierElement() { + if (this.isModifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.isModifier"); + else if (Configuration.doAutoCreate()) + this.isModifier = new BooleanType(); + return this.isModifier; + } + + public boolean hasIsModifierElement() { + return this.isModifier != null && !this.isModifier.isEmpty(); + } + + public boolean hasIsModifier() { + return this.isModifier != null && !this.isModifier.isEmpty(); + } + + /** + * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value + */ + public ElementDefinition setIsModifierElement(BooleanType value) { + this.isModifier = value; + return this; + } + + /** + * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + public boolean getIsModifier() { + return this.isModifier == null ? false : this.isModifier.getValue(); + } + + /** + * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + */ + public ElementDefinition setIsModifier(boolean value) { + if (value == false) + this.isModifier = null; + else { + if (this.isModifier == null) + this.isModifier = new BooleanType(); + this.isModifier.setValue(value); + } + return this; + } + + /** + * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value + */ + public BooleanType getIsSummaryElement() { + if (this.isSummary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.isSummary"); + else if (Configuration.doAutoCreate()) + this.isSummary = new BooleanType(); + return this.isSummary; + } + + public boolean hasIsSummaryElement() { + return this.isSummary != null && !this.isSummary.isEmpty(); + } + + public boolean hasIsSummary() { + return this.isSummary != null && !this.isSummary.isEmpty(); + } + + /** + * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value + */ + public ElementDefinition setIsSummaryElement(BooleanType value) { + this.isSummary = value; + return this; + } + + /** + * @return Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + public boolean getIsSummary() { + return this.isSummary == null ? false : this.isSummary.getValue(); + } + + /** + * @param value Whether the element should be included if a client requests a search with the parameter _summary=true. + */ + public ElementDefinition setIsSummary(boolean value) { + if (value == false) + this.isSummary = null; + else { + if (this.isSummary == null) + this.isSummary = new BooleanType(); + this.isSummary.setValue(value); + } + return this; + } + + /** + * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public ElementDefinitionBindingComponent getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ElementDefinition.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new ElementDefinitionBindingComponent(); + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) + */ + public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { + this.binding = value; + return this; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (ElementDefinitionMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) + */ + // syntactic sugar + public ElementDefinitionMappingComponent addMapping() { //3 + ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("path", "string", "The path identifies the element and is expressed as a '.'-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, java.lang.Integer.MAX_VALUE, path)); + childrenList.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation)); + childrenList.add(new Property("name", "string", "The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, java.lang.Integer.MAX_VALUE, slicing)); + childrenList.add(new Property("short", "string", "A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification).", 0, java.lang.Integer.MAX_VALUE, short_)); + childrenList.add(new Property("formal", "string", "The definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, java.lang.Integer.MAX_VALUE, formal)); + childrenList.add(new Property("comments", "string", "Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); + 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("min", "integer", "The minimum number of times this element SHALL appear in the instance.", 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 instance.", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("nameReference", "string", "Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element.", 0, java.lang.Integer.MAX_VALUE, nameReference)); + childrenList.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance.", 0, java.lang.Integer.MAX_VALUE, defaultValue)); + childrenList.add(new Property("meaningWhenMissing", "string", "The Implicit meaning that is to be understood when this element is missing.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); + childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); + childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); + childrenList.add(new Property("example[x]", "*", "An example value for this element.", 0, java.lang.Integer.MAX_VALUE, example)); + childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); + childrenList.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint)); + childrenList.add(new Property("mustSupport", "boolean", "If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); + childrenList.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, java.lang.Integer.MAX_VALUE, isModifier)); + childrenList.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, java.lang.Integer.MAX_VALUE, isSummary)); + 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)); + childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); + } + + public ElementDefinition copy() { + ElementDefinition dst = new ElementDefinition(); + copyValues(dst); + dst.path = path == null ? null : path.copy(); + if (representation != null) { + dst.representation = new ArrayList>(); + for (Enumeration i : representation) + dst.representation.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.slicing = slicing == null ? null : slicing.copy(); + dst.short_ = short_ == null ? null : short_.copy(); + dst.formal = formal == null ? null : formal.copy(); + dst.comments = comments == null ? null : comments.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + if (synonym != null) { + dst.synonym = new ArrayList(); + for (StringType i : synonym) + dst.synonym.add(i.copy()); + }; + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (TypeRefComponent i : type) + dst.type.add(i.copy()); + }; + dst.nameReference = nameReference == null ? null : nameReference.copy(); + dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); + dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); + dst.fixed = fixed == null ? null : fixed.copy(); + dst.pattern = pattern == null ? null : pattern.copy(); + dst.example = example == null ? null : example.copy(); + dst.maxLength = maxLength == null ? null : maxLength.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (IdType i : condition) + dst.condition.add(i.copy()); + }; + if (constraint != null) { + dst.constraint = new ArrayList(); + for (ElementDefinitionConstraintComponent i : constraint) + dst.constraint.add(i.copy()); + }; + dst.mustSupport = mustSupport == null ? null : mustSupport.copy(); + dst.isModifier = isModifier == null ? null : isModifier.copy(); + dst.isSummary = isSummary == null ? null : isSummary.copy(); + dst.binding = binding == null ? null : binding.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (ElementDefinitionMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + return dst; + } + + protected ElementDefinition typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (path == null || path.isEmpty()) && (representation == null || representation.isEmpty()) + && (name == null || name.isEmpty()) && (slicing == null || slicing.isEmpty()) && (short_ == null || short_.isEmpty()) + && (formal == null || formal.isEmpty()) && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (synonym == null || synonym.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) + && (type == null || type.isEmpty()) && (nameReference == null || nameReference.isEmpty()) + && (defaultValue == null || defaultValue.isEmpty()) && (meaningWhenMissing == null || meaningWhenMissing.isEmpty()) + && (fixed == null || fixed.isEmpty()) && (pattern == null || pattern.isEmpty()) && (example == null || example.isEmpty()) + && (maxLength == null || maxLength.isEmpty()) && (condition == null || condition.isEmpty()) + && (constraint == null || constraint.isEmpty()) && (mustSupport == null || mustSupport.isEmpty()) + && (isModifier == null || isModifier.isEmpty()) && (isSummary == null || isSummary.isEmpty()) + && (binding == null || binding.isEmpty()) && (mapping == null || mapping.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java index 07b9bba7af0..b983418b9f9 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java @@ -20,426 +20,426 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. - */ -@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") -public class EligibilityRequest extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - private static final long serialVersionUID = 1836339504L; - - public EligibilityRequest() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EligibilityRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EligibilityRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 EligibilityRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public EligibilityRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public EligibilityRequest setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 EligibilityRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EligibilityRequest setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 EligibilityRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityRequest setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 EligibilityRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - protected void listChildren(List 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("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("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 EligibilityRequest copy() { - EligibilityRequest dst = new EligibilityRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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 EligibilityRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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.EligibilityRequest; - } - - @SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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.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; +/** + * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + */ +@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") +public class EligibilityRequest extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + private static final long serialVersionUID = 1836339504L; + + public EligibilityRequest() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EligibilityRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EligibilityRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 EligibilityRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public EligibilityRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public EligibilityRequest setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 EligibilityRequest setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EligibilityRequest setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 EligibilityRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityRequest setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 EligibilityRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + protected void listChildren(List 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("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("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 EligibilityRequest copy() { + EligibilityRequest dst = new EligibilityRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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 EligibilityRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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.EligibilityRequest; + } + + @SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java index 2db48346d5a..aa017fa4986 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java @@ -20,679 +20,679 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ -@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") -public class EligibilityResponse extends DomainResource { - - public enum RSLink implements FhirEnum { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) throws IllegalArgumentException { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @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 EligibilityRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = 241710852L; - - public EligibilityResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public EligibilityResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 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 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(EligibilityRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EligibilityResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EligibilityResponse setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(RSLink.ENUM_FACTORY); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EligibilityResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EligibilityResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EligibilityResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EligibilityResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EligibilityResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Insurer who produced this adjudicated response.) - */ - public EligibilityResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} 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 EligibilityResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} 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 EligibilityResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List 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(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("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)); - } - - public EligibilityResponse copy() { - EligibilityResponse dst = new EligibilityResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - return dst; - } - - protected EligibilityResponse typedCopy() { - return copy(); - } - - public boolean isEmpty() { - 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()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EligibilityResponse; - } - - @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides eligibility and plan details from the processing of an Eligibility resource. + */ +@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") +public class EligibilityResponse extends DomainResource { + + public enum RSLink implements FhirEnum { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) throws IllegalArgumentException { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @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 EligibilityRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = 241710852L; + + public EligibilityResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public EligibilityResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 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 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(EligibilityRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public EligibilityResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public EligibilityResponse setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EligibilityResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EligibilityResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EligibilityResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EligibilityResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public EligibilityResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Insurer who produced this adjudicated response.) + */ + public EligibilityResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 EligibilityResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public EligibilityResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 EligibilityResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + protected void listChildren(List 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(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("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)); + } + + public EligibilityResponse copy() { + EligibilityResponse dst = new EligibilityResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + return dst; + } + + protected EligibilityResponse typedCopy() { + return copy(); + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EligibilityResponse; + } + + @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java index 89cefb881d9..f93989f9cb1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java @@ -20,2029 +20,2029 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. - */ -@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") -public class Encounter extends DomainResource { - - public enum EncounterState implements FhirEnum { - /** - * The Encounter has not yet started. - */ - PLANNED, - /** - * The Encounter has begun and the patient is present / the practitioner and the patient are meeting. - */ - INPROGRESS, - /** - * The Encounter has begun, but the patient is temporarily on leave. - */ - ONLEAVE, - /** - * The Encounter has ended. - */ - FINISHED, - /** - * The Encounter has ended before it has begun. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PLANNED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("onleave".equals(codeString)) - return ONLEAVE; - if ("finished".equals(codeString)) - return FINISHED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case INPROGRESS: return "in progress"; - case ONLEAVE: return "onleave"; - case FINISHED: return "finished"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return ""; - case INPROGRESS: return ""; - case ONLEAVE: return ""; - case FINISHED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "The Encounter has not yet started."; - case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting."; - case ONLEAVE: return "The Encounter has begun, but the patient is temporarily on leave."; - case FINISHED: return "The Encounter has ended."; - case CANCELLED: return "The Encounter has ended before it has begun."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "planned"; - case INPROGRESS: return "in progress"; - case ONLEAVE: return "onleave"; - case FINISHED: return "finished"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - } - - public static class EncounterStateEnumFactory implements EnumFactory { - public EncounterState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EncounterState.PLANNED; - if ("in progress".equals(codeString)) - return EncounterState.INPROGRESS; - if ("onleave".equals(codeString)) - return EncounterState.ONLEAVE; - if ("finished".equals(codeString)) - return EncounterState.FINISHED; - if ("cancelled".equals(codeString)) - return EncounterState.CANCELLED; - throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); - } - public String toCode(EncounterState code) throws IllegalArgumentException { - if (code == EncounterState.PLANNED) - return "planned"; - if (code == EncounterState.INPROGRESS) - return "in progress"; - if (code == EncounterState.ONLEAVE) - return "onleave"; - if (code == EncounterState.FINISHED) - return "finished"; - if (code == EncounterState.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum EncounterClass implements FhirEnum { - /** - * An encounter during which the patient is hospitalized and stays overnight. - */ - INPATIENT, - /** - * An encounter during which the patient is not hospitalized overnight. - */ - OUTPATIENT, - /** - * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit. - */ - AMBULATORY, - /** - * An encounter where the patient needs urgent care. - */ - EMERGENCY, - /** - * An encounter where the practitioner visits the patient at his/her home. - */ - HOME, - /** - * An encounter taking place outside the regular environment for giving care. - */ - FIELD, - /** - * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight. - */ - DAYTIME, - /** - * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact. - */ - VIRTUAL, - /** - * added to help the parsers - */ - NULL; - - 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)) - return INPATIENT; - if ("outpatient".equals(codeString)) - return OUTPATIENT; - if ("ambulatory".equals(codeString)) - return AMBULATORY; - if ("emergency".equals(codeString)) - return EMERGENCY; - if ("home".equals(codeString)) - return HOME; - if ("field".equals(codeString)) - return FIELD; - if ("daytime".equals(codeString)) - return DAYTIME; - if ("virtual".equals(codeString)) - return VIRTUAL; - throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case INPATIENT: return "inpatient"; - case OUTPATIENT: return "outpatient"; - case AMBULATORY: return "ambulatory"; - case EMERGENCY: return "emergency"; - case HOME: return "home"; - case FIELD: return "field"; - case DAYTIME: return "daytime"; - case VIRTUAL: return "virtual"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPATIENT: return ""; - case OUTPATIENT: return ""; - case AMBULATORY: return ""; - case EMERGENCY: return ""; - case HOME: return ""; - case FIELD: return ""; - case DAYTIME: return ""; - case VIRTUAL: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight."; - case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight."; - case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit."; - case EMERGENCY: return "An encounter where the patient needs urgent care."; - case HOME: return "An encounter where the practitioner visits the patient at his/her home."; - case FIELD: return "An encounter taking place outside the regular environment for giving care."; - case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight."; - case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPATIENT: return "inpatient"; - case OUTPATIENT: return "outpatient"; - case AMBULATORY: return "ambulatory"; - case EMERGENCY: return "emergency"; - case HOME: return "home"; - case FIELD: return "field"; - case DAYTIME: return "daytime"; - case VIRTUAL: return "virtual"; - default: return "?"; - } - } - } - - public static class EncounterClassEnumFactory implements EnumFactory { - public EncounterClass fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("inpatient".equals(codeString)) - return EncounterClass.INPATIENT; - if ("outpatient".equals(codeString)) - return EncounterClass.OUTPATIENT; - if ("ambulatory".equals(codeString)) - return EncounterClass.AMBULATORY; - if ("emergency".equals(codeString)) - return EncounterClass.EMERGENCY; - if ("home".equals(codeString)) - return EncounterClass.HOME; - if ("field".equals(codeString)) - return EncounterClass.FIELD; - if ("daytime".equals(codeString)) - return EncounterClass.DAYTIME; - if ("virtual".equals(codeString)) - return EncounterClass.VIRTUAL; - throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); - } - public String toCode(EncounterClass code) throws IllegalArgumentException { - if (code == EncounterClass.INPATIENT) - return "inpatient"; - if (code == EncounterClass.OUTPATIENT) - return "outpatient"; - if (code == EncounterClass.AMBULATORY) - return "ambulatory"; - if (code == EncounterClass.EMERGENCY) - return "emergency"; - if (code == EncounterClass.HOME) - return "home"; - if (code == EncounterClass.FIELD) - return "field"; - if (code == EncounterClass.DAYTIME) - return "daytime"; - if (code == EncounterClass.VIRTUAL) - return "virtual"; - return "?"; - } - } - - @Block() - public static class EncounterParticipantComponent extends BackboneElement { - /** - * Role of participant in encounter. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." ) - protected List type; - - /** - * Persons involved in the encounter other than the patient. - */ - @Child(name="individual", type={Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="Persons involved in the encounter other than the patient", formalDefinition="Persons involved in the encounter other than the patient." ) - protected Reference individual; - - /** - * The actual object that is the target of the reference (Persons involved in the encounter other than the patient.) - */ - protected Resource individualTarget; - - private static final long serialVersionUID = 129909055L; - - public EncounterParticipantComponent() { - super(); - } - - /** - * @return {@link #type} (Role of participant in encounter.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Role of participant in encounter.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #individual} (Persons involved in the encounter other than the patient.) - */ - public Reference getIndividual() { - if (this.individual == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterParticipantComponent.individual"); - else if (Configuration.doAutoCreate()) - this.individual = new Reference(); - return this.individual; - } - - public boolean hasIndividual() { - return this.individual != null && !this.individual.isEmpty(); - } - - /** - * @param value {@link #individual} (Persons involved in the encounter other than the patient.) - */ - public EncounterParticipantComponent setIndividual(Reference value) { - this.individual = value; - return this; - } - - /** - * @return {@link #individual} 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. (Persons involved in the encounter other than the patient.) - */ - public Resource getIndividualTarget() { - return this.individualTarget; - } - - /** - * @param value {@link #individual} 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. (Persons involved in the encounter other than the patient.) - */ - public EncounterParticipantComponent setIndividualTarget(Resource value) { - this.individualTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("individual", "Reference(Practitioner|RelatedPerson)", "Persons involved in the encounter other than the patient.", 0, java.lang.Integer.MAX_VALUE, individual)); - } - - public EncounterParticipantComponent copy() { - EncounterParticipantComponent dst = new EncounterParticipantComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.individual = individual == null ? null : individual.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (individual == null || individual.isEmpty()) - ; - } - - } - - @Block() - public static class EncounterHospitalizationComponent extends BackboneElement { - /** - * Pre-admission identifier. - */ - @Child(name="preAdmissionIdentifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." ) - protected Identifier preAdmissionIdentifier; - - /** - * The location from which the patient came before admission. - */ - @Child(name="origin", type={Location.class}, order=2, min=0, max=1) - @Description(shortDefinition="The location from which the patient came before admission", formalDefinition="The location from which the patient came before admission." ) - protected Reference origin; - - /** - * The actual object that is the target of the reference (The location from which the patient came before admission.) - */ - protected Location originTarget; - - /** - * From where patient was admitted (physician referral, transfer). - */ - @Child(name="admitSource", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." ) - protected CodeableConcept admitSource; - - /** - * Period during which the patient was admitted. - */ - @Child(name="period", type={Period.class}, order=4, min=0, max=1) - @Description(shortDefinition="Period during which the patient was admitted", formalDefinition="Period during which the patient was admitted." ) - protected Period period; - - /** - * Where the patient stays during this encounter. - */ - @Child(name="accomodation", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Where the patient stays during this encounter", formalDefinition="Where the patient stays during this encounter." ) - protected List accomodation; - - /** - * Dietary restrictions for the patient. - */ - @Child(name="diet", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Dietary restrictions for the patient", formalDefinition="Dietary restrictions for the patient." ) - protected CodeableConcept diet; - - /** - * Special courtesies (VIP, board member). - */ - @Child(name="specialCourtesy", type={CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies (VIP, board member)." ) - protected List specialCourtesy; - - /** - * Wheelchair, translator, stretcher, etc. - */ - @Child(name="specialArrangement", type={CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Wheelchair, translator, stretcher, etc", formalDefinition="Wheelchair, translator, stretcher, etc." ) - protected List specialArrangement; - - /** - * Location to which the patient is discharged. - */ - @Child(name="destination", type={Location.class}, order=9, min=0, max=1) - @Description(shortDefinition="Location to which the patient is discharged", formalDefinition="Location to which the patient is discharged." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Location to which the patient is discharged.) - */ - protected Location destinationTarget; - - /** - * Category or kind of location after discharge. - */ - @Child(name="dischargeDisposition", type={CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." ) - protected CodeableConcept dischargeDisposition; - - /** - * The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. - */ - @Child(name="dischargeDiagnosis", type={}, order=11, min=0, max=1) - @Description(shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", formalDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." ) - protected Reference dischargeDiagnosis; - - /** - * The actual object that is the target of the reference (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - protected Resource dischargeDiagnosisTarget; - - /** - * Whether this hospitalization is a readmission. - */ - @Child(name="reAdmission", type={BooleanType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Is this hospitalization a readmission?", formalDefinition="Whether this hospitalization is a readmission." ) - protected BooleanType reAdmission; - - private static final long serialVersionUID = 221977130L; - - public EncounterHospitalizationComponent() { - super(); - } - - /** - * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.) - */ - public Identifier getPreAdmissionIdentifier() { - if (this.preAdmissionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.preAdmissionIdentifier"); - else if (Configuration.doAutoCreate()) - this.preAdmissionIdentifier = new Identifier(); - return this.preAdmissionIdentifier; - } - - public boolean hasPreAdmissionIdentifier() { - return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty(); - } - - /** - * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.) - */ - public EncounterHospitalizationComponent setPreAdmissionIdentifier(Identifier value) { - this.preAdmissionIdentifier = value; - return this; - } - - /** - * @return {@link #origin} (The location from which the patient came before admission.) - */ - public Reference getOrigin() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new Reference(); - return this.origin; - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The location from which the patient came before admission.) - */ - public EncounterHospitalizationComponent setOrigin(Reference value) { - this.origin = value; - return this; - } - - /** - * @return {@link #origin} 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 location from which the patient came before admission.) - */ - public Location getOriginTarget() { - if (this.originTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.originTarget = new Location(); - return this.originTarget; - } - - /** - * @param value {@link #origin} 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 location from which the patient came before admission.) - */ - public EncounterHospitalizationComponent setOriginTarget(Location value) { - this.originTarget = value; - return this; - } - - /** - * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).) - */ - public CodeableConcept getAdmitSource() { - if (this.admitSource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.admitSource"); - else if (Configuration.doAutoCreate()) - this.admitSource = new CodeableConcept(); - return this.admitSource; - } - - public boolean hasAdmitSource() { - return this.admitSource != null && !this.admitSource.isEmpty(); - } - - /** - * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).) - */ - public EncounterHospitalizationComponent setAdmitSource(CodeableConcept value) { - this.admitSource = value; - return this; - } - - /** - * @return {@link #period} (Period during which the patient was admitted.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.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} (Period during which the patient was admitted.) - */ - public EncounterHospitalizationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #accomodation} (Where the patient stays during this encounter.) - */ - public List getAccomodation() { - if (this.accomodation == null) - this.accomodation = new ArrayList(); - return this.accomodation; - } - - public boolean hasAccomodation() { - if (this.accomodation == null) - return false; - for (EncounterHospitalizationAccomodationComponent item : this.accomodation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #accomodation} (Where the patient stays during this encounter.) - */ - // syntactic sugar - public EncounterHospitalizationAccomodationComponent addAccomodation() { //3 - EncounterHospitalizationAccomodationComponent t = new EncounterHospitalizationAccomodationComponent(); - if (this.accomodation == null) - this.accomodation = new ArrayList(); - this.accomodation.add(t); - return t; - } - - /** - * @return {@link #diet} (Dietary restrictions for the patient.) - */ - public CodeableConcept getDiet() { - if (this.diet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.diet"); - else if (Configuration.doAutoCreate()) - this.diet = new CodeableConcept(); - return this.diet; - } - - public boolean hasDiet() { - return this.diet != null && !this.diet.isEmpty(); - } - - /** - * @param value {@link #diet} (Dietary restrictions for the patient.) - */ - public EncounterHospitalizationComponent setDiet(CodeableConcept value) { - this.diet = value; - return this; - } - - /** - * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) - */ - public List getSpecialCourtesy() { - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - return this.specialCourtesy; - } - - public boolean hasSpecialCourtesy() { - if (this.specialCourtesy == null) - return false; - for (CodeableConcept item : this.specialCourtesy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) - */ - // syntactic sugar - public CodeableConcept addSpecialCourtesy() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - this.specialCourtesy.add(t); - return t; - } - - /** - * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) - */ - public List getSpecialArrangement() { - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - return this.specialArrangement; - } - - public boolean hasSpecialArrangement() { - if (this.specialArrangement == null) - return false; - for (CodeableConcept item : this.specialArrangement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) - */ - // syntactic sugar - public CodeableConcept addSpecialArrangement() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - this.specialArrangement.add(t); - return t; - } - - /** - * @return {@link #destination} (Location to which the patient is discharged.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Location to which the patient is discharged.) - */ - public EncounterHospitalizationComponent setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} 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. (Location to which the patient is discharged.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); - return this.destinationTarget; - } - - /** - * @param value {@link #destination} 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. (Location to which the patient is discharged.) - */ - public EncounterHospitalizationComponent setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #dischargeDisposition} (Category or kind of location after discharge.) - */ - public CodeableConcept getDischargeDisposition() { - if (this.dischargeDisposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDisposition"); - else if (Configuration.doAutoCreate()) - this.dischargeDisposition = new CodeableConcept(); - return this.dischargeDisposition; - } - - public boolean hasDischargeDisposition() { - return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty(); - } - - /** - * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.) - */ - public EncounterHospitalizationComponent setDischargeDisposition(CodeableConcept value) { - this.dischargeDisposition = value; - return this; - } - - /** - * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public Reference getDischargeDiagnosis() { - if (this.dischargeDiagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDiagnosis"); - else if (Configuration.doAutoCreate()) - this.dischargeDiagnosis = new Reference(); - return this.dischargeDiagnosis; - } - - public boolean hasDischargeDiagnosis() { - return this.dischargeDiagnosis != null && !this.dischargeDiagnosis.isEmpty(); - } - - /** - * @param value {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public EncounterHospitalizationComponent setDischargeDiagnosis(Reference value) { - this.dischargeDiagnosis = value; - return this; - } - - /** - * @return {@link #dischargeDiagnosis} 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public Resource getDischargeDiagnosisTarget() { - return this.dischargeDiagnosisTarget; - } - - /** - * @param value {@link #dischargeDiagnosis} 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public EncounterHospitalizationComponent setDischargeDiagnosisTarget(Resource value) { - this.dischargeDiagnosisTarget = value; - return this; - } - - /** - * @return {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value - */ - public BooleanType getReAdmissionElement() { - if (this.reAdmission == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.reAdmission"); - else if (Configuration.doAutoCreate()) - this.reAdmission = new BooleanType(); - return this.reAdmission; - } - - public boolean hasReAdmissionElement() { - return this.reAdmission != null && !this.reAdmission.isEmpty(); - } - - public boolean hasReAdmission() { - return this.reAdmission != null && !this.reAdmission.isEmpty(); - } - - /** - * @param value {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value - */ - public EncounterHospitalizationComponent setReAdmissionElement(BooleanType value) { - this.reAdmission = value; - return this; - } - - /** - * @return Whether this hospitalization is a readmission. - */ - public boolean getReAdmission() { - return this.reAdmission == null ? false : this.reAdmission.getValue(); - } - - /** - * @param value Whether this hospitalization is a readmission. - */ - public EncounterHospitalizationComponent setReAdmission(boolean value) { - if (value == false) - this.reAdmission = null; - else { - if (this.reAdmission == null) - this.reAdmission = new BooleanType(); - this.reAdmission.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, java.lang.Integer.MAX_VALUE, preAdmissionIdentifier)); - childrenList.add(new Property("origin", "Reference(Location)", "The location from which the patient came before admission.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, java.lang.Integer.MAX_VALUE, admitSource)); - childrenList.add(new Property("period", "Period", "Period during which the patient was admitted.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("accomodation", "", "Where the patient stays during this encounter.", 0, java.lang.Integer.MAX_VALUE, accomodation)); - childrenList.add(new Property("diet", "CodeableConcept", "Dietary restrictions for the patient.", 0, java.lang.Integer.MAX_VALUE, diet)); - childrenList.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies (VIP, board member).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy)); - childrenList.add(new Property("specialArrangement", "CodeableConcept", "Wheelchair, translator, stretcher, etc.", 0, java.lang.Integer.MAX_VALUE, specialArrangement)); - childrenList.add(new Property("destination", "Reference(Location)", "Location to which the patient is discharged.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, java.lang.Integer.MAX_VALUE, dischargeDisposition)); - childrenList.add(new Property("dischargeDiagnosis", "Reference(Any)", "The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.", 0, java.lang.Integer.MAX_VALUE, dischargeDiagnosis)); - childrenList.add(new Property("reAdmission", "boolean", "Whether this hospitalization is a readmission.", 0, java.lang.Integer.MAX_VALUE, reAdmission)); - } - - public EncounterHospitalizationComponent copy() { - EncounterHospitalizationComponent dst = new EncounterHospitalizationComponent(); - copyValues(dst); - dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy(); - dst.origin = origin == null ? null : origin.copy(); - dst.admitSource = admitSource == null ? null : admitSource.copy(); - dst.period = period == null ? null : period.copy(); - if (accomodation != null) { - dst.accomodation = new ArrayList(); - for (EncounterHospitalizationAccomodationComponent i : accomodation) - dst.accomodation.add(i.copy()); - }; - dst.diet = diet == null ? null : diet.copy(); - if (specialCourtesy != null) { - dst.specialCourtesy = new ArrayList(); - for (CodeableConcept i : specialCourtesy) - dst.specialCourtesy.add(i.copy()); - }; - if (specialArrangement != null) { - dst.specialArrangement = new ArrayList(); - for (CodeableConcept i : specialArrangement) - dst.specialArrangement.add(i.copy()); - }; - dst.destination = destination == null ? null : destination.copy(); - dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy(); - dst.dischargeDiagnosis = dischargeDiagnosis == null ? null : dischargeDiagnosis.copy(); - dst.reAdmission = reAdmission == null ? null : reAdmission.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (preAdmissionIdentifier == null || preAdmissionIdentifier.isEmpty()) - && (origin == null || origin.isEmpty()) && (admitSource == null || admitSource.isEmpty()) - && (period == null || period.isEmpty()) && (accomodation == null || accomodation.isEmpty()) - && (diet == null || diet.isEmpty()) && (specialCourtesy == null || specialCourtesy.isEmpty()) - && (specialArrangement == null || specialArrangement.isEmpty()) && (destination == null || destination.isEmpty()) - && (dischargeDisposition == null || dischargeDisposition.isEmpty()) && (dischargeDiagnosis == null || dischargeDiagnosis.isEmpty()) - && (reAdmission == null || reAdmission.isEmpty()); - } - - } - - @Block() - public static class EncounterHospitalizationAccomodationComponent extends BackboneElement { - /** - * The bed that is assigned to the patient. - */ - @Child(name="bed", type={Location.class}, order=1, min=0, max=1) - @Description(shortDefinition="The bed that is assigned to the patient", formalDefinition="The bed that is assigned to the patient." ) - protected Reference bed; - - /** - * The actual object that is the target of the reference (The bed that is assigned to the patient.) - */ - protected Location bedTarget; - - /** - * Period during which the patient was assigned the bed. - */ - @Child(name="period", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Period during which the patient was assigned the bed", formalDefinition="Period during which the patient was assigned the bed." ) - protected Period period; - - private static final long serialVersionUID = 1058938507L; - - public EncounterHospitalizationAccomodationComponent() { - super(); - } - - /** - * @return {@link #bed} (The bed that is assigned to the patient.) - */ - public Reference getBed() { - if (this.bed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationAccomodationComponent.bed"); - else if (Configuration.doAutoCreate()) - this.bed = new Reference(); - return this.bed; - } - - public boolean hasBed() { - return this.bed != null && !this.bed.isEmpty(); - } - - /** - * @param value {@link #bed} (The bed that is assigned to the patient.) - */ - public EncounterHospitalizationAccomodationComponent setBed(Reference value) { - this.bed = value; - return this; - } - - /** - * @return {@link #bed} 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 bed that is assigned to the patient.) - */ - public Location getBedTarget() { - if (this.bedTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationAccomodationComponent.bed"); - else if (Configuration.doAutoCreate()) - this.bedTarget = new Location(); - return this.bedTarget; - } - - /** - * @param value {@link #bed} 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 bed that is assigned to the patient.) - */ - public EncounterHospitalizationAccomodationComponent setBedTarget(Location value) { - this.bedTarget = value; - return this; - } - - /** - * @return {@link #period} (Period during which the patient was assigned the bed.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationAccomodationComponent.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} (Period during which the patient was assigned the bed.) - */ - public EncounterHospitalizationAccomodationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bed", "Reference(Location)", "The bed that is assigned to the patient.", 0, java.lang.Integer.MAX_VALUE, bed)); - childrenList.add(new Property("period", "Period", "Period during which the patient was assigned the bed.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public EncounterHospitalizationAccomodationComponent copy() { - EncounterHospitalizationAccomodationComponent dst = new EncounterHospitalizationAccomodationComponent(); - copyValues(dst); - dst.bed = bed == null ? null : bed.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (bed == null || bed.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - } - - @Block() - public static class EncounterLocationComponent extends BackboneElement { - /** - * The location where the encounter takes place. - */ - @Child(name="location", type={Location.class}, order=1, min=1, max=1) - @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where the encounter takes place.) - */ - protected Location locationTarget; - - /** - * Time period during which the patient was present at the location. - */ - @Child(name="period", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." ) - protected Period period; - - private static final long serialVersionUID = 1137166303L; - - public EncounterLocationComponent() { - super(); - } - - public EncounterLocationComponent(Reference location) { - super(); - this.location = location; - } - - /** - * @return {@link #location} (The location where the encounter takes place.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where the encounter takes place.) - */ - public EncounterLocationComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 location where the encounter takes place.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 location where the encounter takes place.) - */ - public EncounterLocationComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #period} (Time period during which the patient was present at the location.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.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} (Time period during which the patient was present at the location.) - */ - public EncounterLocationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public EncounterLocationComponent copy() { - EncounterLocationComponent dst = new EncounterLocationComponent(); - copyValues(dst); - dst.location = location == null ? null : location.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (location == null || location.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - } - - /** - * Identifier(s) by which this encounter is known. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." ) - protected List identifier; - - /** - * planned | in progress | onleave | finished | cancelled. - */ - @Child(name="status", type={CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="planned | in progress | onleave | finished | cancelled", formalDefinition="planned | in progress | onleave | finished | cancelled." ) - protected Enumeration status; - - /** - * inpatient | outpatient | ambulatory | emergency +. - */ - @Child(name="class_", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="inpatient | outpatient | ambulatory | emergency +", formalDefinition="inpatient | outpatient | ambulatory | emergency +." ) - protected Enumeration class_; - - /** - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). - */ - @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific type of encounter", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." ) - protected List type; - - /** - * The patient present at the encounter. - */ - @Child(name="subject", type={Patient.class}, order=3, min=0, max=1) - @Description(shortDefinition="The patient present at the encounter", formalDefinition="The patient present at the encounter." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient present at the encounter.) - */ - protected Patient subjectTarget; - - /** - * The main practitioner responsible for providing the service. - */ - @Child(name="participant", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The main practitioner responsible for providing the service." ) - protected List participant; - - /** - * The appointment that scheduled this encounter. - */ - @Child(name="fulfills", type={Appointment.class}, order=5, min=0, max=1) - @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." ) - protected Reference fulfills; - - /** - * The actual object that is the target of the reference (The appointment that scheduled this encounter.) - */ - protected Appointment fulfillsTarget; - - /** - * The start and end time of the encounter. - */ - @Child(name="period", type={Period.class}, order=6, min=0, max=1) - @Description(shortDefinition="The start and end time of the encounter", formalDefinition="The start and end time of the encounter." ) - protected Period period; - - /** - * Quantity of time the encounter lasted. This excludes the time during leaves of absence. - */ - @Child(name="length", type={Duration.class}, order=7, min=0, max=1) - @Description(shortDefinition="Quantity of time the encounter lasted", formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." ) - protected Duration length; - - /** - * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. - */ - @Child(name="reason", type={CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Reason the encounter takes place (code)", formalDefinition="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis." ) - protected CodeableConcept reason; - - /** - * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. - */ - @Child(name="indication", type={}, order=9, min=0, max=1) - @Description(shortDefinition="Reason the encounter takes place (resource)", formalDefinition="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis." ) - protected Reference indication; - - /** - * The actual object that is the target of the reference (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) - */ - protected Resource indicationTarget; - - /** - * Indicates the urgency of the encounter. - */ - @Child(name="priority", type={CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." ) - protected CodeableConcept priority; - - /** - * Details about an admission to a clinic. - */ - @Child(name="hospitalization", type={}, order=11, min=0, max=1) - @Description(shortDefinition="Details about an admission to a clinic", formalDefinition="Details about an admission to a clinic." ) - protected EncounterHospitalizationComponent hospitalization; - - /** - * List of locations at which the patient has been. - */ - @Child(name="location", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of locations the patient has been at", formalDefinition="List of locations at which the patient has been." ) - protected List location; - - /** - * Department or team providing care. - */ - @Child(name="serviceProvider", type={Organization.class}, order=13, min=0, max=1) - @Description(shortDefinition="Department or team providing care", formalDefinition="Department or team providing care." ) - protected Reference serviceProvider; - - /** - * The actual object that is the target of the reference (Department or team providing care.) - */ - protected Organization serviceProviderTarget; - - /** - * Another Encounter of which this encounter is a part of (administratively or in time). - */ - @Child(name="partOf", type={Encounter.class}, order=14, min=0, max=1) - @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - protected Encounter partOfTarget; - - private static final long serialVersionUID = 1294341693L; - - public Encounter() { - super(); - } - - public Encounter(Enumeration status, Enumeration class_) { - super(); - this.status = status; - this.class_ = class_; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this encounter is known.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier(s) by which this encounter is known.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #status} (planned | in progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (planned | in progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Encounter setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | in progress | onleave | finished | cancelled. - */ - public EncounterState getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | in progress | onleave | finished | cancelled. - */ - public Encounter setStatus(EncounterState value) { - if (this.status == null) - this.status = new Enumeration(EncounterState.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value - */ - public Enumeration getClass_Element() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new Enumeration(); - return this.class_; - } - - public boolean hasClass_Element() { - return this.class_ != null && !this.class_.isEmpty(); - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value - */ - public Encounter setClass_Element(Enumeration value) { - this.class_ = value; - return this; - } - - /** - * @return inpatient | outpatient | ambulatory | emergency +. - */ - public EncounterClass getClass_() { - return this.class_ == null ? null : this.class_.getValue(); - } - - /** - * @param value inpatient | outpatient | ambulatory | emergency +. - */ - public Encounter setClass_(EncounterClass value) { - if (this.class_ == null) - this.class_ = new Enumeration(EncounterClass.ENUM_FACTORY); - this.class_.setValue(value); - return this; - } - - /** - * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #subject} (The patient present at the encounter.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.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 present at the encounter.) - */ - public Encounter 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 present at the encounter.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.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 present at the encounter.) - */ - public Encounter setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #participant} (The main practitioner responsible for providing the service.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (EncounterParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (The main practitioner responsible for providing the service.) - */ - // syntactic sugar - public EncounterParticipantComponent addParticipant() { //3 - EncounterParticipantComponent t = new EncounterParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - /** - * @return {@link #fulfills} (The appointment that scheduled this encounter.) - */ - public Reference getFulfills() { - if (this.fulfills == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.fulfills"); - else if (Configuration.doAutoCreate()) - this.fulfills = new Reference(); - return this.fulfills; - } - - public boolean hasFulfills() { - return this.fulfills != null && !this.fulfills.isEmpty(); - } - - /** - * @param value {@link #fulfills} (The appointment that scheduled this encounter.) - */ - public Encounter setFulfills(Reference value) { - this.fulfills = value; - return this; - } - - /** - * @return {@link #fulfills} 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 appointment that scheduled this encounter.) - */ - public Appointment getFulfillsTarget() { - if (this.fulfillsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.fulfills"); - else if (Configuration.doAutoCreate()) - this.fulfillsTarget = new Appointment(); - return this.fulfillsTarget; - } - - /** - * @param value {@link #fulfills} 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 appointment that scheduled this encounter.) - */ - public Encounter setFulfillsTarget(Appointment value) { - this.fulfillsTarget = value; - return this; - } - - /** - * @return {@link #period} (The start and end time of the encounter.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.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} (The start and end time of the encounter.) - */ - public Encounter setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) - */ - public Duration getLength() { - if (this.length == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.length"); - else if (Configuration.doAutoCreate()) - this.length = new Duration(); - return this.length; - } - - public boolean hasLength() { - return this.length != null && !this.length.isEmpty(); - } - - /** - * @param value {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) - */ - public Encounter setLength(Duration value) { - this.length = value; - return this; - } - - /** - * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) - */ - public Encounter setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) - */ - public Reference getIndication() { - if (this.indication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.indication"); - else if (Configuration.doAutoCreate()) - this.indication = new Reference(); - return this.indication; - } - - public boolean hasIndication() { - return this.indication != null && !this.indication.isEmpty(); - } - - /** - * @param value {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) - */ - public Encounter setIndication(Reference value) { - this.indication = value; - return this; - } - - /** - * @return {@link #indication} 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. (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) - */ - public Resource getIndicationTarget() { - return this.indicationTarget; - } - - /** - * @param value {@link #indication} 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. (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) - */ - public Encounter setIndicationTarget(Resource value) { - this.indicationTarget = value; - return this; - } - - /** - * @return {@link #priority} (Indicates the urgency of the encounter.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Indicates the urgency of the encounter.) - */ - public Encounter setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #hospitalization} (Details about an admission to a clinic.) - */ - public EncounterHospitalizationComponent getHospitalization() { - if (this.hospitalization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.hospitalization"); - else if (Configuration.doAutoCreate()) - this.hospitalization = new EncounterHospitalizationComponent(); - return this.hospitalization; - } - - public boolean hasHospitalization() { - return this.hospitalization != null && !this.hospitalization.isEmpty(); - } - - /** - * @param value {@link #hospitalization} (Details about an admission to a clinic.) - */ - public Encounter setHospitalization(EncounterHospitalizationComponent value) { - this.hospitalization = value; - return this; - } - - /** - * @return {@link #location} (List of locations at which the patient has been.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (EncounterLocationComponent item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (List of locations at which the patient has been.) - */ - // syntactic sugar - public EncounterLocationComponent addLocation() { //3 - EncounterLocationComponent t = new EncounterLocationComponent(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @return {@link #serviceProvider} (Department or team providing care.) - */ - public Reference getServiceProvider() { - if (this.serviceProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.serviceProvider"); - else if (Configuration.doAutoCreate()) - this.serviceProvider = new Reference(); - return this.serviceProvider; - } - - public boolean hasServiceProvider() { - return this.serviceProvider != null && !this.serviceProvider.isEmpty(); - } - - /** - * @param value {@link #serviceProvider} (Department or team providing care.) - */ - public Encounter setServiceProvider(Reference value) { - this.serviceProvider = value; - return this; - } - - /** - * @return {@link #serviceProvider} 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. (Department or team providing care.) - */ - public Organization getServiceProviderTarget() { - if (this.serviceProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.serviceProvider"); - else if (Configuration.doAutoCreate()) - this.serviceProviderTarget = new Organization(); - return this.serviceProviderTarget; - } - - /** - * @param value {@link #serviceProvider} 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. (Department or team providing care.) - */ - public Encounter setServiceProviderTarget(Organization value) { - this.serviceProviderTarget = value; - return this; - } - - /** - * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} 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. (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Encounter(); - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} 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. (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter setPartOfTarget(Encounter value) { - this.partOfTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "planned | in progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("class", "code", "inpatient | outpatient | ambulatory | emergency +.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient present at the encounter.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("participant", "", "The main practitioner responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("fulfills", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, fulfills)); - childrenList.add(new Property("period", "Period", "The start and end time of the encounter.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("length", "Duration", "Quantity of time the encounter lasted. This excludes the time during leaves of absence.", 0, java.lang.Integer.MAX_VALUE, length)); - childrenList.add(new Property("reason", "CodeableConcept", "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("indication", "Reference(Any)", "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("hospitalization", "", "Details about an admission to a clinic.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); - childrenList.add(new Property("location", "", "List of locations at which the patient has been.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("serviceProvider", "Reference(Organization)", "Department or team providing care.", 0, java.lang.Integer.MAX_VALUE, serviceProvider)); - childrenList.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, java.lang.Integer.MAX_VALUE, partOf)); - } - - public Encounter copy() { - Encounter dst = new Encounter(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (EncounterParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.fulfills = fulfills == null ? null : fulfills.copy(); - dst.period = period == null ? null : period.copy(); - dst.length = length == null ? null : length.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.indication = indication == null ? null : indication.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (EncounterLocationComponent i : location) - dst.location.add(i.copy()); - }; - dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy(); - dst.partOf = partOf == null ? null : partOf.copy(); - return dst; - } - - protected Encounter typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (class_ == null || class_.isEmpty()) && (type == null || type.isEmpty()) && (subject == null || subject.isEmpty()) - && (participant == null || participant.isEmpty()) && (fulfills == null || fulfills.isEmpty()) - && (period == null || period.isEmpty()) && (length == null || length.isEmpty()) && (reason == null || reason.isEmpty()) - && (indication == null || indication.isEmpty()) && (priority == null || priority.isEmpty()) - && (hospitalization == null || hospitalization.isEmpty()) && (location == null || location.isEmpty()) - && (serviceProvider == null || serviceProvider.isEmpty()) && (partOf == null || partOf.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Encounter; - } - - @SearchParamDefinition(name="patient", path="Encounter.subject", description="The patient present at the encounter", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="status", path="Encounter.status", description="planned | in progress | onleave | finished | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="Encounter.subject", description="The patient present at the encounter", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="indication", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) - public static final String SP_INDICATION = "indication"; - @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="number" ) - public static final String SP_LENGTH = "length"; - @SearchParamDefinition(name="date", path="Encounter.period", description="A date within the period the Encounter lasted", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="Identifier(s) by which this encounter is known", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="Time period during which the patient was present at the location", type="date" ) - public static final String SP_LOCATIONPERIOD = "location-period"; - -} - + +/* + 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 interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + */ +@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") +public class Encounter extends DomainResource { + + public enum EncounterState implements FhirEnum { + /** + * The Encounter has not yet started. + */ + PLANNED, + /** + * The Encounter has begun and the patient is present / the practitioner and the patient are meeting. + */ + INPROGRESS, + /** + * The Encounter has begun, but the patient is temporarily on leave. + */ + ONLEAVE, + /** + * The Encounter has ended. + */ + FINISHED, + /** + * The Encounter has ended before it has begun. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PLANNED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("onleave".equals(codeString)) + return ONLEAVE; + if ("finished".equals(codeString)) + return FINISHED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case INPROGRESS: return "in progress"; + case ONLEAVE: return "onleave"; + case FINISHED: return "finished"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case INPROGRESS: return ""; + case ONLEAVE: return ""; + case FINISHED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The Encounter has not yet started."; + case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting."; + case ONLEAVE: return "The Encounter has begun, but the patient is temporarily on leave."; + case FINISHED: return "The Encounter has ended."; + case CANCELLED: return "The Encounter has ended before it has begun."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "planned"; + case INPROGRESS: return "in progress"; + case ONLEAVE: return "onleave"; + case FINISHED: return "finished"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + } + + public static class EncounterStateEnumFactory implements EnumFactory { + public EncounterState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return EncounterState.PLANNED; + if ("in progress".equals(codeString)) + return EncounterState.INPROGRESS; + if ("onleave".equals(codeString)) + return EncounterState.ONLEAVE; + if ("finished".equals(codeString)) + return EncounterState.FINISHED; + if ("cancelled".equals(codeString)) + return EncounterState.CANCELLED; + throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); + } + public String toCode(EncounterState code) throws IllegalArgumentException { + if (code == EncounterState.PLANNED) + return "planned"; + if (code == EncounterState.INPROGRESS) + return "in progress"; + if (code == EncounterState.ONLEAVE) + return "onleave"; + if (code == EncounterState.FINISHED) + return "finished"; + if (code == EncounterState.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum EncounterClass implements FhirEnum { + /** + * An encounter during which the patient is hospitalized and stays overnight. + */ + INPATIENT, + /** + * An encounter during which the patient is not hospitalized overnight. + */ + OUTPATIENT, + /** + * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit. + */ + AMBULATORY, + /** + * An encounter where the patient needs urgent care. + */ + EMERGENCY, + /** + * An encounter where the practitioner visits the patient at his/her home. + */ + HOME, + /** + * An encounter taking place outside the regular environment for giving care. + */ + FIELD, + /** + * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight. + */ + DAYTIME, + /** + * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact. + */ + VIRTUAL, + /** + * added to help the parsers + */ + NULL; + + 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)) + return INPATIENT; + if ("outpatient".equals(codeString)) + return OUTPATIENT; + if ("ambulatory".equals(codeString)) + return AMBULATORY; + if ("emergency".equals(codeString)) + return EMERGENCY; + if ("home".equals(codeString)) + return HOME; + if ("field".equals(codeString)) + return FIELD; + if ("daytime".equals(codeString)) + return DAYTIME; + if ("virtual".equals(codeString)) + return VIRTUAL; + throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPATIENT: return "inpatient"; + case OUTPATIENT: return "outpatient"; + case AMBULATORY: return "ambulatory"; + case EMERGENCY: return "emergency"; + case HOME: return "home"; + case FIELD: return "field"; + case DAYTIME: return "daytime"; + case VIRTUAL: return "virtual"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPATIENT: return ""; + case OUTPATIENT: return ""; + case AMBULATORY: return ""; + case EMERGENCY: return ""; + case HOME: return ""; + case FIELD: return ""; + case DAYTIME: return ""; + case VIRTUAL: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight."; + case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight."; + case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit."; + case EMERGENCY: return "An encounter where the patient needs urgent care."; + case HOME: return "An encounter where the practitioner visits the patient at his/her home."; + case FIELD: return "An encounter taking place outside the regular environment for giving care."; + case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight."; + case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPATIENT: return "inpatient"; + case OUTPATIENT: return "outpatient"; + case AMBULATORY: return "ambulatory"; + case EMERGENCY: return "emergency"; + case HOME: return "home"; + case FIELD: return "field"; + case DAYTIME: return "daytime"; + case VIRTUAL: return "virtual"; + default: return "?"; + } + } + } + + public static class EncounterClassEnumFactory implements EnumFactory { + public EncounterClass fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("inpatient".equals(codeString)) + return EncounterClass.INPATIENT; + if ("outpatient".equals(codeString)) + return EncounterClass.OUTPATIENT; + if ("ambulatory".equals(codeString)) + return EncounterClass.AMBULATORY; + if ("emergency".equals(codeString)) + return EncounterClass.EMERGENCY; + if ("home".equals(codeString)) + return EncounterClass.HOME; + if ("field".equals(codeString)) + return EncounterClass.FIELD; + if ("daytime".equals(codeString)) + return EncounterClass.DAYTIME; + if ("virtual".equals(codeString)) + return EncounterClass.VIRTUAL; + throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); + } + public String toCode(EncounterClass code) throws IllegalArgumentException { + if (code == EncounterClass.INPATIENT) + return "inpatient"; + if (code == EncounterClass.OUTPATIENT) + return "outpatient"; + if (code == EncounterClass.AMBULATORY) + return "ambulatory"; + if (code == EncounterClass.EMERGENCY) + return "emergency"; + if (code == EncounterClass.HOME) + return "home"; + if (code == EncounterClass.FIELD) + return "field"; + if (code == EncounterClass.DAYTIME) + return "daytime"; + if (code == EncounterClass.VIRTUAL) + return "virtual"; + return "?"; + } + } + + @Block() + public static class EncounterParticipantComponent extends BackboneElement { + /** + * Role of participant in encounter. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." ) + protected List type; + + /** + * Persons involved in the encounter other than the patient. + */ + @Child(name="individual", type={Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="Persons involved in the encounter other than the patient", formalDefinition="Persons involved in the encounter other than the patient." ) + protected Reference individual; + + /** + * The actual object that is the target of the reference (Persons involved in the encounter other than the patient.) + */ + protected Resource individualTarget; + + private static final long serialVersionUID = 129909055L; + + public EncounterParticipantComponent() { + super(); + } + + /** + * @return {@link #type} (Role of participant in encounter.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Role of participant in encounter.) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #individual} (Persons involved in the encounter other than the patient.) + */ + public Reference getIndividual() { + if (this.individual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterParticipantComponent.individual"); + else if (Configuration.doAutoCreate()) + this.individual = new Reference(); + return this.individual; + } + + public boolean hasIndividual() { + return this.individual != null && !this.individual.isEmpty(); + } + + /** + * @param value {@link #individual} (Persons involved in the encounter other than the patient.) + */ + public EncounterParticipantComponent setIndividual(Reference value) { + this.individual = value; + return this; + } + + /** + * @return {@link #individual} 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. (Persons involved in the encounter other than the patient.) + */ + public Resource getIndividualTarget() { + return this.individualTarget; + } + + /** + * @param value {@link #individual} 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. (Persons involved in the encounter other than the patient.) + */ + public EncounterParticipantComponent setIndividualTarget(Resource value) { + this.individualTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("individual", "Reference(Practitioner|RelatedPerson)", "Persons involved in the encounter other than the patient.", 0, java.lang.Integer.MAX_VALUE, individual)); + } + + public EncounterParticipantComponent copy() { + EncounterParticipantComponent dst = new EncounterParticipantComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.individual = individual == null ? null : individual.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (individual == null || individual.isEmpty()) + ; + } + + } + + @Block() + public static class EncounterHospitalizationComponent extends BackboneElement { + /** + * Pre-admission identifier. + */ + @Child(name="preAdmissionIdentifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." ) + protected Identifier preAdmissionIdentifier; + + /** + * The location from which the patient came before admission. + */ + @Child(name="origin", type={Location.class}, order=2, min=0, max=1) + @Description(shortDefinition="The location from which the patient came before admission", formalDefinition="The location from which the patient came before admission." ) + protected Reference origin; + + /** + * The actual object that is the target of the reference (The location from which the patient came before admission.) + */ + protected Location originTarget; + + /** + * From where patient was admitted (physician referral, transfer). + */ + @Child(name="admitSource", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." ) + protected CodeableConcept admitSource; + + /** + * Period during which the patient was admitted. + */ + @Child(name="period", type={Period.class}, order=4, min=0, max=1) + @Description(shortDefinition="Period during which the patient was admitted", formalDefinition="Period during which the patient was admitted." ) + protected Period period; + + /** + * Where the patient stays during this encounter. + */ + @Child(name="accomodation", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Where the patient stays during this encounter", formalDefinition="Where the patient stays during this encounter." ) + protected List accomodation; + + /** + * Dietary restrictions for the patient. + */ + @Child(name="diet", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Dietary restrictions for the patient", formalDefinition="Dietary restrictions for the patient." ) + protected CodeableConcept diet; + + /** + * Special courtesies (VIP, board member). + */ + @Child(name="specialCourtesy", type={CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies (VIP, board member)." ) + protected List specialCourtesy; + + /** + * Wheelchair, translator, stretcher, etc. + */ + @Child(name="specialArrangement", type={CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Wheelchair, translator, stretcher, etc", formalDefinition="Wheelchair, translator, stretcher, etc." ) + protected List specialArrangement; + + /** + * Location to which the patient is discharged. + */ + @Child(name="destination", type={Location.class}, order=9, min=0, max=1) + @Description(shortDefinition="Location to which the patient is discharged", formalDefinition="Location to which the patient is discharged." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Location to which the patient is discharged.) + */ + protected Location destinationTarget; + + /** + * Category or kind of location after discharge. + */ + @Child(name="dischargeDisposition", type={CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." ) + protected CodeableConcept dischargeDisposition; + + /** + * The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. + */ + @Child(name="dischargeDiagnosis", type={}, order=11, min=0, max=1) + @Description(shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", formalDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." ) + protected Reference dischargeDiagnosis; + + /** + * The actual object that is the target of the reference (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + protected Resource dischargeDiagnosisTarget; + + /** + * Whether this hospitalization is a readmission. + */ + @Child(name="reAdmission", type={BooleanType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Is this hospitalization a readmission?", formalDefinition="Whether this hospitalization is a readmission." ) + protected BooleanType reAdmission; + + private static final long serialVersionUID = 221977130L; + + public EncounterHospitalizationComponent() { + super(); + } + + /** + * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.) + */ + public Identifier getPreAdmissionIdentifier() { + if (this.preAdmissionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.preAdmissionIdentifier"); + else if (Configuration.doAutoCreate()) + this.preAdmissionIdentifier = new Identifier(); + return this.preAdmissionIdentifier; + } + + public boolean hasPreAdmissionIdentifier() { + return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty(); + } + + /** + * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.) + */ + public EncounterHospitalizationComponent setPreAdmissionIdentifier(Identifier value) { + this.preAdmissionIdentifier = value; + return this; + } + + /** + * @return {@link #origin} (The location from which the patient came before admission.) + */ + public Reference getOrigin() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new Reference(); + return this.origin; + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The location from which the patient came before admission.) + */ + public EncounterHospitalizationComponent setOrigin(Reference value) { + this.origin = value; + return this; + } + + /** + * @return {@link #origin} 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 location from which the patient came before admission.) + */ + public Location getOriginTarget() { + if (this.originTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); + else if (Configuration.doAutoCreate()) + this.originTarget = new Location(); + return this.originTarget; + } + + /** + * @param value {@link #origin} 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 location from which the patient came before admission.) + */ + public EncounterHospitalizationComponent setOriginTarget(Location value) { + this.originTarget = value; + return this; + } + + /** + * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).) + */ + public CodeableConcept getAdmitSource() { + if (this.admitSource == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.admitSource"); + else if (Configuration.doAutoCreate()) + this.admitSource = new CodeableConcept(); + return this.admitSource; + } + + public boolean hasAdmitSource() { + return this.admitSource != null && !this.admitSource.isEmpty(); + } + + /** + * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).) + */ + public EncounterHospitalizationComponent setAdmitSource(CodeableConcept value) { + this.admitSource = value; + return this; + } + + /** + * @return {@link #period} (Period during which the patient was admitted.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.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} (Period during which the patient was admitted.) + */ + public EncounterHospitalizationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #accomodation} (Where the patient stays during this encounter.) + */ + public List getAccomodation() { + if (this.accomodation == null) + this.accomodation = new ArrayList(); + return this.accomodation; + } + + public boolean hasAccomodation() { + if (this.accomodation == null) + return false; + for (EncounterHospitalizationAccomodationComponent item : this.accomodation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #accomodation} (Where the patient stays during this encounter.) + */ + // syntactic sugar + public EncounterHospitalizationAccomodationComponent addAccomodation() { //3 + EncounterHospitalizationAccomodationComponent t = new EncounterHospitalizationAccomodationComponent(); + if (this.accomodation == null) + this.accomodation = new ArrayList(); + this.accomodation.add(t); + return t; + } + + /** + * @return {@link #diet} (Dietary restrictions for the patient.) + */ + public CodeableConcept getDiet() { + if (this.diet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.diet"); + else if (Configuration.doAutoCreate()) + this.diet = new CodeableConcept(); + return this.diet; + } + + public boolean hasDiet() { + return this.diet != null && !this.diet.isEmpty(); + } + + /** + * @param value {@link #diet} (Dietary restrictions for the patient.) + */ + public EncounterHospitalizationComponent setDiet(CodeableConcept value) { + this.diet = value; + return this; + } + + /** + * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) + */ + public List getSpecialCourtesy() { + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + return this.specialCourtesy; + } + + public boolean hasSpecialCourtesy() { + if (this.specialCourtesy == null) + return false; + for (CodeableConcept item : this.specialCourtesy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) + */ + // syntactic sugar + public CodeableConcept addSpecialCourtesy() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialCourtesy == null) + this.specialCourtesy = new ArrayList(); + this.specialCourtesy.add(t); + return t; + } + + /** + * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) + */ + public List getSpecialArrangement() { + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + return this.specialArrangement; + } + + public boolean hasSpecialArrangement() { + if (this.specialArrangement == null) + return false; + for (CodeableConcept item : this.specialArrangement) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) + */ + // syntactic sugar + public CodeableConcept addSpecialArrangement() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialArrangement == null) + this.specialArrangement = new ArrayList(); + this.specialArrangement.add(t); + return t; + } + + /** + * @return {@link #destination} (Location to which the patient is discharged.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Location to which the patient is discharged.) + */ + public EncounterHospitalizationComponent setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} 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. (Location to which the patient is discharged.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); + return this.destinationTarget; + } + + /** + * @param value {@link #destination} 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. (Location to which the patient is discharged.) + */ + public EncounterHospitalizationComponent setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #dischargeDisposition} (Category or kind of location after discharge.) + */ + public CodeableConcept getDischargeDisposition() { + if (this.dischargeDisposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDisposition"); + else if (Configuration.doAutoCreate()) + this.dischargeDisposition = new CodeableConcept(); + return this.dischargeDisposition; + } + + public boolean hasDischargeDisposition() { + return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty(); + } + + /** + * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.) + */ + public EncounterHospitalizationComponent setDischargeDisposition(CodeableConcept value) { + this.dischargeDisposition = value; + return this; + } + + /** + * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public Reference getDischargeDiagnosis() { + if (this.dischargeDiagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDiagnosis"); + else if (Configuration.doAutoCreate()) + this.dischargeDiagnosis = new Reference(); + return this.dischargeDiagnosis; + } + + public boolean hasDischargeDiagnosis() { + return this.dischargeDiagnosis != null && !this.dischargeDiagnosis.isEmpty(); + } + + /** + * @param value {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public EncounterHospitalizationComponent setDischargeDiagnosis(Reference value) { + this.dischargeDiagnosis = value; + return this; + } + + /** + * @return {@link #dischargeDiagnosis} 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public Resource getDischargeDiagnosisTarget() { + return this.dischargeDiagnosisTarget; + } + + /** + * @param value {@link #dischargeDiagnosis} 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 final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) + */ + public EncounterHospitalizationComponent setDischargeDiagnosisTarget(Resource value) { + this.dischargeDiagnosisTarget = value; + return this; + } + + /** + * @return {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value + */ + public BooleanType getReAdmissionElement() { + if (this.reAdmission == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationComponent.reAdmission"); + else if (Configuration.doAutoCreate()) + this.reAdmission = new BooleanType(); + return this.reAdmission; + } + + public boolean hasReAdmissionElement() { + return this.reAdmission != null && !this.reAdmission.isEmpty(); + } + + public boolean hasReAdmission() { + return this.reAdmission != null && !this.reAdmission.isEmpty(); + } + + /** + * @param value {@link #reAdmission} (Whether this hospitalization is a readmission.). This is the underlying object with id, value and extensions. The accessor "getReAdmission" gives direct access to the value + */ + public EncounterHospitalizationComponent setReAdmissionElement(BooleanType value) { + this.reAdmission = value; + return this; + } + + /** + * @return Whether this hospitalization is a readmission. + */ + public boolean getReAdmission() { + return this.reAdmission == null ? false : this.reAdmission.getValue(); + } + + /** + * @param value Whether this hospitalization is a readmission. + */ + public EncounterHospitalizationComponent setReAdmission(boolean value) { + if (value == false) + this.reAdmission = null; + else { + if (this.reAdmission == null) + this.reAdmission = new BooleanType(); + this.reAdmission.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, java.lang.Integer.MAX_VALUE, preAdmissionIdentifier)); + childrenList.add(new Property("origin", "Reference(Location)", "The location from which the patient came before admission.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, java.lang.Integer.MAX_VALUE, admitSource)); + childrenList.add(new Property("period", "Period", "Period during which the patient was admitted.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("accomodation", "", "Where the patient stays during this encounter.", 0, java.lang.Integer.MAX_VALUE, accomodation)); + childrenList.add(new Property("diet", "CodeableConcept", "Dietary restrictions for the patient.", 0, java.lang.Integer.MAX_VALUE, diet)); + childrenList.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies (VIP, board member).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy)); + childrenList.add(new Property("specialArrangement", "CodeableConcept", "Wheelchair, translator, stretcher, etc.", 0, java.lang.Integer.MAX_VALUE, specialArrangement)); + childrenList.add(new Property("destination", "Reference(Location)", "Location to which the patient is discharged.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, java.lang.Integer.MAX_VALUE, dischargeDisposition)); + childrenList.add(new Property("dischargeDiagnosis", "Reference(Any)", "The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.", 0, java.lang.Integer.MAX_VALUE, dischargeDiagnosis)); + childrenList.add(new Property("reAdmission", "boolean", "Whether this hospitalization is a readmission.", 0, java.lang.Integer.MAX_VALUE, reAdmission)); + } + + public EncounterHospitalizationComponent copy() { + EncounterHospitalizationComponent dst = new EncounterHospitalizationComponent(); + copyValues(dst); + dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy(); + dst.origin = origin == null ? null : origin.copy(); + dst.admitSource = admitSource == null ? null : admitSource.copy(); + dst.period = period == null ? null : period.copy(); + if (accomodation != null) { + dst.accomodation = new ArrayList(); + for (EncounterHospitalizationAccomodationComponent i : accomodation) + dst.accomodation.add(i.copy()); + }; + dst.diet = diet == null ? null : diet.copy(); + if (specialCourtesy != null) { + dst.specialCourtesy = new ArrayList(); + for (CodeableConcept i : specialCourtesy) + dst.specialCourtesy.add(i.copy()); + }; + if (specialArrangement != null) { + dst.specialArrangement = new ArrayList(); + for (CodeableConcept i : specialArrangement) + dst.specialArrangement.add(i.copy()); + }; + dst.destination = destination == null ? null : destination.copy(); + dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy(); + dst.dischargeDiagnosis = dischargeDiagnosis == null ? null : dischargeDiagnosis.copy(); + dst.reAdmission = reAdmission == null ? null : reAdmission.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (preAdmissionIdentifier == null || preAdmissionIdentifier.isEmpty()) + && (origin == null || origin.isEmpty()) && (admitSource == null || admitSource.isEmpty()) + && (period == null || period.isEmpty()) && (accomodation == null || accomodation.isEmpty()) + && (diet == null || diet.isEmpty()) && (specialCourtesy == null || specialCourtesy.isEmpty()) + && (specialArrangement == null || specialArrangement.isEmpty()) && (destination == null || destination.isEmpty()) + && (dischargeDisposition == null || dischargeDisposition.isEmpty()) && (dischargeDiagnosis == null || dischargeDiagnosis.isEmpty()) + && (reAdmission == null || reAdmission.isEmpty()); + } + + } + + @Block() + public static class EncounterHospitalizationAccomodationComponent extends BackboneElement { + /** + * The bed that is assigned to the patient. + */ + @Child(name="bed", type={Location.class}, order=1, min=0, max=1) + @Description(shortDefinition="The bed that is assigned to the patient", formalDefinition="The bed that is assigned to the patient." ) + protected Reference bed; + + /** + * The actual object that is the target of the reference (The bed that is assigned to the patient.) + */ + protected Location bedTarget; + + /** + * Period during which the patient was assigned the bed. + */ + @Child(name="period", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Period during which the patient was assigned the bed", formalDefinition="Period during which the patient was assigned the bed." ) + protected Period period; + + private static final long serialVersionUID = 1058938507L; + + public EncounterHospitalizationAccomodationComponent() { + super(); + } + + /** + * @return {@link #bed} (The bed that is assigned to the patient.) + */ + public Reference getBed() { + if (this.bed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationAccomodationComponent.bed"); + else if (Configuration.doAutoCreate()) + this.bed = new Reference(); + return this.bed; + } + + public boolean hasBed() { + return this.bed != null && !this.bed.isEmpty(); + } + + /** + * @param value {@link #bed} (The bed that is assigned to the patient.) + */ + public EncounterHospitalizationAccomodationComponent setBed(Reference value) { + this.bed = value; + return this; + } + + /** + * @return {@link #bed} 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 bed that is assigned to the patient.) + */ + public Location getBedTarget() { + if (this.bedTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationAccomodationComponent.bed"); + else if (Configuration.doAutoCreate()) + this.bedTarget = new Location(); + return this.bedTarget; + } + + /** + * @param value {@link #bed} 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 bed that is assigned to the patient.) + */ + public EncounterHospitalizationAccomodationComponent setBedTarget(Location value) { + this.bedTarget = value; + return this; + } + + /** + * @return {@link #period} (Period during which the patient was assigned the bed.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterHospitalizationAccomodationComponent.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} (Period during which the patient was assigned the bed.) + */ + public EncounterHospitalizationAccomodationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("bed", "Reference(Location)", "The bed that is assigned to the patient.", 0, java.lang.Integer.MAX_VALUE, bed)); + childrenList.add(new Property("period", "Period", "Period during which the patient was assigned the bed.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public EncounterHospitalizationAccomodationComponent copy() { + EncounterHospitalizationAccomodationComponent dst = new EncounterHospitalizationAccomodationComponent(); + copyValues(dst); + dst.bed = bed == null ? null : bed.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (bed == null || bed.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + } + + @Block() + public static class EncounterLocationComponent extends BackboneElement { + /** + * The location where the encounter takes place. + */ + @Child(name="location", type={Location.class}, order=1, min=1, max=1) + @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where the encounter takes place.) + */ + protected Location locationTarget; + + /** + * Time period during which the patient was present at the location. + */ + @Child(name="period", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." ) + protected Period period; + + private static final long serialVersionUID = 1137166303L; + + public EncounterLocationComponent() { + super(); + } + + public EncounterLocationComponent(Reference location) { + super(); + this.location = location; + } + + /** + * @return {@link #location} (The location where the encounter takes place.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where the encounter takes place.) + */ + public EncounterLocationComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 location where the encounter takes place.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 location where the encounter takes place.) + */ + public EncounterLocationComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #period} (Time period during which the patient was present at the location.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EncounterLocationComponent.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} (Time period during which the patient was present at the location.) + */ + public EncounterLocationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public EncounterLocationComponent copy() { + EncounterLocationComponent dst = new EncounterLocationComponent(); + copyValues(dst); + dst.location = location == null ? null : location.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (location == null || location.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + } + + /** + * Identifier(s) by which this encounter is known. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." ) + protected List identifier; + + /** + * planned | in progress | onleave | finished | cancelled. + */ + @Child(name="status", type={CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="planned | in progress | onleave | finished | cancelled", formalDefinition="planned | in progress | onleave | finished | cancelled." ) + protected Enumeration status; + + /** + * inpatient | outpatient | ambulatory | emergency +. + */ + @Child(name="class_", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="inpatient | outpatient | ambulatory | emergency +", formalDefinition="inpatient | outpatient | ambulatory | emergency +." ) + protected Enumeration class_; + + /** + * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). + */ + @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific type of encounter", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." ) + protected List type; + + /** + * The patient present at the encounter. + */ + @Child(name="subject", type={Patient.class}, order=3, min=0, max=1) + @Description(shortDefinition="The patient present at the encounter", formalDefinition="The patient present at the encounter." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient present at the encounter.) + */ + protected Patient subjectTarget; + + /** + * The main practitioner responsible for providing the service. + */ + @Child(name="participant", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The main practitioner responsible for providing the service." ) + protected List participant; + + /** + * The appointment that scheduled this encounter. + */ + @Child(name="fulfills", type={Appointment.class}, order=5, min=0, max=1) + @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." ) + protected Reference fulfills; + + /** + * The actual object that is the target of the reference (The appointment that scheduled this encounter.) + */ + protected Appointment fulfillsTarget; + + /** + * The start and end time of the encounter. + */ + @Child(name="period", type={Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="The start and end time of the encounter", formalDefinition="The start and end time of the encounter." ) + protected Period period; + + /** + * Quantity of time the encounter lasted. This excludes the time during leaves of absence. + */ + @Child(name="length", type={Duration.class}, order=7, min=0, max=1) + @Description(shortDefinition="Quantity of time the encounter lasted", formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." ) + protected Duration length; + + /** + * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. + */ + @Child(name="reason", type={CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Reason the encounter takes place (code)", formalDefinition="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis." ) + protected CodeableConcept reason; + + /** + * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. + */ + @Child(name="indication", type={}, order=9, min=0, max=1) + @Description(shortDefinition="Reason the encounter takes place (resource)", formalDefinition="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis." ) + protected Reference indication; + + /** + * The actual object that is the target of the reference (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) + */ + protected Resource indicationTarget; + + /** + * Indicates the urgency of the encounter. + */ + @Child(name="priority", type={CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." ) + protected CodeableConcept priority; + + /** + * Details about an admission to a clinic. + */ + @Child(name="hospitalization", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Details about an admission to a clinic", formalDefinition="Details about an admission to a clinic." ) + protected EncounterHospitalizationComponent hospitalization; + + /** + * List of locations at which the patient has been. + */ + @Child(name="location", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of locations the patient has been at", formalDefinition="List of locations at which the patient has been." ) + protected List location; + + /** + * Department or team providing care. + */ + @Child(name="serviceProvider", type={Organization.class}, order=13, min=0, max=1) + @Description(shortDefinition="Department or team providing care", formalDefinition="Department or team providing care." ) + protected Reference serviceProvider; + + /** + * The actual object that is the target of the reference (Department or team providing care.) + */ + protected Organization serviceProviderTarget; + + /** + * Another Encounter of which this encounter is a part of (administratively or in time). + */ + @Child(name="partOf", type={Encounter.class}, order=14, min=0, max=1) + @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + protected Encounter partOfTarget; + + private static final long serialVersionUID = 1294341693L; + + public Encounter() { + super(); + } + + public Encounter(Enumeration status, Enumeration class_) { + super(); + this.status = status; + this.class_ = class_; + } + + /** + * @return {@link #identifier} (Identifier(s) by which this encounter is known.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier(s) by which this encounter is known.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #status} (planned | in progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (planned | in progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Encounter setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return planned | in progress | onleave | finished | cancelled. + */ + public EncounterState getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value planned | in progress | onleave | finished | cancelled. + */ + public Encounter setStatus(EncounterState value) { + if (this.status == null) + this.status = new Enumeration(EncounterState.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public Enumeration getClass_Element() { + if (this.class_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.class_"); + else if (Configuration.doAutoCreate()) + this.class_ = new Enumeration(); + return this.class_; + } + + public boolean hasClass_Element() { + return this.class_ != null && !this.class_.isEmpty(); + } + + public boolean hasClass_() { + return this.class_ != null && !this.class_.isEmpty(); + } + + /** + * @param value {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value + */ + public Encounter setClass_Element(Enumeration value) { + this.class_ = value; + return this; + } + + /** + * @return inpatient | outpatient | ambulatory | emergency +. + */ + public EncounterClass getClass_() { + return this.class_ == null ? null : this.class_.getValue(); + } + + /** + * @param value inpatient | outpatient | ambulatory | emergency +. + */ + public Encounter setClass_(EncounterClass value) { + if (this.class_ == null) + this.class_ = new Enumeration(EncounterClass.ENUM_FACTORY); + this.class_.setValue(value); + return this; + } + + /** + * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #subject} (The patient present at the encounter.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.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 present at the encounter.) + */ + public Encounter 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 present at the encounter.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.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 present at the encounter.) + */ + public Encounter setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #participant} (The main practitioner responsible for providing the service.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (EncounterParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (The main practitioner responsible for providing the service.) + */ + // syntactic sugar + public EncounterParticipantComponent addParticipant() { //3 + EncounterParticipantComponent t = new EncounterParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + /** + * @return {@link #fulfills} (The appointment that scheduled this encounter.) + */ + public Reference getFulfills() { + if (this.fulfills == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.fulfills"); + else if (Configuration.doAutoCreate()) + this.fulfills = new Reference(); + return this.fulfills; + } + + public boolean hasFulfills() { + return this.fulfills != null && !this.fulfills.isEmpty(); + } + + /** + * @param value {@link #fulfills} (The appointment that scheduled this encounter.) + */ + public Encounter setFulfills(Reference value) { + this.fulfills = value; + return this; + } + + /** + * @return {@link #fulfills} 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 appointment that scheduled this encounter.) + */ + public Appointment getFulfillsTarget() { + if (this.fulfillsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.fulfills"); + else if (Configuration.doAutoCreate()) + this.fulfillsTarget = new Appointment(); + return this.fulfillsTarget; + } + + /** + * @param value {@link #fulfills} 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 appointment that scheduled this encounter.) + */ + public Encounter setFulfillsTarget(Appointment value) { + this.fulfillsTarget = value; + return this; + } + + /** + * @return {@link #period} (The start and end time of the encounter.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.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} (The start and end time of the encounter.) + */ + public Encounter setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) + */ + public Duration getLength() { + if (this.length == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.length"); + else if (Configuration.doAutoCreate()) + this.length = new Duration(); + return this.length; + } + + public boolean hasLength() { + return this.length != null && !this.length.isEmpty(); + } + + /** + * @param value {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) + */ + public Encounter setLength(Duration value) { + this.length = value; + return this; + } + + /** + * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) + */ + public Encounter setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) + */ + public Reference getIndication() { + if (this.indication == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.indication"); + else if (Configuration.doAutoCreate()) + this.indication = new Reference(); + return this.indication; + } + + public boolean hasIndication() { + return this.indication != null && !this.indication.isEmpty(); + } + + /** + * @param value {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) + */ + public Encounter setIndication(Reference value) { + this.indication = value; + return this; + } + + /** + * @return {@link #indication} 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. (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) + */ + public Resource getIndicationTarget() { + return this.indicationTarget; + } + + /** + * @param value {@link #indication} 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. (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.) + */ + public Encounter setIndicationTarget(Resource value) { + this.indicationTarget = value; + return this; + } + + /** + * @return {@link #priority} (Indicates the urgency of the encounter.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Indicates the urgency of the encounter.) + */ + public Encounter setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #hospitalization} (Details about an admission to a clinic.) + */ + public EncounterHospitalizationComponent getHospitalization() { + if (this.hospitalization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.hospitalization"); + else if (Configuration.doAutoCreate()) + this.hospitalization = new EncounterHospitalizationComponent(); + return this.hospitalization; + } + + public boolean hasHospitalization() { + return this.hospitalization != null && !this.hospitalization.isEmpty(); + } + + /** + * @param value {@link #hospitalization} (Details about an admission to a clinic.) + */ + public Encounter setHospitalization(EncounterHospitalizationComponent value) { + this.hospitalization = value; + return this; + } + + /** + * @return {@link #location} (List of locations at which the patient has been.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (EncounterLocationComponent item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (List of locations at which the patient has been.) + */ + // syntactic sugar + public EncounterLocationComponent addLocation() { //3 + EncounterLocationComponent t = new EncounterLocationComponent(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @return {@link #serviceProvider} (Department or team providing care.) + */ + public Reference getServiceProvider() { + if (this.serviceProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.serviceProvider"); + else if (Configuration.doAutoCreate()) + this.serviceProvider = new Reference(); + return this.serviceProvider; + } + + public boolean hasServiceProvider() { + return this.serviceProvider != null && !this.serviceProvider.isEmpty(); + } + + /** + * @param value {@link #serviceProvider} (Department or team providing care.) + */ + public Encounter setServiceProvider(Reference value) { + this.serviceProvider = value; + return this; + } + + /** + * @return {@link #serviceProvider} 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. (Department or team providing care.) + */ + public Organization getServiceProviderTarget() { + if (this.serviceProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.serviceProvider"); + else if (Configuration.doAutoCreate()) + this.serviceProviderTarget = new Organization(); + return this.serviceProviderTarget; + } + + /** + * @param value {@link #serviceProvider} 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. (Department or team providing care.) + */ + public Encounter setServiceProviderTarget(Organization value) { + this.serviceProviderTarget = value; + return this; + } + + /** + * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} 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. (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Encounter.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Encounter(); + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} 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. (Another Encounter of which this encounter is a part of (administratively or in time).) + */ + public Encounter setPartOfTarget(Encounter value) { + this.partOfTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "planned | in progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("class", "code", "inpatient | outpatient | ambulatory | emergency +.", 0, java.lang.Integer.MAX_VALUE, class_)); + childrenList.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient present at the encounter.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("participant", "", "The main practitioner responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("fulfills", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, fulfills)); + childrenList.add(new Property("period", "Period", "The start and end time of the encounter.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("length", "Duration", "Quantity of time the encounter lasted. This excludes the time during leaves of absence.", 0, java.lang.Integer.MAX_VALUE, length)); + childrenList.add(new Property("reason", "CodeableConcept", "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("indication", "Reference(Any)", "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("hospitalization", "", "Details about an admission to a clinic.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); + childrenList.add(new Property("location", "", "List of locations at which the patient has been.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("serviceProvider", "Reference(Organization)", "Department or team providing care.", 0, java.lang.Integer.MAX_VALUE, serviceProvider)); + childrenList.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, java.lang.Integer.MAX_VALUE, partOf)); + } + + public Encounter copy() { + Encounter dst = new Encounter(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.class_ = class_ == null ? null : class_.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (EncounterParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.fulfills = fulfills == null ? null : fulfills.copy(); + dst.period = period == null ? null : period.copy(); + dst.length = length == null ? null : length.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.indication = indication == null ? null : indication.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (EncounterLocationComponent i : location) + dst.location.add(i.copy()); + }; + dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy(); + dst.partOf = partOf == null ? null : partOf.copy(); + return dst; + } + + protected Encounter typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (class_ == null || class_.isEmpty()) && (type == null || type.isEmpty()) && (subject == null || subject.isEmpty()) + && (participant == null || participant.isEmpty()) && (fulfills == null || fulfills.isEmpty()) + && (period == null || period.isEmpty()) && (length == null || length.isEmpty()) && (reason == null || reason.isEmpty()) + && (indication == null || indication.isEmpty()) && (priority == null || priority.isEmpty()) + && (hospitalization == null || hospitalization.isEmpty()) && (location == null || location.isEmpty()) + && (serviceProvider == null || serviceProvider.isEmpty()) && (partOf == null || partOf.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Encounter; + } + + @SearchParamDefinition(name="patient", path="Encounter.subject", description="The patient present at the encounter", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="status", path="Encounter.status", description="planned | in progress | onleave | finished | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="Encounter.subject", description="The patient present at the encounter", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="indication", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) + public static final String SP_INDICATION = "indication"; + @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="number" ) + public static final String SP_LENGTH = "length"; + @SearchParamDefinition(name="date", path="Encounter.period", description="A date within the period the Encounter lasted", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="Identifier(s) by which this encounter is known", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="Time period during which the patient was present at the location", type="date" ) + public static final String SP_LOCATIONPERIOD = "location-period"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java index c64e641e84d..4b8e3c14dae 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java @@ -20,587 +20,587 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. - */ -@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") -public class EnrollmentRequest extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Patient Resource. - */ - @Child(name="subject", type={Patient.class}, order=6, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient subjectTarget; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=7, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=8, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - private static final long serialVersionUID = -1656505325L; - - public EnrollmentRequest() { - super(); - } - - public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { - super(); - this.subject = subject; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EnrollmentRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EnrollmentRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 EnrollmentRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public EnrollmentRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public EnrollmentRequest setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 EnrollmentRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 EnrollmentRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 EnrollmentRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #subject} (Patient Resource.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.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} (Patient Resource.) - */ - public EnrollmentRequest 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. (Patient Resource.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.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. (Patient Resource.) - */ - public EnrollmentRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public EnrollmentRequest setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 EnrollmentRequest setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public EnrollmentRequest setRelationship(Coding value) { - this.relationship = value; - return this; - } - - protected void listChildren(List 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("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("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)); - childrenList.add(new Property("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - } - - public EnrollmentRequest copy() { - EnrollmentRequest dst = new EnrollmentRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.subject = subject == null ? null : subject.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - return dst; - } - - protected EnrollmentRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EnrollmentRequest; - } - - @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="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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.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; +/** + * This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. + */ +@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") +public class EnrollmentRequest extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Patient Resource. + */ + @Child(name="subject", type={Patient.class}, order=6, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient subjectTarget; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=7, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=8, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + private static final long serialVersionUID = -1656505325L; + + public EnrollmentRequest() { + super(); + } + + public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { + super(); + this.subject = subject; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EnrollmentRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EnrollmentRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 EnrollmentRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public EnrollmentRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public EnrollmentRequest setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 EnrollmentRequest setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 EnrollmentRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentRequest setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 EnrollmentRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #subject} (Patient Resource.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.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} (Patient Resource.) + */ + public EnrollmentRequest 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. (Patient Resource.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.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. (Patient Resource.) + */ + public EnrollmentRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public EnrollmentRequest setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 EnrollmentRequest setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentRequest.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public EnrollmentRequest setRelationship(Coding value) { + this.relationship = value; + return this; + } + + protected void listChildren(List 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("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("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)); + childrenList.add(new Property("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + } + + public EnrollmentRequest copy() { + EnrollmentRequest dst = new EnrollmentRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.subject = subject == null ? null : subject.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + return dst; + } + + protected EnrollmentRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EnrollmentRequest; + } + + @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="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java index 80d9a9546ed..008ba652b18 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java @@ -20,679 +20,679 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides Enrollment and plan details from the processing of an Enrollment resource. - */ -@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") -public class EnrollmentResponse extends DomainResource { - - public enum RSLink implements FhirEnum { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) throws IllegalArgumentException { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @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 EnrollmentRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = -318929031L; - - public EnrollmentResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public EnrollmentResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 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 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(EnrollmentRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EnrollmentResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EnrollmentResponse setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(RSLink.ENUM_FACTORY); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EnrollmentResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EnrollmentResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 EnrollmentResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EnrollmentResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EnrollmentResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Insurer who produced this adjudicated response.) - */ - public EnrollmentResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} 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 EnrollmentResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} 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 EnrollmentResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List 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(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("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)); - } - - public EnrollmentResponse copy() { - EnrollmentResponse dst = new EnrollmentResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - return dst; - } - - protected EnrollmentResponse typedCopy() { - return copy(); - } - - public boolean isEmpty() { - 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()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EnrollmentResponse; - } - - @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides Enrollment and plan details from the processing of an Enrollment resource. + */ +@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") +public class EnrollmentResponse extends DomainResource { + + public enum RSLink implements FhirEnum { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) throws IllegalArgumentException { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @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 EnrollmentRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = -318929031L; + + public EnrollmentResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public EnrollmentResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 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 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(EnrollmentRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public EnrollmentResponse setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public EnrollmentResponse setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public EnrollmentResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public EnrollmentResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 EnrollmentResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public EnrollmentResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Insurer who produced this adjudicated response.) + */ + public EnrollmentResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 EnrollmentResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public EnrollmentResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 EnrollmentResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + protected void listChildren(List 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(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("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)); + } + + public EnrollmentResponse copy() { + EnrollmentResponse dst = new EnrollmentResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + return dst; + } + + protected EnrollmentResponse typedCopy() { + return copy(); + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.EnrollmentResponse; + } + + @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java index d42fd1717a1..1944367c11d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java @@ -20,56 +20,56 @@ package org.hl7.fhir.instance.model; * #L% */ - - -/* -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. - -*/ - -/** - * Helper class to help manage generic enumerated types - */ -public interface EnumFactory> { - - /** - * Read an enumeration value from the string that represents it on the XML or JSON - * @param codeString the value found in the XML or JSON - * @return the enumeration value - * @throws IllegalArgumentException is the value is not known - */ - public T fromCode(String codeString) throws IllegalArgumentException; - - /** - * Get the XML/JSON representation for an enumerated value - * @param code - the enumeration value - * @return the XML/JSON representation - * @throws IllegalArgumentException if the enumeration is not valid (would usually indicate a code generation bug) - */ - public String toCode(T code) throws IllegalArgumentException; - -} + + +/* +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. + +*/ + +/** + * Helper class to help manage generic enumerated types + */ +public interface EnumFactory> { + + /** + * Read an enumeration value from the string that represents it on the XML or JSON + * @param codeString the value found in the XML or JSON + * @return the enumeration value + * @throws IllegalArgumentException is the value is not known + */ + public T fromCode(String codeString) throws IllegalArgumentException; + + /** + * Get the XML/JSON representation for an enumerated value + * @param code - the enumeration value + * @return the XML/JSON representation + * @throws IllegalArgumentException if the enumeration is not valid (would usually indicate a code generation bug) + */ + public String toCode(T code) throws IllegalArgumentException; + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java index 8af32aff8f9..da621371f93 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java @@ -20,106 +20,106 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* -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. - -*/ - -/** - * Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values - * - */ -public class Enumeration> extends PrimitiveType { - - private static final long serialVersionUID = 1L; - private EnumFactory myEnumFactory; - - /** - * Constructor - */ - public Enumeration(T theValue) { - setValue(theValue); - } - - /** - * Constructor - */ - public Enumeration(String theValue) { - setValueAsString(theValue); - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory, T theValue) { - myEnumFactory = theEnumFactory; - setValue(theValue); - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory, String theValue) { - myEnumFactory = theEnumFactory; - setValueAsString(theValue); - } - - /** - * Constructor - */ - public Enumeration(EnumFactory 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 copy() { - return new Enumeration(myEnumFactory, getValue()); - } - - -} + +/* +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. + +*/ + +/** + * Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values + * + */ +public class Enumeration> extends PrimitiveType { + + private static final long serialVersionUID = 1L; + private EnumFactory myEnumFactory; + + /** + * Constructor + */ + public Enumeration(T theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + public Enumeration(String theValue) { + setValueAsString(theValue); + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, T theValue) { + myEnumFactory = theEnumFactory; + setValue(theValue); + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, String theValue) { + myEnumFactory = theEnumFactory; + setValueAsString(theValue); + } + + /** + * Constructor + */ + public Enumeration(EnumFactory 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 copy() { + return new Enumeration(myEnumFactory, getValue()); + } + + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java index e9dcf669542..3d4c8113b55 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java @@ -20,679 +20,679 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information , for informing the subscriber of the benefits provided. - */ -@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") -public class ExplanationOfBenefit extends DomainResource { - - public enum RSLink implements FhirEnum { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) throws IllegalArgumentException { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @Child(name="request", type={OralHealthClaim.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 OralHealthClaim requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = 1627363360L; - - public ExplanationOfBenefit() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public ExplanationOfBenefit setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 OralHealthClaim getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new OralHealthClaim(); - 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 ExplanationOfBenefit setRequestTarget(OralHealthClaim value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public ExplanationOfBenefit setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public ExplanationOfBenefit setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(RSLink.ENUM_FACTORY); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ExplanationOfBenefit setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public ExplanationOfBenefit setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 ExplanationOfBenefit setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ExplanationOfBenefit setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public ExplanationOfBenefit setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Insurer who produced this adjudicated response.) - */ - public ExplanationOfBenefit setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ExplanationOfBenefit setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} 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 ExplanationOfBenefit setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ExplanationOfBenefit setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} 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 ExplanationOfBenefit setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List 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(OralHealthClaim)", "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("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)); - } - - public ExplanationOfBenefit copy() { - ExplanationOfBenefit dst = new ExplanationOfBenefit(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - return dst; - } - - protected ExplanationOfBenefit typedCopy() { - return copy(); - } - - public boolean isEmpty() { - 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()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ExplanationOfBenefit; - } - - @SearchParamDefinition(name="identifier", path="ExplanationOfBenefit.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information , for informing the subscriber of the benefits provided. + */ +@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") +public class ExplanationOfBenefit extends DomainResource { + + public enum RSLink implements FhirEnum { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) throws IllegalArgumentException { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @Child(name="request", type={OralHealthClaim.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 OralHealthClaim requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + private static final long serialVersionUID = 1627363360L; + + public ExplanationOfBenefit() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public ExplanationOfBenefit setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 OralHealthClaim getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new OralHealthClaim(); + 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 ExplanationOfBenefit setRequestTarget(OralHealthClaim value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public ExplanationOfBenefit setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public ExplanationOfBenefit setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public ExplanationOfBenefit setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public ExplanationOfBenefit setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 ExplanationOfBenefit setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public ExplanationOfBenefit setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public ExplanationOfBenefit setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Insurer who produced this adjudicated response.) + */ + public ExplanationOfBenefit setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ExplanationOfBenefit setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 ExplanationOfBenefit setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public ExplanationOfBenefit setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExplanationOfBenefit.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 ExplanationOfBenefit setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + protected void listChildren(List 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(OralHealthClaim)", "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("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)); + } + + public ExplanationOfBenefit copy() { + ExplanationOfBenefit dst = new ExplanationOfBenefit(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + return dst; + } + + protected ExplanationOfBenefit typedCopy() { + return copy(); + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ExplanationOfBenefit; + } + + @SearchParamDefinition(name="identifier", path="ExplanationOfBenefit.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java index 2ed0f9e952e..e45fa2f4b3a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java @@ -20,162 +20,162 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * Optional Extensions Element - found in all resources. - */ -@DatatypeDef(name="Extension") -public class Extension extends Element { - - /** - * Source of the definition for the extension code - a logical name or a URL. - */ - @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="identifies the meaning of the extension", formalDefinition="Source of the definition for the extension code - a logical name or a URL." ) - protected UriType url; - - /** - * Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). - */ - @Child(name="value", type={}, order=0, min=0, max=1) - @Description(shortDefinition="Value of extension", formalDefinition="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." ) - protected org.hl7.fhir.instance.model.Type value; - - private static final long serialVersionUID = 86382982L; - - public Extension() { - super(); - } - - public Extension(UriType url) { - super(); - this.url = url; - } - - /** - * @return {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Extension.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Extension setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return Source of the definition for the extension code - a logical name or a URL. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value Source of the definition for the extension code - a logical name or a URL. - */ - public Extension setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) - */ - public org.hl7.fhir.instance.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) - */ - public Extension setValue(org.hl7.fhir.instance.model.Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "Source of the definition for the extension code - a logical name or a URL.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("value[x]", "*", "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public Extension copy() { - Extension dst = new Extension(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - protected Extension typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * Optional Extensions Element - found in all resources. + */ +@DatatypeDef(name="Extension") +public class Extension extends Element { + + /** + * Source of the definition for the extension code - a logical name or a URL. + */ + @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="identifies the meaning of the extension", formalDefinition="Source of the definition for the extension code - a logical name or a URL." ) + protected UriType url; + + /** + * Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). + */ + @Child(name="value", type={}, order=0, min=0, max=1) + @Description(shortDefinition="Value of extension", formalDefinition="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." ) + protected org.hl7.fhir.instance.model.Type value; + + private static final long serialVersionUID = 86382982L; + + public Extension() { + super(); + } + + public Extension(UriType url) { + super(); + this.url = url; + } + + /** + * @return {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Extension.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Extension setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return Source of the definition for the extension code - a logical name or a URL. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value Source of the definition for the extension code - a logical name or a URL. + */ + public Extension setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) + */ + public org.hl7.fhir.instance.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) + */ + public Extension setValue(org.hl7.fhir.instance.model.Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "Source of the definition for the extension code - a logical name or a URL.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("value[x]", "*", "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public Extension copy() { + Extension dst = new Extension(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + protected Extension typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java index b0a3105a85d..e224b1d21d7 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java @@ -20,1411 +20,1411 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Defines an extension that can be used in resources. - */ -@ResourceDef(name="ExtensionDefinition", profile="http://hl7.org/fhir/Profile/ExtensionDefinition") -public class ExtensionDefinition extends DomainResource { - - public enum ResourceProfileStatus implements FhirEnum { - /** - * This profile is still under development. - */ - DRAFT, - /** - * This profile is ready for normal use. - */ - ACTIVE, - /** - * This profile has been deprecated, withdrawn or superseded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This profile is still under development."; - case ACTIVE: return "This profile is ready for normal use."; - case RETIRED: return "This profile has been deprecated, withdrawn or superseded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class ResourceProfileStatusEnumFactory implements EnumFactory { - public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ResourceProfileStatus.DRAFT; - if ("active".equals(codeString)) - return ResourceProfileStatus.ACTIVE; - if ("retired".equals(codeString)) - return ResourceProfileStatus.RETIRED; - throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); - } - public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { - if (code == ResourceProfileStatus.DRAFT) - return "draft"; - if (code == ResourceProfileStatus.ACTIVE) - return "active"; - if (code == ResourceProfileStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum ExtensionContext implements FhirEnum { - /** - * The context is all elements matching a particular resource element path. - */ - RESOURCE, - /** - * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name). - */ - DATATYPE, - /** - * The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used. - */ - MAPPING, - /** - * The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code. - */ - EXTENSION, - /** - * added to help the parsers - */ - NULL; - - 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)) - return RESOURCE; - if ("datatype".equals(codeString)) - return DATATYPE; - if ("mapping".equals(codeString)) - return MAPPING; - if ("extension".equals(codeString)) - return EXTENSION; - throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case RESOURCE: return "resource"; - case DATATYPE: return "datatype"; - case MAPPING: return "mapping"; - case EXTENSION: return "extension"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESOURCE: return ""; - case DATATYPE: return ""; - case MAPPING: return ""; - case EXTENSION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESOURCE: return "The context is all elements matching a particular resource element path."; - case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name)."; - case MAPPING: return "The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used."; - case EXTENSION: return "The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESOURCE: return "resource"; - case DATATYPE: return "datatype"; - case MAPPING: return "mapping"; - case EXTENSION: return "extension"; - default: return "?"; - } - } - } - - public static class ExtensionContextEnumFactory implements EnumFactory { - public ExtensionContext fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("resource".equals(codeString)) - return ExtensionContext.RESOURCE; - if ("datatype".equals(codeString)) - return ExtensionContext.DATATYPE; - if ("mapping".equals(codeString)) - return ExtensionContext.MAPPING; - if ("extension".equals(codeString)) - return ExtensionContext.EXTENSION; - throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); - } - public String toCode(ExtensionContext code) throws IllegalArgumentException { - if (code == ExtensionContext.RESOURCE) - return "resource"; - if (code == ExtensionContext.DATATYPE) - return "datatype"; - if (code == ExtensionContext.MAPPING) - return "mapping"; - if (code == ExtensionContext.EXTENSION) - return "extension"; - return "?"; - } - } - - @Block() - public static class ExtensionDefinitionMappingComponent extends BackboneElement { - /** - * An Internal id that is used to identify this mapping set when specific mappings are made. - */ - @Child(name="identity", type={IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) - protected IdType identity; - - /** - * A URI that identifies the specification that this mapping is expressed to. - */ - @Child(name="uri", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="A URI that identifies the specification that this mapping is expressed to." ) - protected UriType uri; - - /** - * A name for the specification that is being mapped to. - */ - @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=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; - - private static final long serialVersionUID = 299630820L; - - public ExtensionDefinitionMappingComponent() { - super(); - } - - public ExtensionDefinitionMappingComponent(IdType identity) { - super(); - this.identity = identity; - } - - /** - * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public ExtensionDefinitionMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public ExtensionDefinitionMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public ExtensionDefinitionMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return A URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value A URI that identifies the specification that this mapping is expressed to. - */ - public ExtensionDefinitionMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.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 - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (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 - */ - public ExtensionDefinitionMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public ExtensionDefinitionMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ExtensionDefinitionMappingComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public ExtensionDefinitionMappingComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); - 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("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)); - } - - public ExtensionDefinitionMappingComponent copy() { - ExtensionDefinitionMappingComponent dst = new ExtensionDefinitionMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.uri = uri == null ? null : uri.copy(); - dst.name = name == null ? null : name.copy(); - dst.comments = comments == null ? null : comments.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) - && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); - } - - } - - /** - * The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems. - */ - @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Literal URL used to reference this extension", formalDefinition="The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the extension", formalDefinition="Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) - protected List identifier; - - /** - * A free text natural language name identifying the extension. - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Descriptional name for this profile", formalDefinition="A free text natural language name identifying the extension." ) - protected StringType name; - - /** - * Defined so that applications can use this name when displaying the value of the extension to the user. - */ - @Child(name="display", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Use this name when displaying the value", formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user." ) - protected StringType display; - - /** - * Details of the individual or organization who accepts responsibility for publishing the extension definition. - */ - @Child(name="publisher", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the extension definition." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A free text natural language description of the extension and its use. - */ - @Child(name="description", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Natural language description of the extension", formalDefinition="A free text natural language description of the extension and its use." ) - protected StringType description; - - /** - * A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions. - */ - @Child(name="code", type={Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions." ) - protected List code; - - /** - * The status of the extension. - */ - @Child(name="status", type={CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the extension." ) - protected Enumeration status; - - /** - * This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name="experimental", type={BooleanType.class}, order=8, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that this version of the extension was published. - */ - @Child(name="date", type={DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Date for this version of the extension", formalDefinition="The date that this version of the extension was published." ) - protected DateTimeType date; - - /** - * The Scope and Usage that this extension was created to meet. - */ - @Child(name="requirements", type={StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Scope and Usage this extesion is for", formalDefinition="The Scope and Usage that this extension was created to meet." ) - protected StringType requirements; - - /** - * An external specification that the content is mapped to. - */ - @Child(name="mapping", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) - protected List mapping; - - /** - * Identifies the type of context to which the extension applies. - */ - @Child(name="contextType", type={CodeType.class}, order=12, min=1, max=1) - @Description(shortDefinition="resource | datatype | mapping | extension", formalDefinition="Identifies the type of context to which the extension applies." ) - protected Enumeration contextType; - - /** - * Identifies the types of resource or data type elements to which the extension can be applied. - */ - @Child(name="context", type={StringType.class}, order=13, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." ) - protected List context; - - /** - * Definition of the elements that are defined to be in the extension. - */ - @Child(name="element", type={ElementDefinition.class}, order=14, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of the elements in the extension", formalDefinition="Definition of the elements that are defined to be in the extension." ) - protected List element; - - private static final long serialVersionUID = -989216686L; - - public ExtensionDefinition() { - super(); - } - - public ExtensionDefinition(UriType url, StringType name, Enumeration status, Enumeration contextType) { - super(); - this.url = url; - this.name = name; - this.status = status; - this.contextType = contextType; - } - - /** - * @return {@link #url} (The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ExtensionDefinition setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems. - */ - public ExtensionDefinition setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #name} (A free text natural language name identifying the extension.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A free text natural language name identifying the extension.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ExtensionDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the extension. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the extension. - */ - public ExtensionDefinition setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ExtensionDefinition setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Defined so that applications can use this name when displaying the value of the extension to the user. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Defined so that applications can use this name when displaying the value of the extension to the user. - */ - public ExtensionDefinition setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the extension definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the extension definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ExtensionDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Details of the individual or organization who accepts responsibility for publishing the extension definition. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Details of the individual or organization who accepts responsibility for publishing the extension definition. - */ - public ExtensionDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #description} (A free text natural language description of the extension and its use.). 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 ExtensionDefinition.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} (A free text natural language description of the extension and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ExtensionDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the extension and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the extension and its use. - */ - public ExtensionDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - /** - * @return {@link #status} (The status of the extension.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 extension.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ExtensionDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the extension. - */ - public ResourceProfileStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the extension. - */ - public ExtensionDefinition setStatus(ResourceProfileStatus value) { - if (this.status == null) - this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ExtensionDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null ? false : this.experimental.getValue(); - } - - /** - * @param value This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ExtensionDefinition setExperimental(boolean value) { - if (value == false) - this.experimental = null; - else { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date that this version of the extension was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this version of the extension was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ExtensionDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this version of the extension was published. - */ - 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(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (The Scope and Usage that this extension was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (The Scope and Usage that this extension was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ExtensionDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return The Scope and Usage that this extension was created to meet. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value The Scope and Usage that this extension was created to meet. - */ - public ExtensionDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (ExtensionDefinitionMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - // syntactic sugar - public ExtensionDefinitionMappingComponent addMapping() { //3 - ExtensionDefinitionMappingComponent t = new ExtensionDefinitionMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - /** - * @return {@link #contextType} (Identifies the type of context to which the extension applies.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public Enumeration getContextTypeElement() { - if (this.contextType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExtensionDefinition.contextType"); - else if (Configuration.doAutoCreate()) - this.contextType = new Enumeration(); - return this.contextType; - } - - public boolean hasContextTypeElement() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - public boolean hasContextType() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - /** - * @param value {@link #contextType} (Identifies the type of context to which the extension applies.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public ExtensionDefinition setContextTypeElement(Enumeration value) { - this.contextType = value; - return this; - } - - /** - * @return Identifies the type of context to which the extension applies. - */ - public ExtensionContext getContextType() { - return this.contextType == null ? null : this.contextType.getValue(); - } - - /** - * @param value Identifies the type of context to which the extension applies. - */ - public ExtensionDefinition setContextType(ExtensionContext value) { - if (this.contextType == null) - this.contextType = new Enumeration(ExtensionContext.ENUM_FACTORY); - this.contextType.setValue(value); - return this; - } - - /** - * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public List getContext() { - if (this.context == null) - this.context = new ArrayList(); - return this.context; - } - - public boolean hasContext() { - if (this.context == null) - return false; - for (StringType item : this.context) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - // syntactic sugar - public StringType addContextElement() {//2 - StringType t = new StringType(); - if (this.context == null) - this.context = new ArrayList(); - this.context.add(t); - return t; - } - - /** - * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public ExtensionDefinition addContext(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.context == null) - this.context = new ArrayList(); - this.context.add(t); - return this; - } - - /** - * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public boolean hasContext(String value) { - if (this.context == null) - return false; - for (StringType v : this.context) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #element} (Definition of the elements that are defined to be in the extension.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Definition of the elements that are defined to be in the extension.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the extension.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("display", "string", "Defined so that applications can use this name when displaying the value of the extension to the user.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the extension definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("description", "string", "A free text natural language description of the extension and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("status", "code", "The status of the extension.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the extension was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("requirements", "string", "The Scope and Usage that this extension was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); - childrenList.add(new Property("contextType", "code", "Identifies the type of context to which the extension applies.", 0, java.lang.Integer.MAX_VALUE, contextType)); - childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("element", "ElementDefinition", "Definition of the elements that are defined to be in the extension.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public ExtensionDefinition copy() { - ExtensionDefinition dst = new ExtensionDefinition(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.display = display == null ? null : display.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (ExtensionDefinitionMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - dst.contextType = contextType == null ? null : contextType.copy(); - if (context != null) { - dst.context = new ArrayList(); - for (StringType i : context) - dst.context.add(i.copy()); - }; - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - protected ExtensionDefinition typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (name == null || name.isEmpty()) && (display == null || display.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (description == null || description.isEmpty()) - && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (requirements == null || requirements.isEmpty()) && (mapping == null || mapping.isEmpty()) - && (contextType == null || contextType.isEmpty()) && (context == null || context.isEmpty()) - && (element == null || element.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ExtensionDefinition; - } - - @SearchParamDefinition(name="valueset", path="ExtensionDefinition.element.binding.reference[x]", description="Source of value set", type="reference" ) - public static final String SP_VALUESET = "valueset"; - @SearchParamDefinition(name="status", path="ExtensionDefinition.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="ExtensionDefinition.description", description="Natural language description of the extension", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="ExtensionDefinition.name", description="Descriptional name for this profile", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="code", path="ExtensionDefinition.code", description="Assist with indexing and finding", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="ExtensionDefinition.date", description="Date for this version of the extension", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="ExtensionDefinition.identifier", description="Other identifiers for the extension", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="url", path="ExtensionDefinition.url", description="Literal URL used to reference this extension", type="token" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="publisher", path="ExtensionDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - -} - + +/* + 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; +/** + * Defines an extension that can be used in resources. + */ +@ResourceDef(name="ExtensionDefinition", profile="http://hl7.org/fhir/Profile/ExtensionDefinition") +public class ExtensionDefinition extends DomainResource { + + public enum ResourceProfileStatus implements FhirEnum { + /** + * This profile is still under development. + */ + DRAFT, + /** + * This profile is ready for normal use. + */ + ACTIVE, + /** + * This profile has been deprecated, withdrawn or superseded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This profile is still under development."; + case ACTIVE: return "This profile is ready for normal use."; + case RETIRED: return "This profile has been deprecated, withdrawn or superseded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class ResourceProfileStatusEnumFactory implements EnumFactory { + public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ResourceProfileStatus.DRAFT; + if ("active".equals(codeString)) + return ResourceProfileStatus.ACTIVE; + if ("retired".equals(codeString)) + return ResourceProfileStatus.RETIRED; + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); + } + public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { + if (code == ResourceProfileStatus.DRAFT) + return "draft"; + if (code == ResourceProfileStatus.ACTIVE) + return "active"; + if (code == ResourceProfileStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum ExtensionContext implements FhirEnum { + /** + * The context is all elements matching a particular resource element path. + */ + RESOURCE, + /** + * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name). + */ + DATATYPE, + /** + * The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used. + */ + MAPPING, + /** + * The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code. + */ + EXTENSION, + /** + * added to help the parsers + */ + NULL; + + 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)) + return RESOURCE; + if ("datatype".equals(codeString)) + return DATATYPE; + if ("mapping".equals(codeString)) + return MAPPING; + if ("extension".equals(codeString)) + return EXTENSION; + throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case RESOURCE: return "resource"; + case DATATYPE: return "datatype"; + case MAPPING: return "mapping"; + case EXTENSION: return "extension"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESOURCE: return ""; + case DATATYPE: return ""; + case MAPPING: return ""; + case EXTENSION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESOURCE: return "The context is all elements matching a particular resource element path."; + case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name)."; + case MAPPING: return "The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used."; + case EXTENSION: return "The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESOURCE: return "resource"; + case DATATYPE: return "datatype"; + case MAPPING: return "mapping"; + case EXTENSION: return "extension"; + default: return "?"; + } + } + } + + public static class ExtensionContextEnumFactory implements EnumFactory { + public ExtensionContext fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("resource".equals(codeString)) + return ExtensionContext.RESOURCE; + if ("datatype".equals(codeString)) + return ExtensionContext.DATATYPE; + if ("mapping".equals(codeString)) + return ExtensionContext.MAPPING; + if ("extension".equals(codeString)) + return ExtensionContext.EXTENSION; + throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); + } + public String toCode(ExtensionContext code) throws IllegalArgumentException { + if (code == ExtensionContext.RESOURCE) + return "resource"; + if (code == ExtensionContext.DATATYPE) + return "datatype"; + if (code == ExtensionContext.MAPPING) + return "mapping"; + if (code == ExtensionContext.EXTENSION) + return "extension"; + return "?"; + } + } + + @Block() + public static class ExtensionDefinitionMappingComponent extends BackboneElement { + /** + * An Internal id that is used to identify this mapping set when specific mappings are made. + */ + @Child(name="identity", type={IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) + protected IdType identity; + + /** + * A URI that identifies the specification that this mapping is expressed to. + */ + @Child(name="uri", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="A URI that identifies the specification that this mapping is expressed to." ) + protected UriType uri; + + /** + * A name for the specification that is being mapped to. + */ + @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=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; + + private static final long serialVersionUID = 299630820L; + + public ExtensionDefinitionMappingComponent() { + super(); + } + + public ExtensionDefinitionMappingComponent(IdType identity) { + super(); + this.identity = identity; + } + + /** + * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public ExtensionDefinitionMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public ExtensionDefinitionMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public ExtensionDefinitionMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return A URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value A URI that identifies the specification that this mapping is expressed to. + */ + public ExtensionDefinitionMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.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 + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (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 + */ + public ExtensionDefinitionMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public ExtensionDefinitionMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinitionMappingComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ExtensionDefinitionMappingComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public ExtensionDefinitionMappingComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); + 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("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)); + } + + public ExtensionDefinitionMappingComponent copy() { + ExtensionDefinitionMappingComponent dst = new ExtensionDefinitionMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.uri = uri == null ? null : uri.copy(); + dst.name = name == null ? null : name.copy(); + dst.comments = comments == null ? null : comments.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); + } + + } + + /** + * The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems. + */ + @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Literal URL used to reference this extension", formalDefinition="The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the extension", formalDefinition="Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) + protected List identifier; + + /** + * A free text natural language name identifying the extension. + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Descriptional name for this profile", formalDefinition="A free text natural language name identifying the extension." ) + protected StringType name; + + /** + * Defined so that applications can use this name when displaying the value of the extension to the user. + */ + @Child(name="display", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Use this name when displaying the value", formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user." ) + protected StringType display; + + /** + * Details of the individual or organization who accepts responsibility for publishing the extension definition. + */ + @Child(name="publisher", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the extension definition." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A free text natural language description of the extension and its use. + */ + @Child(name="description", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Natural language description of the extension", formalDefinition="A free text natural language description of the extension and its use." ) + protected StringType description; + + /** + * A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions. + */ + @Child(name="code", type={Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions." ) + protected List code; + + /** + * The status of the extension. + */ + @Child(name="status", type={CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the extension." ) + protected Enumeration status; + + /** + * This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name="experimental", type={BooleanType.class}, order=8, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that this version of the extension was published. + */ + @Child(name="date", type={DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Date for this version of the extension", formalDefinition="The date that this version of the extension was published." ) + protected DateTimeType date; + + /** + * The Scope and Usage that this extension was created to meet. + */ + @Child(name="requirements", type={StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Scope and Usage this extesion is for", formalDefinition="The Scope and Usage that this extension was created to meet." ) + protected StringType requirements; + + /** + * An external specification that the content is mapped to. + */ + @Child(name="mapping", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) + protected List mapping; + + /** + * Identifies the type of context to which the extension applies. + */ + @Child(name="contextType", type={CodeType.class}, order=12, min=1, max=1) + @Description(shortDefinition="resource | datatype | mapping | extension", formalDefinition="Identifies the type of context to which the extension applies." ) + protected Enumeration contextType; + + /** + * Identifies the types of resource or data type elements to which the extension can be applied. + */ + @Child(name="context", type={StringType.class}, order=13, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." ) + protected List context; + + /** + * Definition of the elements that are defined to be in the extension. + */ + @Child(name="element", type={ElementDefinition.class}, order=14, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of the elements in the extension", formalDefinition="Definition of the elements that are defined to be in the extension." ) + protected List element; + + private static final long serialVersionUID = -989216686L; + + public ExtensionDefinition() { + super(); + } + + public ExtensionDefinition(UriType url, StringType name, Enumeration status, Enumeration contextType) { + super(); + this.url = url; + this.name = name; + this.status = status; + this.contextType = contextType; + } + + /** + * @return {@link #url} (The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ExtensionDefinition setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems. + */ + public ExtensionDefinition setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (A free text natural language name identifying the extension.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A free text natural language name identifying the extension.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ExtensionDefinition setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the extension. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the extension. + */ + public ExtensionDefinition setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ExtensionDefinition setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Defined so that applications can use this name when displaying the value of the extension to the user. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Defined so that applications can use this name when displaying the value of the extension to the user. + */ + public ExtensionDefinition setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the extension definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the extension definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ExtensionDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Details of the individual or organization who accepts responsibility for publishing the extension definition. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Details of the individual or organization who accepts responsibility for publishing the extension definition. + */ + public ExtensionDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #description} (A free text natural language description of the extension and its use.). 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 ExtensionDefinition.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} (A free text natural language description of the extension and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ExtensionDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the extension and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the extension and its use. + */ + public ExtensionDefinition setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + /** + * @return {@link #status} (The status of the extension.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 extension.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ExtensionDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the extension. + */ + public ResourceProfileStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the extension. + */ + public ExtensionDefinition setStatus(ResourceProfileStatus value) { + if (this.status == null) + this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ExtensionDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null ? false : this.experimental.getValue(); + } + + /** + * @param value This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ExtensionDefinition setExperimental(boolean value) { + if (value == false) + this.experimental = null; + else { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date that this version of the extension was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this version of the extension was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ExtensionDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this version of the extension was published. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (The Scope and Usage that this extension was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (The Scope and Usage that this extension was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public ExtensionDefinition setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return The Scope and Usage that this extension was created to meet. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value The Scope and Usage that this extension was created to meet. + */ + public ExtensionDefinition setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (ExtensionDefinitionMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + // syntactic sugar + public ExtensionDefinitionMappingComponent addMapping() { //3 + ExtensionDefinitionMappingComponent t = new ExtensionDefinitionMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + /** + * @return {@link #contextType} (Identifies the type of context to which the extension applies.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public Enumeration getContextTypeElement() { + if (this.contextType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ExtensionDefinition.contextType"); + else if (Configuration.doAutoCreate()) + this.contextType = new Enumeration(); + return this.contextType; + } + + public boolean hasContextTypeElement() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + public boolean hasContextType() { + return this.contextType != null && !this.contextType.isEmpty(); + } + + /** + * @param value {@link #contextType} (Identifies the type of context to which the extension applies.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value + */ + public ExtensionDefinition setContextTypeElement(Enumeration value) { + this.contextType = value; + return this; + } + + /** + * @return Identifies the type of context to which the extension applies. + */ + public ExtensionContext getContextType() { + return this.contextType == null ? null : this.contextType.getValue(); + } + + /** + * @param value Identifies the type of context to which the extension applies. + */ + public ExtensionDefinition setContextType(ExtensionContext value) { + if (this.contextType == null) + this.contextType = new Enumeration(ExtensionContext.ENUM_FACTORY); + this.contextType.setValue(value); + return this; + } + + /** + * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public List getContext() { + if (this.context == null) + this.context = new ArrayList(); + return this.context; + } + + public boolean hasContext() { + if (this.context == null) + return false; + for (StringType item : this.context) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + // syntactic sugar + public StringType addContextElement() {//2 + StringType t = new StringType(); + if (this.context == null) + this.context = new ArrayList(); + this.context.add(t); + return t; + } + + /** + * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public ExtensionDefinition addContext(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.context == null) + this.context = new ArrayList(); + this.context.add(t); + return this; + } + + /** + * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) + */ + public boolean hasContext(String value) { + if (this.context == null) + return false; + for (StringType v : this.context) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #element} (Definition of the elements that are defined to be in the extension.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Definition of the elements that are defined to be in the extension.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "The URL at which this definition is (or will be) published, and which is used to reference this profile in extension urls in operational FHIR systems.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this profile when it is represented in other formats (e.g. ISO 11179(, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the extension.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("display", "string", "Defined so that applications can use this name when displaying the value of the extension to the user.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the extension definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("description", "string", "A free text natural language description of the extension and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of extension definitions.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("status", "code", "The status of the extension.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This extension definition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that this version of the extension was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("requirements", "string", "The Scope and Usage that this extension was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); + childrenList.add(new Property("contextType", "code", "Identifies the type of context to which the extension applies.", 0, java.lang.Integer.MAX_VALUE, contextType)); + childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); + childrenList.add(new Property("element", "ElementDefinition", "Definition of the elements that are defined to be in the extension.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public ExtensionDefinition copy() { + ExtensionDefinition dst = new ExtensionDefinition(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.display = display == null ? null : display.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (ExtensionDefinitionMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + dst.contextType = contextType == null ? null : contextType.copy(); + if (context != null) { + dst.context = new ArrayList(); + for (StringType i : context) + dst.context.add(i.copy()); + }; + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + protected ExtensionDefinition typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (name == null || name.isEmpty()) && (display == null || display.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (description == null || description.isEmpty()) + && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (requirements == null || requirements.isEmpty()) && (mapping == null || mapping.isEmpty()) + && (contextType == null || contextType.isEmpty()) && (context == null || context.isEmpty()) + && (element == null || element.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ExtensionDefinition; + } + + @SearchParamDefinition(name="valueset", path="ExtensionDefinition.element.binding.reference[x]", description="Source of value set", type="reference" ) + public static final String SP_VALUESET = "valueset"; + @SearchParamDefinition(name="status", path="ExtensionDefinition.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="description", path="ExtensionDefinition.description", description="Natural language description of the extension", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="name", path="ExtensionDefinition.name", description="Descriptional name for this profile", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="code", path="ExtensionDefinition.code", description="Assist with indexing and finding", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="ExtensionDefinition.date", description="Date for this version of the extension", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ExtensionDefinition.identifier", description="Other identifiers for the extension", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="url", path="ExtensionDefinition.url", description="Literal URL used to reference this extension", type="token" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="publisher", path="ExtensionDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java index b011e101869..42e7ce5bee4 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionHelper.java @@ -20,148 +20,148 @@ package org.hl7.fhir.instance.model; * #L% */ - -/** - * in a language with helper classes, this would be a helper class (at least, the base exgtension helpers would be) - * @author Grahame - * - */ -public class ExtensionHelper { - - - /** - * @param name the identity of the extension of interest - * @return true if the named extension is on this element. Will check modifier extensions too if appropriate - */ - public static boolean hasExtension(Element element, String name) { - if (element != null && element instanceof BackboneElement) - return hasExtension((BackboneElement) element, name); - - if (name == null || element == null || !element.hasExtension()) - return false; - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return true; - } - return false; - } - - /** - * @param name the identity of the extension of interest - * @return true if the named extension is on this element. Will check modifier extensions - */ - public static boolean hasExtension(BackboneElement element, String name) { - if (name == null || element == null || !(element.hasExtension() || element.hasModifierExtension())) - return false; - for (Extension e : element.getModifierExtension()) { - if (name.equals(e.getUrl())) - return true; - } - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return true; - } - return false; - } - - - /** - * @param name the identity of the extension of interest - * @return The extension, if on this element, else null. will check modifier extensions too, if appropriate - */ - public static Extension getExtension(Element element, String name) { - if (element != null && element instanceof BackboneElement) - return getExtension((BackboneElement) element, name); - - if (name == null || element == null || !element.hasExtension()) - return null; - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return e; - } - return null; - } - - /** - * @param name the identity of the extension of interest - * @return The extension, if on this element, else null. will check modifier extensions too - */ - public static Extension getExtension(BackboneElement element, String name) { - if (name == null || element == null || !element.hasExtension()) - return null; - for (Extension e : element.getModifierExtension()) { - if (name.equals(e.getUrl())) - return e; - } - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return e; - } - return null; - } - - /** - * set the value of an extension on the element. if value == null, make sure it doesn't exist - * - * @param element - the element to act on. Can also be a backbone element - * @param modifier - whether this is a modifier. Note that this is a definitional property of the extension; don't alternate - * @param uri - the identifier for the extension - * @param value - the value of the extension. Delete if this is null - * @throws Exception - if the modifier logic is incorrect - */ - public static void setExtension(Element element, boolean modifier, String uri, Type value) throws Exception { - if (value == null) { - // deleting the extension - if (element instanceof BackboneElement) - for (Extension e : ((BackboneElement) element).getModifierExtension()) { - if (uri.equals(e.getUrl())) - ((BackboneElement) element).getModifierExtension().remove(e); - } - for (Extension e : element.getExtension()) { - if (uri.equals(e.getUrl())) - element.getExtension().remove(e); - } - } else { - // it would probably be easier to delete and then create, but this would re-order the extensions - // not that order matters, but we'll preserve it anyway - boolean found = false; - if (element instanceof BackboneElement) - for (Extension e : ((BackboneElement) element).getModifierExtension()) { - if (uri.equals(e.getUrl())) { - if (!modifier) - throw new Exception("Error adding extension \""+uri+"\": found an existing modifier extension, and the extension is not marked as a modifier"); - e.setValue(value); - found = true; - } - } - for (Extension e : element.getExtension()) { - if (uri.equals(e.getUrl())) { - if (modifier) - throw new Exception("Error adding extension \""+uri+"\": found an existing extension, and the extension is marked as a modifier"); - e.setValue(value); - found = true; - } - } - if (!found) { - Extension ex = new Extension().setUrl(uri).setValue(value); - if (modifier) { - if (!(element instanceof BackboneElement)) - throw new Exception("Error adding extension \""+uri+"\": extension is marked as a modifier, but element is not a backbone element"); - ((BackboneElement) element).getModifierExtension().add(ex); - - } else { - element.getExtension().add(ex); - } - } - } - } - - public static boolean hasExtensions(Element element) { - if (element instanceof BackboneElement) - return element.hasExtension() || ((BackboneElement) element).hasModifierExtension(); - else - return element.hasExtension(); - } - - -} + +/** + * in a language with helper classes, this would be a helper class (at least, the base exgtension helpers would be) + * @author Grahame + * + */ +public class ExtensionHelper { + + + /** + * @param name the identity of the extension of interest + * @return true if the named extension is on this element. Will check modifier extensions too if appropriate + */ + public static boolean hasExtension(Element element, String name) { + if (element != null && element instanceof BackboneElement) + return hasExtension((BackboneElement) element, name); + + if (name == null || element == null || !element.hasExtension()) + return false; + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return true; + } + return false; + } + + /** + * @param name the identity of the extension of interest + * @return true if the named extension is on this element. Will check modifier extensions + */ + public static boolean hasExtension(BackboneElement element, String name) { + if (name == null || element == null || !(element.hasExtension() || element.hasModifierExtension())) + return false; + for (Extension e : element.getModifierExtension()) { + if (name.equals(e.getUrl())) + return true; + } + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return true; + } + return false; + } + + + /** + * @param name the identity of the extension of interest + * @return The extension, if on this element, else null. will check modifier extensions too, if appropriate + */ + public static Extension getExtension(Element element, String name) { + if (element != null && element instanceof BackboneElement) + return getExtension((BackboneElement) element, name); + + if (name == null || element == null || !element.hasExtension()) + return null; + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return e; + } + return null; + } + + /** + * @param name the identity of the extension of interest + * @return The extension, if on this element, else null. will check modifier extensions too + */ + public static Extension getExtension(BackboneElement element, String name) { + if (name == null || element == null || !element.hasExtension()) + return null; + for (Extension e : element.getModifierExtension()) { + if (name.equals(e.getUrl())) + return e; + } + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return e; + } + return null; + } + + /** + * set the value of an extension on the element. if value == null, make sure it doesn't exist + * + * @param element - the element to act on. Can also be a backbone element + * @param modifier - whether this is a modifier. Note that this is a definitional property of the extension; don't alternate + * @param uri - the identifier for the extension + * @param value - the value of the extension. Delete if this is null + * @throws Exception - if the modifier logic is incorrect + */ + public static void setExtension(Element element, boolean modifier, String uri, Type value) throws Exception { + if (value == null) { + // deleting the extension + if (element instanceof BackboneElement) + for (Extension e : ((BackboneElement) element).getModifierExtension()) { + if (uri.equals(e.getUrl())) + ((BackboneElement) element).getModifierExtension().remove(e); + } + for (Extension e : element.getExtension()) { + if (uri.equals(e.getUrl())) + element.getExtension().remove(e); + } + } else { + // it would probably be easier to delete and then create, but this would re-order the extensions + // not that order matters, but we'll preserve it anyway + boolean found = false; + if (element instanceof BackboneElement) + for (Extension e : ((BackboneElement) element).getModifierExtension()) { + if (uri.equals(e.getUrl())) { + if (!modifier) + throw new Exception("Error adding extension \""+uri+"\": found an existing modifier extension, and the extension is not marked as a modifier"); + e.setValue(value); + found = true; + } + } + for (Extension e : element.getExtension()) { + if (uri.equals(e.getUrl())) { + if (modifier) + throw new Exception("Error adding extension \""+uri+"\": found an existing extension, and the extension is marked as a modifier"); + e.setValue(value); + found = true; + } + } + if (!found) { + Extension ex = new Extension().setUrl(uri).setValue(value); + if (modifier) { + if (!(element instanceof BackboneElement)) + throw new Exception("Error adding extension \""+uri+"\": extension is marked as a modifier, but element is not a backbone element"); + ((BackboneElement) element).getModifierExtension().add(ex); + + } else { + element.getExtension().add(ex); + } + } + } + } + + public static boolean hasExtensions(Element element) { + if (element instanceof BackboneElement) + return element.hasExtension() || ((BackboneElement) element).hasModifierExtension(); + else + return element.hasExtension(); + } + + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java index 3ddf2da64d1..7e180884c94 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java @@ -20,967 +20,967 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Significant health events and conditions for people related to the subject relevant in the context of care for the subject. - */ -@ResourceDef(name="FamilyHistory", profile="http://hl7.org/fhir/Profile/FamilyHistory") -public class FamilyHistory extends DomainResource { - - @Block() - public static class FamilyHistoryRelationComponent extends BackboneElement { - /** - * This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="The family member described", formalDefinition="This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'." ) - protected StringType name; - - /** - * The type of relationship this person has to the patient (father, mother, brother etc.). - */ - @Child(name="relationship", type={CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." ) - protected CodeableConcept relationship; - - /** - * The actual or approximate date of birth of the relative. - */ - @Child(name="born", type={Period.class, DateType.class, StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." ) - protected Type born; - - /** - * The actual or approximate age of the relative at the time the family history is recorded. - */ - @Child(name="age", type={Age.class, Range.class, StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="(approximate) age", formalDefinition="The actual or approximate age of the relative at the time the family history is recorded." ) - protected Type age; - - /** - * If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set. - */ - @Child(name="deceased", type={BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Dead? How old/when?", formalDefinition="If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set." ) - protected Type deceased; - - /** - * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - */ - @Child(name="note", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="General note about related person", formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." ) - protected StringType note; - - /** - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - */ - @Child(name="condition", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Condition that the related person had", formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." ) - protected List condition; - - private static final long serialVersionUID = 211772865L; - - public FamilyHistoryRelationComponent() { - super(); - } - - public FamilyHistoryRelationComponent(CodeableConcept relationship) { - super(); - this.relationship = relationship; - } - - /** - * @return {@link #name} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistoryRelationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public FamilyHistoryRelationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". - */ - public FamilyHistoryRelationComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) - */ - public CodeableConcept getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistoryRelationComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeableConcept(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) - */ - public FamilyHistoryRelationComponent setRelationship(CodeableConcept value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public Type getBorn() { - return this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public Period getBornPeriod() throws Exception { - if (!(this.born instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered"); - return (Period) this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public DateType getBornDateType() throws Exception { - if (!(this.born instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered"); - return (DateType) this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public StringType getBornStringType() throws Exception { - if (!(this.born instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered"); - return (StringType) this.born; - } - - public boolean hasBorn() { - return this.born != null && !this.born.isEmpty(); - } - - /** - * @param value {@link #born} (The actual or approximate date of birth of the relative.) - */ - public FamilyHistoryRelationComponent setBorn(Type value) { - this.born = value; - return this; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) - */ - public Type getAge() { - return this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) - */ - public Age getAgeAge() throws Exception { - if (!(this.age instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered"); - return (Age) this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) - */ - public Range getAgeRange() throws Exception { - if (!(this.age instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); - return (Range) this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) - */ - public StringType getAgeStringType() throws Exception { - if (!(this.age instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered"); - return (StringType) this.age; - } - - public boolean hasAge() { - return this.age != null && !this.age.isEmpty(); - } - - /** - * @param value {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) - */ - public FamilyHistoryRelationComponent setAge(Type value) { - this.age = value; - return this; - } - - /** - * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public Type getDeceased() { - return this.deceased; - } - - /** - * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public BooleanType getDeceasedBooleanType() throws Exception { - if (!(this.deceased instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (BooleanType) this.deceased; - } - - /** - * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public Age getDeceasedAge() throws Exception { - if (!(this.deceased instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (Age) this.deceased; - } - - /** - * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public Range getDeceasedRange() throws Exception { - if (!(this.deceased instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (Range) this.deceased; - } - - /** - * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public DateType getDeceasedDateType() throws Exception { - if (!(this.deceased instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (DateType) this.deceased; - } - - /** - * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public StringType getDeceasedStringType() throws Exception { - if (!(this.deceased instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (StringType) this.deceased; - } - - public boolean hasDeceased() { - return this.deceased != null && !this.deceased.isEmpty(); - } - - /** - * @param value {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) - */ - public FamilyHistoryRelationComponent setDeceased(Type value) { - this.deceased = value; - return this; - } - - /** - * @return {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public StringType getNoteElement() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistoryRelationComponent.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); - return this.note; - } - - public boolean hasNoteElement() { - return this.note != null && !this.note.isEmpty(); - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public FamilyHistoryRelationComponent setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - */ - public FamilyHistoryRelationComponent setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (FamilyHistoryRelationConditionComponent item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) - */ - // syntactic sugar - public FamilyHistoryRelationConditionComponent addCondition() { //3 - FamilyHistoryRelationConditionComponent t = new FamilyHistoryRelationConditionComponent(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, java.lang.Integer.MAX_VALUE, born)); - childrenList.add(new Property("age[x]", "Age|Range|string", "The actual or approximate age of the relative at the time the family history is recorded.", 0, java.lang.Integer.MAX_VALUE, age)); - childrenList.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.", 0, java.lang.Integer.MAX_VALUE, deceased)); - childrenList.add(new Property("note", "string", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition)); - } - - public FamilyHistoryRelationComponent copy() { - FamilyHistoryRelationComponent dst = new FamilyHistoryRelationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.born = born == null ? null : born.copy(); - dst.age = age == null ? null : age.copy(); - dst.deceased = deceased == null ? null : deceased.copy(); - dst.note = note == null ? null : note.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (FamilyHistoryRelationConditionComponent i : condition) - dst.condition.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (born == null || born.isEmpty()) && (age == null || age.isEmpty()) && (deceased == null || deceased.isEmpty()) - && (note == null || note.isEmpty()) && (condition == null || condition.isEmpty()); - } - - } - - @Block() - public static class FamilyHistoryRelationConditionComponent extends BackboneElement { - /** - * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Condition suffered by relation", formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system." ) - protected CodeableConcept type; - - /** - * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. - */ - @Child(name="outcome", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation." ) - protected CodeableConcept outcome; - - /** - * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. - */ - @Child(name="onset", type={Age.class, Range.class, StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence." ) - protected Type onset; - - /** - * An area where general notes can be placed about this specific condition. - */ - @Child(name="note", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." ) - protected StringType note; - - private static final long serialVersionUID = -1664709272L; - - public FamilyHistoryRelationConditionComponent() { - super(); - } - - public FamilyHistoryRelationConditionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistoryRelationConditionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) - */ - public FamilyHistoryRelationConditionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistoryRelationConditionComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) - */ - public FamilyHistoryRelationConditionComponent setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public Type getOnset() { - return this.onset; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public Age getOnsetAge() throws Exception { - if (!(this.onset instanceof Age)) - throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Age) this.onset; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public Range getOnsetRange() throws Exception { - if (!(this.onset instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Range) this.onset; - } - - /** - * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public StringType getOnsetStringType() throws Exception { - if (!(this.onset instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (StringType) this.onset; - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) - */ - public FamilyHistoryRelationConditionComponent setOnset(Type value) { - this.onset = value; - return this; - } - - /** - * @return {@link #note} (An area where general notes can be placed about this specific condition.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public StringType getNoteElement() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistoryRelationConditionComponent.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); - return this.note; - } - - public boolean hasNoteElement() { - return this.note != null && !this.note.isEmpty(); - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (An area where general notes can be placed about this specific condition.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public FamilyHistoryRelationConditionComponent setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return An area where general notes can be placed about this specific condition. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value An area where general notes can be placed about this specific condition. - */ - public FamilyHistoryRelationConditionComponent setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("onset[x]", "Age|Range|string", "Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("note", "string", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public FamilyHistoryRelationConditionComponent copy() { - FamilyHistoryRelationConditionComponent dst = new FamilyHistoryRelationConditionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.note = note == null ? null : note.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (onset == null || onset.isEmpty()) && (note == null || note.isEmpty()); - } - - } - - /** - * This records identifiers associated with this family history record 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="External Id(s) for this record", formalDefinition="This records identifiers associated with this family history record 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; - - /** - * The person who this history concerns. - */ - @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person who this history concerns.) - */ - protected Patient patientTarget; - - /** - * The date (and possibly time) when the family history was taken. - */ - @Child(name="date", type={DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family history was taken." ) - protected DateTimeType date; - - /** - * Conveys information about family history not specific to individual relations. - */ - @Child(name="note", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Additional details not covered elsewhere", formalDefinition="Conveys information about family history not specific to individual relations." ) - protected StringType note; - - /** - * The related person. Each FamilyHistory resource contains the entire family history for a single person. - */ - @Child(name="relation", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Relative described by history", formalDefinition="The related person. Each FamilyHistory resource contains the entire family history for a single person." ) - protected List relation; - - private static final long serialVersionUID = 1010516594L; - - public FamilyHistory() { - super(); - } - - public FamilyHistory(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this family history record 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 family history record 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #patient} (The person who this history concerns.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistory.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} (The person who this history concerns.) - */ - public FamilyHistory 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. (The person who this history concerns.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistory.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. (The person who this history concerns.) - */ - public FamilyHistory setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #date} (The date (and possibly time) when the family history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistory.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and possibly time) when the family history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public FamilyHistory setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and possibly time) when the family history was taken. - */ - 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(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #note} (Conveys information about family history not specific to individual relations.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public StringType getNoteElement() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyHistory.note"); - else if (Configuration.doAutoCreate()) - this.note = new StringType(); - return this.note; - } - - public boolean hasNoteElement() { - return this.note != null && !this.note.isEmpty(); - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (Conveys information about family history not specific to individual relations.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value - */ - public FamilyHistory setNoteElement(StringType value) { - this.note = value; - return this; - } - - /** - * @return Conveys information about family history not specific to individual relations. - */ - public String getNote() { - return this.note == null ? null : this.note.getValue(); - } - - /** - * @param value Conveys information about family history not specific to individual relations. - */ - public FamilyHistory setNote(String value) { - if (Utilities.noString(value)) - this.note = null; - else { - if (this.note == null) - this.note = new StringType(); - this.note.setValue(value); - } - return this; - } - - /** - * @return {@link #relation} (The related person. Each FamilyHistory resource contains the entire family history for a single person.) - */ - public List getRelation() { - if (this.relation == null) - this.relation = new ArrayList(); - return this.relation; - } - - public boolean hasRelation() { - if (this.relation == null) - return false; - for (FamilyHistoryRelationComponent item : this.relation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relation} (The related person. Each FamilyHistory resource contains the entire family history for a single person.) - */ - // syntactic sugar - public FamilyHistoryRelationComponent addRelation() { //3 - FamilyHistoryRelationComponent t = new FamilyHistoryRelationComponent(); - if (this.relation == null) - this.relation = new ArrayList(); - this.relation.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this family history record 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("patient", "Reference(Patient)", "The person who this history concerns.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("date", "dateTime", "The date (and possibly time) when the family history was taken.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("note", "string", "Conveys information about family history not specific to individual relations.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("relation", "", "The related person. Each FamilyHistory resource contains the entire family history for a single person.", 0, java.lang.Integer.MAX_VALUE, relation)); - } - - public FamilyHistory copy() { - FamilyHistory dst = new FamilyHistory(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.date = date == null ? null : date.copy(); - dst.note = note == null ? null : note.copy(); - if (relation != null) { - dst.relation = new ArrayList(); - for (FamilyHistoryRelationComponent i : relation) - dst.relation.add(i.copy()); - }; - return dst; - } - - protected FamilyHistory typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (date == null || date.isEmpty()) && (note == null || note.isEmpty()) && (relation == null || relation.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.FamilyHistory; - } - - @SearchParamDefinition(name="patient", path="FamilyHistory.patient", description="The identity of a subject to list family history items for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="date", path="FamilyHistory.date", description="When history was captured/updated", type="date" ) - public static final String SP_DATE = "date"; - -} - + +/* + 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; +/** + * Significant health events and conditions for people related to the subject relevant in the context of care for the subject. + */ +@ResourceDef(name="FamilyHistory", profile="http://hl7.org/fhir/Profile/FamilyHistory") +public class FamilyHistory extends DomainResource { + + @Block() + public static class FamilyHistoryRelationComponent extends BackboneElement { + /** + * This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The family member described", formalDefinition="This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'." ) + protected StringType name; + + /** + * The type of relationship this person has to the patient (father, mother, brother etc.). + */ + @Child(name="relationship", type={CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." ) + protected CodeableConcept relationship; + + /** + * The actual or approximate date of birth of the relative. + */ + @Child(name="born", type={Period.class, DateType.class, StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." ) + protected Type born; + + /** + * The actual or approximate age of the relative at the time the family history is recorded. + */ + @Child(name="age", type={Age.class, Range.class, StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="(approximate) age", formalDefinition="The actual or approximate age of the relative at the time the family history is recorded." ) + protected Type age; + + /** + * If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set. + */ + @Child(name="deceased", type={BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Dead? How old/when?", formalDefinition="If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set." ) + protected Type deceased; + + /** + * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + @Child(name="note", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="General note about related person", formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." ) + protected StringType note; + + /** + * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. + */ + @Child(name="condition", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Condition that the related person had", formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." ) + protected List condition; + + private static final long serialVersionUID = 211772865L; + + public FamilyHistoryRelationComponent() { + super(); + } + + public FamilyHistoryRelationComponent(CodeableConcept relationship) { + super(); + this.relationship = relationship; + } + + /** + * @return {@link #name} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistoryRelationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public FamilyHistoryRelationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + */ + public FamilyHistoryRelationComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistoryRelationComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) + */ + public FamilyHistoryRelationComponent setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public Type getBorn() { + return this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public Period getBornPeriod() throws Exception { + if (!(this.born instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered"); + return (Period) this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public DateType getBornDateType() throws Exception { + if (!(this.born instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered"); + return (DateType) this.born; + } + + /** + * @return {@link #born} (The actual or approximate date of birth of the relative.) + */ + public StringType getBornStringType() throws Exception { + if (!(this.born instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered"); + return (StringType) this.born; + } + + public boolean hasBorn() { + return this.born != null && !this.born.isEmpty(); + } + + /** + * @param value {@link #born} (The actual or approximate date of birth of the relative.) + */ + public FamilyHistoryRelationComponent setBorn(Type value) { + this.born = value; + return this; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) + */ + public Type getAge() { + return this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) + */ + public Age getAgeAge() throws Exception { + if (!(this.age instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered"); + return (Age) this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) + */ + public Range getAgeRange() throws Exception { + if (!(this.age instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); + return (Range) this.age; + } + + /** + * @return {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) + */ + public StringType getAgeStringType() throws Exception { + if (!(this.age instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered"); + return (StringType) this.age; + } + + public boolean hasAge() { + return this.age != null && !this.age.isEmpty(); + } + + /** + * @param value {@link #age} (The actual or approximate age of the relative at the time the family history is recorded.) + */ + public FamilyHistoryRelationComponent setAge(Type value) { + this.age = value; + return this; + } + + /** + * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public Type getDeceased() { + return this.deceased; + } + + /** + * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public BooleanType getDeceasedBooleanType() throws Exception { + if (!(this.deceased instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (BooleanType) this.deceased; + } + + /** + * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public Age getDeceasedAge() throws Exception { + if (!(this.deceased instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (Age) this.deceased; + } + + /** + * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public Range getDeceasedRange() throws Exception { + if (!(this.deceased instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (Range) this.deceased; + } + + /** + * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public DateType getDeceasedDateType() throws Exception { + if (!(this.deceased instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (DateType) this.deceased; + } + + /** + * @return {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public StringType getDeceasedStringType() throws Exception { + if (!(this.deceased instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (StringType) this.deceased; + } + + public boolean hasDeceased() { + return this.deceased != null && !this.deceased.isEmpty(); + } + + /** + * @param value {@link #deceased} (If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.) + */ + public FamilyHistoryRelationComponent setDeceased(Type value) { + this.deceased = value; + return this; + } + + /** + * @return {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public StringType getNoteElement() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistoryRelationComponent.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); + return this.note; + } + + public boolean hasNoteElement() { + return this.note != null && !this.note.isEmpty(); + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public FamilyHistoryRelationComponent setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + */ + public FamilyHistoryRelationComponent setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (FamilyHistoryRelationConditionComponent item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.) + */ + // syntactic sugar + public FamilyHistoryRelationConditionComponent addCondition() { //3 + FamilyHistoryRelationConditionComponent t = new FamilyHistoryRelationConditionComponent(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "This will either be a name or a description. E.g. 'Aunt Susan', 'my cousin with the red hair'.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, java.lang.Integer.MAX_VALUE, born)); + childrenList.add(new Property("age[x]", "Age|Range|string", "The actual or approximate age of the relative at the time the family history is recorded.", 0, java.lang.Integer.MAX_VALUE, age)); + childrenList.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set.", 0, java.lang.Integer.MAX_VALUE, deceased)); + childrenList.add(new Property("note", "string", "This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("condition", "", "The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.", 0, java.lang.Integer.MAX_VALUE, condition)); + } + + public FamilyHistoryRelationComponent copy() { + FamilyHistoryRelationComponent dst = new FamilyHistoryRelationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.born = born == null ? null : born.copy(); + dst.age = age == null ? null : age.copy(); + dst.deceased = deceased == null ? null : deceased.copy(); + dst.note = note == null ? null : note.copy(); + if (condition != null) { + dst.condition = new ArrayList(); + for (FamilyHistoryRelationConditionComponent i : condition) + dst.condition.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (relationship == null || relationship.isEmpty()) + && (born == null || born.isEmpty()) && (age == null || age.isEmpty()) && (deceased == null || deceased.isEmpty()) + && (note == null || note.isEmpty()) && (condition == null || condition.isEmpty()); + } + + } + + @Block() + public static class FamilyHistoryRelationConditionComponent extends BackboneElement { + /** + * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Condition suffered by relation", formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system." ) + protected CodeableConcept type; + + /** + * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. + */ + @Child(name="outcome", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="deceased | permanent disability | etc.", formalDefinition="Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation." ) + protected CodeableConcept outcome; + + /** + * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. + */ + @Child(name="onset", type={Age.class, Range.class, StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When condition first manifested", formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence." ) + protected Type onset; + + /** + * An area where general notes can be placed about this specific condition. + */ + @Child(name="note", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." ) + protected StringType note; + + private static final long serialVersionUID = -1664709272L; + + public FamilyHistoryRelationConditionComponent() { + super(); + } + + public FamilyHistoryRelationConditionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistoryRelationConditionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.) + */ + public FamilyHistoryRelationConditionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistoryRelationConditionComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) + */ + public FamilyHistoryRelationConditionComponent setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Type getOnset() { + return this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Age getOnsetAge() throws Exception { + if (!(this.onset instanceof Age)) + throw new Exception("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Age) this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public Range getOnsetRange() throws Exception { + if (!(this.onset instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (Range) this.onset; + } + + /** + * @return {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public StringType getOnsetStringType() throws Exception { + if (!(this.onset instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); + return (StringType) this.onset; + } + + public boolean hasOnset() { + return this.onset != null && !this.onset.isEmpty(); + } + + /** + * @param value {@link #onset} (Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.) + */ + public FamilyHistoryRelationConditionComponent setOnset(Type value) { + this.onset = value; + return this; + } + + /** + * @return {@link #note} (An area where general notes can be placed about this specific condition.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public StringType getNoteElement() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistoryRelationConditionComponent.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); + return this.note; + } + + public boolean hasNoteElement() { + return this.note != null && !this.note.isEmpty(); + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (An area where general notes can be placed about this specific condition.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public FamilyHistoryRelationConditionComponent setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return An area where general notes can be placed about this specific condition. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value An area where general notes can be placed about this specific condition. + */ + public FamilyHistoryRelationConditionComponent setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("onset[x]", "Age|Range|string", "Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence.", 0, java.lang.Integer.MAX_VALUE, onset)); + childrenList.add(new Property("note", "string", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public FamilyHistoryRelationConditionComponent copy() { + FamilyHistoryRelationConditionComponent dst = new FamilyHistoryRelationConditionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.onset = onset == null ? null : onset.copy(); + dst.note = note == null ? null : note.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (outcome == null || outcome.isEmpty()) + && (onset == null || onset.isEmpty()) && (note == null || note.isEmpty()); + } + + } + + /** + * This records identifiers associated with this family history record 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="External Id(s) for this record", formalDefinition="This records identifiers associated with this family history record 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; + + /** + * The person who this history concerns. + */ + @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person who this history concerns.) + */ + protected Patient patientTarget; + + /** + * The date (and possibly time) when the family history was taken. + */ + @Child(name="date", type={DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family history was taken." ) + protected DateTimeType date; + + /** + * Conveys information about family history not specific to individual relations. + */ + @Child(name="note", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Additional details not covered elsewhere", formalDefinition="Conveys information about family history not specific to individual relations." ) + protected StringType note; + + /** + * The related person. Each FamilyHistory resource contains the entire family history for a single person. + */ + @Child(name="relation", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Relative described by history", formalDefinition="The related person. Each FamilyHistory resource contains the entire family history for a single person." ) + protected List relation; + + private static final long serialVersionUID = 1010516594L; + + public FamilyHistory() { + super(); + } + + public FamilyHistory(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this family history record 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 family history record 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (The person who this history concerns.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistory.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} (The person who this history concerns.) + */ + public FamilyHistory 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. (The person who this history concerns.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistory.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. (The person who this history concerns.) + */ + public FamilyHistory setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #date} (The date (and possibly time) when the family history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistory.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and possibly time) when the family history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public FamilyHistory setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and possibly time) when the family history was taken. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #note} (Conveys information about family history not specific to individual relations.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public StringType getNoteElement() { + if (this.note == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create FamilyHistory.note"); + else if (Configuration.doAutoCreate()) + this.note = new StringType(); + return this.note; + } + + public boolean hasNoteElement() { + return this.note != null && !this.note.isEmpty(); + } + + public boolean hasNote() { + return this.note != null && !this.note.isEmpty(); + } + + /** + * @param value {@link #note} (Conveys information about family history not specific to individual relations.). This is the underlying object with id, value and extensions. The accessor "getNote" gives direct access to the value + */ + public FamilyHistory setNoteElement(StringType value) { + this.note = value; + return this; + } + + /** + * @return Conveys information about family history not specific to individual relations. + */ + public String getNote() { + return this.note == null ? null : this.note.getValue(); + } + + /** + * @param value Conveys information about family history not specific to individual relations. + */ + public FamilyHistory setNote(String value) { + if (Utilities.noString(value)) + this.note = null; + else { + if (this.note == null) + this.note = new StringType(); + this.note.setValue(value); + } + return this; + } + + /** + * @return {@link #relation} (The related person. Each FamilyHistory resource contains the entire family history for a single person.) + */ + public List getRelation() { + if (this.relation == null) + this.relation = new ArrayList(); + return this.relation; + } + + public boolean hasRelation() { + if (this.relation == null) + return false; + for (FamilyHistoryRelationComponent item : this.relation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relation} (The related person. Each FamilyHistory resource contains the entire family history for a single person.) + */ + // syntactic sugar + public FamilyHistoryRelationComponent addRelation() { //3 + FamilyHistoryRelationComponent t = new FamilyHistoryRelationComponent(); + if (this.relation == null) + this.relation = new ArrayList(); + this.relation.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this family history record 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("patient", "Reference(Patient)", "The person who this history concerns.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("date", "dateTime", "The date (and possibly time) when the family history was taken.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("note", "string", "Conveys information about family history not specific to individual relations.", 0, java.lang.Integer.MAX_VALUE, note)); + childrenList.add(new Property("relation", "", "The related person. Each FamilyHistory resource contains the entire family history for a single person.", 0, java.lang.Integer.MAX_VALUE, relation)); + } + + public FamilyHistory copy() { + FamilyHistory dst = new FamilyHistory(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.date = date == null ? null : date.copy(); + dst.note = note == null ? null : note.copy(); + if (relation != null) { + dst.relation = new ArrayList(); + for (FamilyHistoryRelationComponent i : relation) + dst.relation.add(i.copy()); + }; + return dst; + } + + protected FamilyHistory typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (date == null || date.isEmpty()) && (note == null || note.isEmpty()) && (relation == null || relation.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.FamilyHistory; + } + + @SearchParamDefinition(name="patient", path="FamilyHistory.patient", description="The identity of a subject to list family history items for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="date", path="FamilyHistory.date", description="When history was captured/updated", type="date" ) + public static final String SP_DATE = "date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java index 048288dad4e..b3c66a722a8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java @@ -20,47 +20,47 @@ package org.hl7.fhir.instance.model; * #L% */ - - -/* -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 - * @return the XML/JSON representation - */ - public String toCode(); - -} + + +/* +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 + * @return the XML/JSON representation + */ + public String toCode(); + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java index 75c8fdb13a3..b4ea5a31581 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java @@ -20,534 +20,534 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 { - 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; - - /** - * 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 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 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 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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(); - 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 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(); - 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 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.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 getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - 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(); - 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 getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - 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(); - this.concernTarget.add(r); - return r; - } - - protected void listChildren(List 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(); - 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(); - 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"; - -} - + +/* + 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 { + 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; + + /** + * 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 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 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 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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(); + 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 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(); + 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 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.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 getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + 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(); + 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 getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + 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(); + this.concernTarget.add(r); + return r; + } + + protected void listChildren(List 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(); + 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(); + 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"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java index 4b3bf0e1cda..115f0d20598 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java @@ -20,683 +20,683 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 { - 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 { - 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; - - /** - * 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 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 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 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 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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(); - 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 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(); - 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 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.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 getConcern() { - if (this.concern == null) - this.concern = new ArrayList(); - 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(); - 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 getConcernTarget() { - if (this.concernTarget == null) - this.concernTarget = new ArrayList(); - 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(); - 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 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(); - 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 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.ENUM_FACTORY); - this.mode.setValue(value); - } - return this; - } - - protected void listChildren(List 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(); - 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(); - 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"; - -} - + +/* + 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 { + 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 { + 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; + + /** + * 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 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 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 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 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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(); + 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 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(); + 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 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.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 getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + 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(); + 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 getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + 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(); + 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 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(); + 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 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.ENUM_FACTORY); + this.mode.setValue(value); + } + return this; + } + + protected void listChildren(List 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(); + 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(); + 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"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java index 06a5dd9708d..5c1999fe2bc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java @@ -20,813 +20,813 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. - */ -@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") -public class Group extends DomainResource { - - public enum GroupType implements FhirEnum { - /** - * Group contains "person" Patient resources. - */ - PERSON, - /** - * Group contains "animal" Patient resources. - */ - ANIMAL, - /** - * Group contains healthcare practitioner resources. - */ - PRACTITIONER, - /** - * Group contains Device resources. - */ - DEVICE, - /** - * Group contains Medication resources. - */ - MEDICATION, - /** - * Group contains Substance resources. - */ - SUBSTANCE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PERSON; - if ("animal".equals(codeString)) - return ANIMAL; - if ("practitioner".equals(codeString)) - return PRACTITIONER; - if ("device".equals(codeString)) - return DEVICE; - if ("medication".equals(codeString)) - return MEDICATION; - if ("substance".equals(codeString)) - return SUBSTANCE; - throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PERSON: return "person"; - case ANIMAL: return "animal"; - case PRACTITIONER: return "practitioner"; - case DEVICE: return "device"; - case MEDICATION: return "medication"; - case SUBSTANCE: return "substance"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PERSON: return ""; - case ANIMAL: return ""; - case PRACTITIONER: return ""; - case DEVICE: return ""; - case MEDICATION: return ""; - case SUBSTANCE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PERSON: return "Group contains 'person' Patient resources."; - case ANIMAL: return "Group contains 'animal' Patient resources."; - case PRACTITIONER: return "Group contains healthcare practitioner resources."; - case DEVICE: return "Group contains Device resources."; - case MEDICATION: return "Group contains Medication resources."; - case SUBSTANCE: return "Group contains Substance resources."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PERSON: return "person"; - case ANIMAL: return "animal"; - case PRACTITIONER: return "practitioner"; - case DEVICE: return "device"; - case MEDICATION: return "medication"; - case SUBSTANCE: return "substance"; - default: return "?"; - } - } - } - - public static class GroupTypeEnumFactory implements EnumFactory { - public GroupType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("person".equals(codeString)) - return GroupType.PERSON; - if ("animal".equals(codeString)) - return GroupType.ANIMAL; - if ("practitioner".equals(codeString)) - return GroupType.PRACTITIONER; - if ("device".equals(codeString)) - return GroupType.DEVICE; - if ("medication".equals(codeString)) - return GroupType.MEDICATION; - if ("substance".equals(codeString)) - return GroupType.SUBSTANCE; - throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); - } - public String toCode(GroupType code) throws IllegalArgumentException { - if (code == GroupType.PERSON) - return "person"; - if (code == GroupType.ANIMAL) - return "animal"; - if (code == GroupType.PRACTITIONER) - return "practitioner"; - if (code == GroupType.DEVICE) - return "device"; - if (code == GroupType.MEDICATION) - return "medication"; - if (code == GroupType.SUBSTANCE) - return "substance"; - return "?"; - } - } - - @Block() - public static class GroupCharacteristicComponent extends BackboneElement { - /** - * A code that identifies the kind of trait being asserted. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." ) - protected CodeableConcept code; - - /** - * The value of the trait that holds (or does not hold - see 'exclude') for members of the group. - */ - @Child(name="value", type={CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1) - @Description(shortDefinition="Value held by characteristic", formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group." ) - protected Type value; - - /** - * If true, indicates the characteristic is one that is NOT held by members of the group. - */ - @Child(name="exclude", type={BooleanType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." ) - protected BooleanType exclude; - - private static final long serialVersionUID = 803478031L; - - public GroupCharacteristicComponent() { - super(); - } - - public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) { - super(); - this.code = code; - this.value = value; - this.exclude = exclude; - } - - /** - * @return {@link #code} (A code that identifies the kind of trait being asserted.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that identifies the kind of trait being asserted.) - */ - public GroupCharacteristicComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public CodeableConcept getValueCodeableConcept() throws Exception { - if (!(this.value instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public BooleanType getValueBooleanType() throws Exception { - if (!(this.value instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Quantity getValueQuantity() throws Exception { - if (!(this.value instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Range getValueRange() throws Exception { - if (!(this.value instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public GroupCharacteristicComponent setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value - */ - public BooleanType getExcludeElement() { - if (this.exclude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude"); - else if (Configuration.doAutoCreate()) - this.exclude = new BooleanType(); - return this.exclude; - } - - public boolean hasExcludeElement() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - public boolean hasExclude() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - /** - * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value - */ - public GroupCharacteristicComponent setExcludeElement(BooleanType value) { - this.exclude = value; - return this; - } - - /** - * @return If true, indicates the characteristic is one that is NOT held by members of the group. - */ - public boolean getExclude() { - return this.exclude == null ? false : this.exclude.getValue(); - } - - /** - * @param value If true, indicates the characteristic is one that is NOT held by members of the group. - */ - public GroupCharacteristicComponent setExclude(boolean value) { - if (this.exclude == null) - this.exclude = new BooleanType(); - this.exclude.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - public GroupCharacteristicComponent copy() { - GroupCharacteristicComponent dst = new GroupCharacteristicComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - dst.exclude = exclude == null ? null : exclude.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - && (exclude == null || exclude.isEmpty()); - } - - } - - /** - * A unique business identifier for this group. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." ) - protected Identifier identifier; - - /** - * Identifies the broad classification of the kind of resources the group includes. - */ - @Child(name="type", type={CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." ) - protected Enumeration type; - - /** - * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - @Child(name="actual", type={BooleanType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Descriptive or actual", formalDefinition="If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals." ) - protected BooleanType actual; - - /** - * Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc. - */ - @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc." ) - protected CodeableConcept code; - - /** - * A label assigned to the group for human identification and communication. - */ - @Child(name="name", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." ) - protected StringType name; - - /** - * A count of the number of resource instances that are part of the group. - */ - @Child(name="quantity", type={IntegerType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." ) - protected IntegerType quantity; - - /** - * Identifies the traits shared by members of the group. - */ - @Child(name="characteristic", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Trait of group members", formalDefinition="Identifies the traits shared by members of the group." ) - protected List characteristic; - - /** - * Identifies the resource instances that are members of the group. - */ - @Child(name="member", type={Patient.class, Practitioner.class, Device.class, Medication.class, Substance.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who is in group", formalDefinition="Identifies the resource instances that are members of the group." ) - protected List member; - /** - * The actual objects that are the target of the reference (Identifies the resource instances that are members of the group.) - */ - protected List memberTarget; - - - private static final long serialVersionUID = 45096653L; - - public Group() { - super(); - } - - public Group(Enumeration type, BooleanType actual) { - super(); - this.type = type; - this.actual = actual; - } - - /** - * @return {@link #identifier} (A unique business identifier for this group.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A unique business identifier for this group.) - */ - public Group setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Group setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the broad classification of the kind of resources the group includes. - */ - public GroupType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the broad classification of the kind of resources the group includes. - */ - public Group setType(GroupType value) { - if (this.type == null) - this.type = new Enumeration(GroupType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value - */ - public BooleanType getActualElement() { - if (this.actual == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.actual"); - else if (Configuration.doAutoCreate()) - this.actual = new BooleanType(); - return this.actual; - } - - public boolean hasActualElement() { - return this.actual != null && !this.actual.isEmpty(); - } - - public boolean hasActual() { - return this.actual != null && !this.actual.isEmpty(); - } - - /** - * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value - */ - public Group setActualElement(BooleanType value) { - this.actual = value; - return this; - } - - /** - * @return If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - public boolean getActual() { - return this.actual == null ? false : this.actual.getValue(); - } - - /** - * @param value If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - public Group setActual(boolean value) { - if (this.actual == null) - this.actual = new BooleanType(); - this.actual.setValue(value); - return this; - } - - /** - * @return {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) - */ - public Group setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Group setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A label assigned to the group for human identification and communication. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A label assigned to the group for human identification and communication. - */ - public Group setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value - */ - public IntegerType getQuantityElement() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new IntegerType(); - return this.quantity; - } - - public boolean hasQuantityElement() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value - */ - public Group setQuantityElement(IntegerType value) { - this.quantity = value; - return this; - } - - /** - * @return A count of the number of resource instances that are part of the group. - */ - public int getQuantity() { - return this.quantity == null ? null : this.quantity.getValue(); - } - - /** - * @param value A count of the number of resource instances that are part of the group. - */ - public Group setQuantity(int value) { - if (value == -1) - this.quantity = null; - else { - if (this.quantity == null) - this.quantity = new IntegerType(); - this.quantity.setValue(value); - } - return this; - } - - /** - * @return {@link #characteristic} (Identifies the traits shared by members of the group.) - */ - public List getCharacteristic() { - if (this.characteristic == null) - this.characteristic = new ArrayList(); - return this.characteristic; - } - - public boolean hasCharacteristic() { - if (this.characteristic == null) - return false; - for (GroupCharacteristicComponent item : this.characteristic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #characteristic} (Identifies the traits shared by members of the group.) - */ - // syntactic sugar - public GroupCharacteristicComponent addCharacteristic() { //3 - GroupCharacteristicComponent t = new GroupCharacteristicComponent(); - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return t; - } - - /** - * @return {@link #member} (Identifies the resource instances that are members of the group.) - */ - public List getMember() { - if (this.member == null) - this.member = new ArrayList(); - return this.member; - } - - public boolean hasMember() { - if (this.member == null) - return false; - for (Reference item : this.member) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #member} (Identifies the resource instances that are members of the group.) - */ - // syntactic sugar - public Reference addMember() { //3 - Reference t = new Reference(); - if (this.member == null) - this.member = new ArrayList(); - this.member.add(t); - return t; - } - - /** - * @return {@link #member} (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 resource instances that are members of the group.) - */ - public List getMemberTarget() { - if (this.memberTarget == null) - this.memberTarget = new ArrayList(); - return this.memberTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.", 0, java.lang.Integer.MAX_VALUE, actual)); - childrenList.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("quantity", "integer", "A count of the number of resource instances that are part of the group.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("characteristic", "", "Identifies the traits shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic)); - childrenList.add(new Property("member", "Reference(Patient|Practitioner|Device|Medication|Substance)", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member)); - } - - public Group copy() { - Group dst = new Group(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.type = type == null ? null : type.copy(); - dst.actual = actual == null ? null : actual.copy(); - dst.code = code == null ? null : code.copy(); - dst.name = name == null ? null : name.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - if (characteristic != null) { - dst.characteristic = new ArrayList(); - for (GroupCharacteristicComponent i : characteristic) - dst.characteristic.add(i.copy()); - }; - if (member != null) { - dst.member = new ArrayList(); - for (Reference i : member) - dst.member.add(i.copy()); - }; - return dst; - } - - protected Group typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (actual == null || actual.isEmpty()) && (code == null || code.isEmpty()) && (name == null || name.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (characteristic == null || characteristic.isEmpty()) - && (member == null || member.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Group; - } - - @SearchParamDefinition(name="member", path="Group.member", description="Who is in group", type="reference" ) - public static final String SP_MEMBER = "member"; - @SearchParamDefinition(name="characteristic-value", path="", description="A composite of both characteristic and value", type="composite" ) - public static final String SP_CHARACTERISTICVALUE = "characteristic-value"; - @SearchParamDefinition(name="value", path="Group.characteristic.value[x]", description="Value held by characteristic", type="token" ) - public static final String SP_VALUE = "value"; - @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" ) - public static final String SP_ACTUAL = "actual"; - @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" ) - public static final String SP_EXCLUDE = "exclude"; - @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" ) - public static final String SP_CHARACTERISTIC = "characteristic"; - @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. + */ +@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") +public class Group extends DomainResource { + + public enum GroupType implements FhirEnum { + /** + * Group contains "person" Patient resources. + */ + PERSON, + /** + * Group contains "animal" Patient resources. + */ + ANIMAL, + /** + * Group contains healthcare practitioner resources. + */ + PRACTITIONER, + /** + * Group contains Device resources. + */ + DEVICE, + /** + * Group contains Medication resources. + */ + MEDICATION, + /** + * Group contains Substance resources. + */ + SUBSTANCE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PERSON; + if ("animal".equals(codeString)) + return ANIMAL; + if ("practitioner".equals(codeString)) + return PRACTITIONER; + if ("device".equals(codeString)) + return DEVICE; + if ("medication".equals(codeString)) + return MEDICATION; + if ("substance".equals(codeString)) + return SUBSTANCE; + throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PERSON: return "person"; + case ANIMAL: return "animal"; + case PRACTITIONER: return "practitioner"; + case DEVICE: return "device"; + case MEDICATION: return "medication"; + case SUBSTANCE: return "substance"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PERSON: return ""; + case ANIMAL: return ""; + case PRACTITIONER: return ""; + case DEVICE: return ""; + case MEDICATION: return ""; + case SUBSTANCE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PERSON: return "Group contains 'person' Patient resources."; + case ANIMAL: return "Group contains 'animal' Patient resources."; + case PRACTITIONER: return "Group contains healthcare practitioner resources."; + case DEVICE: return "Group contains Device resources."; + case MEDICATION: return "Group contains Medication resources."; + case SUBSTANCE: return "Group contains Substance resources."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PERSON: return "person"; + case ANIMAL: return "animal"; + case PRACTITIONER: return "practitioner"; + case DEVICE: return "device"; + case MEDICATION: return "medication"; + case SUBSTANCE: return "substance"; + default: return "?"; + } + } + } + + public static class GroupTypeEnumFactory implements EnumFactory { + public GroupType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("person".equals(codeString)) + return GroupType.PERSON; + if ("animal".equals(codeString)) + return GroupType.ANIMAL; + if ("practitioner".equals(codeString)) + return GroupType.PRACTITIONER; + if ("device".equals(codeString)) + return GroupType.DEVICE; + if ("medication".equals(codeString)) + return GroupType.MEDICATION; + if ("substance".equals(codeString)) + return GroupType.SUBSTANCE; + throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); + } + public String toCode(GroupType code) throws IllegalArgumentException { + if (code == GroupType.PERSON) + return "person"; + if (code == GroupType.ANIMAL) + return "animal"; + if (code == GroupType.PRACTITIONER) + return "practitioner"; + if (code == GroupType.DEVICE) + return "device"; + if (code == GroupType.MEDICATION) + return "medication"; + if (code == GroupType.SUBSTANCE) + return "substance"; + return "?"; + } + } + + @Block() + public static class GroupCharacteristicComponent extends BackboneElement { + /** + * A code that identifies the kind of trait being asserted. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." ) + protected CodeableConcept code; + + /** + * The value of the trait that holds (or does not hold - see 'exclude') for members of the group. + */ + @Child(name="value", type={CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1) + @Description(shortDefinition="Value held by characteristic", formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group." ) + protected Type value; + + /** + * If true, indicates the characteristic is one that is NOT held by members of the group. + */ + @Child(name="exclude", type={BooleanType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." ) + protected BooleanType exclude; + + private static final long serialVersionUID = 803478031L; + + public GroupCharacteristicComponent() { + super(); + } + + public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) { + super(); + this.code = code; + this.value = value; + this.exclude = exclude; + } + + /** + * @return {@link #code} (A code that identifies the kind of trait being asserted.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code that identifies the kind of trait being asserted.) + */ + public GroupCharacteristicComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public CodeableConcept getValueCodeableConcept() throws Exception { + if (!(this.value instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public BooleanType getValueBooleanType() throws Exception { + if (!(this.value instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public Range getValueRange() throws Exception { + if (!(this.value instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Range) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) + */ + public GroupCharacteristicComponent setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value + */ + public BooleanType getExcludeElement() { + if (this.exclude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude"); + else if (Configuration.doAutoCreate()) + this.exclude = new BooleanType(); + return this.exclude; + } + + public boolean hasExcludeElement() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + public boolean hasExclude() { + return this.exclude != null && !this.exclude.isEmpty(); + } + + /** + * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value + */ + public GroupCharacteristicComponent setExcludeElement(BooleanType value) { + this.exclude = value; + return this; + } + + /** + * @return If true, indicates the characteristic is one that is NOT held by members of the group. + */ + public boolean getExclude() { + return this.exclude == null ? false : this.exclude.getValue(); + } + + /** + * @param value If true, indicates the characteristic is one that is NOT held by members of the group. + */ + public GroupCharacteristicComponent setExclude(boolean value) { + if (this.exclude == null) + this.exclude = new BooleanType(); + this.exclude.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + public GroupCharacteristicComponent copy() { + GroupCharacteristicComponent dst = new GroupCharacteristicComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + dst.exclude = exclude == null ? null : exclude.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + && (exclude == null || exclude.isEmpty()); + } + + } + + /** + * A unique business identifier for this group. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." ) + protected Identifier identifier; + + /** + * Identifies the broad classification of the kind of resources the group includes. + */ + @Child(name="type", type={CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." ) + protected Enumeration type; + + /** + * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + @Child(name="actual", type={BooleanType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Descriptive or actual", formalDefinition="If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals." ) + protected BooleanType actual; + + /** + * Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc. + */ + @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc." ) + protected CodeableConcept code; + + /** + * A label assigned to the group for human identification and communication. + */ + @Child(name="name", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." ) + protected StringType name; + + /** + * A count of the number of resource instances that are part of the group. + */ + @Child(name="quantity", type={IntegerType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." ) + protected IntegerType quantity; + + /** + * Identifies the traits shared by members of the group. + */ + @Child(name="characteristic", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Trait of group members", formalDefinition="Identifies the traits shared by members of the group." ) + protected List characteristic; + + /** + * Identifies the resource instances that are members of the group. + */ + @Child(name="member", type={Patient.class, Practitioner.class, Device.class, Medication.class, Substance.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who is in group", formalDefinition="Identifies the resource instances that are members of the group." ) + protected List member; + /** + * The actual objects that are the target of the reference (Identifies the resource instances that are members of the group.) + */ + protected List memberTarget; + + + private static final long serialVersionUID = 45096653L; + + public Group() { + super(); + } + + public Group(Enumeration type, BooleanType actual) { + super(); + this.type = type; + this.actual = actual; + } + + /** + * @return {@link #identifier} (A unique business identifier for this group.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A unique business identifier for this group.) + */ + public Group setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Group setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the broad classification of the kind of resources the group includes. + */ + public GroupType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the broad classification of the kind of resources the group includes. + */ + public Group setType(GroupType value) { + if (this.type == null) + this.type = new Enumeration(GroupType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value + */ + public BooleanType getActualElement() { + if (this.actual == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.actual"); + else if (Configuration.doAutoCreate()) + this.actual = new BooleanType(); + return this.actual; + } + + public boolean hasActualElement() { + return this.actual != null && !this.actual.isEmpty(); + } + + public boolean hasActual() { + return this.actual != null && !this.actual.isEmpty(); + } + + /** + * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value + */ + public Group setActualElement(BooleanType value) { + this.actual = value; + return this; + } + + /** + * @return If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + public boolean getActual() { + return this.actual == null ? false : this.actual.getValue(); + } + + /** + * @param value If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + */ + public Group setActual(boolean value) { + if (this.actual == null) + this.actual = new BooleanType(); + this.actual.setValue(value); + return this; + } + + /** + * @return {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc.) + */ + public Group setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Group setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A label assigned to the group for human identification and communication. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A label assigned to the group for human identification and communication. + */ + public Group setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value + */ + public IntegerType getQuantityElement() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Group.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new IntegerType(); + return this.quantity; + } + + public boolean hasQuantityElement() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value + */ + public Group setQuantityElement(IntegerType value) { + this.quantity = value; + return this; + } + + /** + * @return A count of the number of resource instances that are part of the group. + */ + public int getQuantity() { + return this.quantity == null ? null : this.quantity.getValue(); + } + + /** + * @param value A count of the number of resource instances that are part of the group. + */ + public Group setQuantity(int value) { + if (value == -1) + this.quantity = null; + else { + if (this.quantity == null) + this.quantity = new IntegerType(); + this.quantity.setValue(value); + } + return this; + } + + /** + * @return {@link #characteristic} (Identifies the traits shared by members of the group.) + */ + public List getCharacteristic() { + if (this.characteristic == null) + this.characteristic = new ArrayList(); + return this.characteristic; + } + + public boolean hasCharacteristic() { + if (this.characteristic == null) + return false; + for (GroupCharacteristicComponent item : this.characteristic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #characteristic} (Identifies the traits shared by members of the group.) + */ + // syntactic sugar + public GroupCharacteristicComponent addCharacteristic() { //3 + GroupCharacteristicComponent t = new GroupCharacteristicComponent(); + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return t; + } + + /** + * @return {@link #member} (Identifies the resource instances that are members of the group.) + */ + public List getMember() { + if (this.member == null) + this.member = new ArrayList(); + return this.member; + } + + public boolean hasMember() { + if (this.member == null) + return false; + for (Reference item : this.member) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #member} (Identifies the resource instances that are members of the group.) + */ + // syntactic sugar + public Reference addMember() { //3 + Reference t = new Reference(); + if (this.member == null) + this.member = new ArrayList(); + this.member.add(t); + return t; + } + + /** + * @return {@link #member} (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 resource instances that are members of the group.) + */ + public List getMemberTarget() { + if (this.memberTarget == null) + this.memberTarget = new ArrayList(); + return this.memberTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.", 0, java.lang.Integer.MAX_VALUE, actual)); + childrenList.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes. E.g. 'cow', 'syringe', etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("quantity", "integer", "A count of the number of resource instances that are part of the group.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("characteristic", "", "Identifies the traits shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic)); + childrenList.add(new Property("member", "Reference(Patient|Practitioner|Device|Medication|Substance)", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member)); + } + + public Group copy() { + Group dst = new Group(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.type = type == null ? null : type.copy(); + dst.actual = actual == null ? null : actual.copy(); + dst.code = code == null ? null : code.copy(); + dst.name = name == null ? null : name.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + if (characteristic != null) { + dst.characteristic = new ArrayList(); + for (GroupCharacteristicComponent i : characteristic) + dst.characteristic.add(i.copy()); + }; + if (member != null) { + dst.member = new ArrayList(); + for (Reference i : member) + dst.member.add(i.copy()); + }; + return dst; + } + + protected Group typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (actual == null || actual.isEmpty()) && (code == null || code.isEmpty()) && (name == null || name.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (characteristic == null || characteristic.isEmpty()) + && (member == null || member.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Group; + } + + @SearchParamDefinition(name="member", path="Group.member", description="Who is in group", type="reference" ) + public static final String SP_MEMBER = "member"; + @SearchParamDefinition(name="characteristic-value", path="", description="A composite of both characteristic and value", type="composite" ) + public static final String SP_CHARACTERISTICVALUE = "characteristic-value"; + @SearchParamDefinition(name="value", path="Group.characteristic.value[x]", description="Value held by characteristic", type="token" ) + public static final String SP_VALUE = "value"; + @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" ) + public static final String SP_ACTUAL = "actual"; + @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" ) + public static final String SP_EXCLUDE = "exclude"; + @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" ) + public static final String SP_CHARACTERISTIC = "characteristic"; + @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java index 7f8fa33acb7..327d0384efd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java @@ -20,1834 +20,1834 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * (informative) The details of a Healthcare Service available at a location. - */ -@ResourceDef(name="HealthcareService", profile="http://hl7.org/fhir/Profile/HealthcareService") -public class HealthcareService extends DomainResource { - - @Block() - public static class ServiceTypeComponent extends BackboneElement { - /** - * The specific type of service being delivered or performed. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="The specific type of service being delivered or performed", formalDefinition="The specific type of service being delivered or performed." ) - protected CodeableConcept type; - - /** - * Collection of Specialties handled by the Service Site. This is more of a Medical Term. - */ - @Child(name="specialty", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term", formalDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term." ) - protected List specialty; - - private static final long serialVersionUID = 1703986174L; - - public ServiceTypeComponent() { - super(); - } - - public ServiceTypeComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The specific type of service being delivered or performed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ServiceTypeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The specific type of service being delivered or performed.) - */ - public ServiceTypeComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The specific type of service being delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("specialty", "CodeableConcept", "Collection of Specialties handled by the Service Site. This is more of a Medical Term.", 0, java.lang.Integer.MAX_VALUE, specialty)); - } - - public ServiceTypeComponent copy() { - ServiceTypeComponent dst = new ServiceTypeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) - ; - } - - } - - @Block() - public static class HealthcareServiceAvailableTimeComponent extends BackboneElement { - /** - * Indicates which Days of the week are available between the Start and End Times. - */ - @Child(name="daysOfWeek", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indicates which Days of the week are available between the Start and End Times", formalDefinition="Indicates which Days of the week are available between the Start and End Times." ) - protected List daysOfWeek; - - /** - * Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - @Child(name="allDay", type={BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) - protected BooleanType allDay; - - /** - * The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name="availableStartTime", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored." ) - protected DateTimeType availableStartTime; - - /** - * The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name="availableEndTime", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored." ) - protected DateTimeType availableEndTime; - - private static final long serialVersionUID = 1384198535L; - - public HealthcareServiceAvailableTimeComponent() { - super(); - } - - /** - * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) - */ - public List getDaysOfWeek() { - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList(); - return this.daysOfWeek; - } - - public boolean hasDaysOfWeek() { - if (this.daysOfWeek == null) - return false; - for (CodeableConcept item : this.daysOfWeek) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) - */ - // syntactic sugar - public CodeableConcept addDaysOfWeek() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList(); - this.daysOfWeek.add(t); - return t; - } - - /** - * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public BooleanType getAllDayElement() { - if (this.allDay == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay"); - else if (Configuration.doAutoCreate()) - this.allDay = new BooleanType(); - return this.allDay; - } - - public boolean hasAllDayElement() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - public boolean hasAllDay() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - /** - * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) { - this.allDay = value; - return this; - } - - /** - * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public boolean getAllDay() { - return this.allDay == null ? false : this.allDay.getValue(); - } - - /** - * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) { - if (value == false) - this.allDay = null; - else { - if (this.allDay == null) - this.allDay = new BooleanType(); - this.allDay.setValue(value); - } - return this; - } - - /** - * @return {@link #availableStartTime} (The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public DateTimeType getAvailableStartTimeElement() { - if (this.availableStartTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime"); - else if (Configuration.doAutoCreate()) - this.availableStartTime = new DateTimeType(); - return this.availableStartTime; - } - - public boolean hasAvailableStartTimeElement() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - public boolean hasAvailableStartTime() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - /** - * @param value {@link #availableStartTime} (The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(DateTimeType value) { - this.availableStartTime = value; - return this; - } - - /** - * @return The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. - */ - 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(Date value) { - if (value == null) - this.availableStartTime = null; - else { - if (this.availableStartTime == null) - this.availableStartTime = new DateTimeType(); - this.availableStartTime.setValue(value); - } - return this; - } - - /** - * @return {@link #availableEndTime} (The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public DateTimeType getAvailableEndTimeElement() { - if (this.availableEndTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime"); - else if (Configuration.doAutoCreate()) - this.availableEndTime = new DateTimeType(); - return this.availableEndTime; - } - - public boolean hasAvailableEndTimeElement() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - public boolean hasAvailableEndTime() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - /** - * @param value {@link #availableEndTime} (The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(DateTimeType value) { - this.availableEndTime = value; - return this; - } - - /** - * @return The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. - */ - 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(Date value) { - if (value == null) - this.availableEndTime = null; - else { - if (this.availableEndTime == null) - this.availableEndTime = new DateTimeType(); - this.availableEndTime.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("daysOfWeek", "CodeableConcept", "Indicates which Days of the week are available between the Start and End Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); - childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); - childrenList.add(new Property("availableStartTime", "dateTime", "The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); - childrenList.add(new Property("availableEndTime", "dateTime", "The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); - } - - public HealthcareServiceAvailableTimeComponent copy() { - HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent(); - copyValues(dst); - if (daysOfWeek != null) { - dst.daysOfWeek = new ArrayList(); - for (CodeableConcept i : daysOfWeek) - dst.daysOfWeek.add(i.copy()); - }; - dst.allDay = allDay == null ? null : allDay.copy(); - dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); - dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) - && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) - ; - } - - } - - @Block() - public static class HealthcareServiceNotAvailableTimeComponent extends BackboneElement { - /** - * The reason that can be presented to the user as to why this time is not available. - */ - @Child(name="description", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="The reason that can be presented to the user as to why this time is not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) - protected StringType description; - - /** - * Service is not available (seasonally or for a public holiday) from this date. - */ - @Child(name="startDate", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Service is not available (seasonally or for a public holiday) from this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) - protected DateTimeType startDate; - - /** - * Service is not available (seasonally or for a public holiday) until this date. - */ - @Child(name="endDate", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Service is not available (seasonally or for a public holiday) until this date", formalDefinition="Service is not available (seasonally or for a public holiday) until this date." ) - protected DateTimeType endDate; - - private static final long serialVersionUID = -1448794L; - - public HealthcareServiceNotAvailableTimeComponent() { - super(); - } - - public HealthcareServiceNotAvailableTimeComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). 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 HealthcareServiceNotAvailableTimeComponent.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} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public HealthcareServiceNotAvailableTimeComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason that can be presented to the user as to why this time is not available. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason that can be presented to the user as to why this time is not available. - */ - public HealthcareServiceNotAvailableTimeComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #startDate} (Service is not available (seasonally or for a public holiday) from this date.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value - */ - public DateTimeType getStartDateElement() { - if (this.startDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceNotAvailableTimeComponent.startDate"); - else if (Configuration.doAutoCreate()) - this.startDate = new DateTimeType(); - return this.startDate; - } - - public boolean hasStartDateElement() { - return this.startDate != null && !this.startDate.isEmpty(); - } - - public boolean hasStartDate() { - return this.startDate != null && !this.startDate.isEmpty(); - } - - /** - * @param value {@link #startDate} (Service is not available (seasonally or for a public holiday) from this date.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value - */ - public HealthcareServiceNotAvailableTimeComponent setStartDateElement(DateTimeType value) { - this.startDate = value; - return this; - } - - /** - * @return Service is not available (seasonally or for a public holiday) from this date. - */ - 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(Date value) { - if (value == null) - this.startDate = null; - else { - if (this.startDate == null) - this.startDate = new DateTimeType(); - this.startDate.setValue(value); - } - return this; - } - - /** - * @return {@link #endDate} (Service is not available (seasonally or for a public holiday) until this date.). This is the underlying object with id, value and extensions. The accessor "getEndDate" gives direct access to the value - */ - public DateTimeType getEndDateElement() { - if (this.endDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceNotAvailableTimeComponent.endDate"); - else if (Configuration.doAutoCreate()) - this.endDate = new DateTimeType(); - return this.endDate; - } - - public boolean hasEndDateElement() { - return this.endDate != null && !this.endDate.isEmpty(); - } - - public boolean hasEndDate() { - return this.endDate != null && !this.endDate.isEmpty(); - } - - /** - * @param value {@link #endDate} (Service is not available (seasonally or for a public holiday) until this date.). This is the underlying object with id, value and extensions. The accessor "getEndDate" gives direct access to the value - */ - public HealthcareServiceNotAvailableTimeComponent setEndDateElement(DateTimeType value) { - this.endDate = value; - return this; - } - - /** - * @return Service is not available (seasonally or for a public holiday) until this date. - */ - 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(Date value) { - if (value == null) - this.endDate = null; - else { - if (this.endDate == null) - this.endDate = new DateTimeType(); - this.endDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("startDate", "dateTime", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, startDate)); - childrenList.add(new Property("endDate", "dateTime", "Service is not available (seasonally or for a public holiday) until this date.", 0, java.lang.Integer.MAX_VALUE, endDate)); - } - - public HealthcareServiceNotAvailableTimeComponent copy() { - HealthcareServiceNotAvailableTimeComponent dst = new HealthcareServiceNotAvailableTimeComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.startDate = startDate == null ? null : startDate.copy(); - dst.endDate = endDate == null ? null : endDate.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (startDate == null || startDate.isEmpty()) - && (endDate == null || endDate.isEmpty()); - } - - } - - /** - * External Ids for this item. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * The location where this healthcare service may be provided. - */ - @Child(name="location", type={Location.class}, order=0, min=1, max=1) - @Description(shortDefinition="The location where this healthcare service may be provided", formalDefinition="The location where this healthcare service may be provided." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where this healthcare service may be provided.) - */ - protected Location locationTarget; - - /** - * Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type. - */ - @Child(name="serviceCategory", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type", formalDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type." ) - protected CodeableConcept serviceCategory; - - /** - * A specific type of service that may be delivered or performed. - */ - @Child(name="serviceType", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A specific type of service that may be delivered or performed", formalDefinition="A specific type of service that may be delivered or performed." ) - protected List serviceType; - - /** - * Further description of the service as it would be presented to a consumer while searching. - */ - @Child(name="serviceName", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Further description of the service as it would be presented to a consumer while searching", formalDefinition="Further description of the service as it would be presented to a consumer while searching." ) - protected StringType serviceName; - - /** - * Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - @Child(name="comment", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName", formalDefinition="Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName." ) - protected StringType comment; - - /** - * Extra details about the service that can't be placed in the other fields. - */ - @Child(name="extraDetails", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Extra details about the service that can't be placed in the other fields", formalDefinition="Extra details about the service that can't be placed in the other fields." ) - protected StringType extraDetails; - - /** - * The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type. - */ - @Child(name="freeProvisionCode", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type", formalDefinition="The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type." ) - protected CodeableConcept freeProvisionCode; - - /** - * Does this service have specific eligibility requirements that need to be met in order to use the service. - */ - @Child(name="eligibility", type={CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service", formalDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service." ) - protected CodeableConcept eligibility; - - /** - * The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. - */ - @Child(name="eligibilityNote", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Describes the eligibility conditions for the service", formalDefinition="The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page." ) - protected StringType eligibilityNote; - - /** - * Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum). - */ - @Child(name="appointmentRequired", type={CodeableConcept.class}, order=9, min=0, max=1) - @Description(shortDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum)", formalDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum)." ) - protected CodeableConcept appointmentRequired; - - /** - * If there is an image associated with this Service Site, its URI can be included here. - */ - @Child(name="imageURI", type={UriType.class}, order=10, min=0, max=1) - @Description(shortDefinition="If there is an image associated with this Service Site, its URI can be included here", formalDefinition="If there is an image associated with this Service Site, its URI can be included here." ) - protected UriType imageURI; - - /** - * A Collection of times that the Service Site is available. - */ - @Child(name="availableTime", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Collection of times that the Service Site is available", formalDefinition="A Collection of times that the Service Site is available." ) - protected List availableTime; - - /** - * Not avail times - need better description. - */ - @Child(name="notAvailableTime", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Not avail times - need better description", formalDefinition="Not avail times - need better description." ) - protected List notAvailableTime; - - /** - * A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. - */ - @Child(name="availabilityExceptions", type={StringType.class}, order=13, min=0, max=1) - @Description(shortDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times", formalDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times." ) - protected StringType availabilityExceptions; - - /** - * The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - @Child(name="publicKey", type={StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available", formalDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available." ) - protected StringType publicKey; - - /** - * Program Names that can be used to categorize the service. - */ - @Child(name="programName", type={StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Program Names that can be used to categorize the service", formalDefinition="Program Names that can be used to categorize the service." ) - protected List programName; - - /** - * List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts. - */ - @Child(name="contactPoint", type={ContactPoint.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts", formalDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts." ) - protected List contactPoint; - - /** - * Collection of Characteristics (attributes). - */ - @Child(name="characteristic", type={CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collection of Characteristics (attributes)", formalDefinition="Collection of Characteristics (attributes)." ) - protected List characteristic; - - /** - * Ways that the service accepts referrals. - */ - @Child(name="referralMethod", type={CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Ways that the service accepts referrals", formalDefinition="Ways that the service accepts referrals." ) - protected List referralMethod; - - /** - * The setting where this service can be provided, such is in home, or at location in organisation. - */ - @Child(name="setting", type={CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The setting where this service can be provided, such is in home, or at location in organisation", formalDefinition="The setting where this service can be provided, such is in home, or at location in organisation." ) - protected List setting; - - /** - * Collection of Target Groups for the Service Site (The target audience that this service is for). - */ - @Child(name="targetGroup", type={CodeableConcept.class}, order=20, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collection of Target Groups for the Service Site (The target audience that this service is for)", formalDefinition="Collection of Target Groups for the Service Site (The target audience that this service is for)." ) - protected List targetGroup; - - /** - * Need better description. - */ - @Child(name="coverageArea", type={CodeableConcept.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Need better description", formalDefinition="Need better description." ) - protected List coverageArea; - - /** - * Need better description. - */ - @Child(name="catchmentArea", type={CodeableConcept.class}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Need better description", formalDefinition="Need better description." ) - protected List catchmentArea; - - /** - * List of the specific. - */ - @Child(name="serviceCode", type={CodeableConcept.class}, order=23, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of the specific", formalDefinition="List of the specific." ) - protected List serviceCode; - - private static final long serialVersionUID = 1768613427L; - - public HealthcareService() { - super(); - } - - public HealthcareService(Reference location) { - super(); - this.location = location; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #location} (The location where this healthcare service may be provided.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where this healthcare service may be provided.) - */ - public HealthcareService setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 location where this healthcare service may be provided.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 location where this healthcare service may be provided.) - */ - public HealthcareService setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) - */ - public HealthcareService setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) - */ - public List getServiceType() { - if (this.serviceType == null) - this.serviceType = new ArrayList(); - return this.serviceType; - } - - public boolean hasServiceType() { - if (this.serviceType == null) - return false; - for (ServiceTypeComponent item : this.serviceType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) - */ - // syntactic sugar - public ServiceTypeComponent addServiceType() { //3 - ServiceTypeComponent t = new ServiceTypeComponent(); - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return t; - } - - /** - * @return {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value - */ - public StringType getServiceNameElement() { - if (this.serviceName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.serviceName"); - else if (Configuration.doAutoCreate()) - this.serviceName = new StringType(); - return this.serviceName; - } - - public boolean hasServiceNameElement() { - return this.serviceName != null && !this.serviceName.isEmpty(); - } - - public boolean hasServiceName() { - return this.serviceName != null && !this.serviceName.isEmpty(); - } - - /** - * @param value {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value - */ - public HealthcareService setServiceNameElement(StringType value) { - this.serviceName = value; - return this; - } - - /** - * @return Further description of the service as it would be presented to a consumer while searching. - */ - public String getServiceName() { - return this.serviceName == null ? null : this.serviceName.getValue(); - } - - /** - * @param value Further description of the service as it would be presented to a consumer while searching. - */ - public HealthcareService setServiceName(String value) { - if (Utilities.noString(value)) - this.serviceName = null; - else { - if (this.serviceName == null) - this.serviceName = new StringType(); - this.serviceName.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public HealthcareService setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - public HealthcareService setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value - */ - public StringType getExtraDetailsElement() { - if (this.extraDetails == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.extraDetails"); - else if (Configuration.doAutoCreate()) - this.extraDetails = new StringType(); - return this.extraDetails; - } - - public boolean hasExtraDetailsElement() { - return this.extraDetails != null && !this.extraDetails.isEmpty(); - } - - public boolean hasExtraDetails() { - return this.extraDetails != null && !this.extraDetails.isEmpty(); - } - - /** - * @param value {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value - */ - public HealthcareService setExtraDetailsElement(StringType value) { - this.extraDetails = value; - return this; - } - - /** - * @return Extra details about the service that can't be placed in the other fields. - */ - public String getExtraDetails() { - return this.extraDetails == null ? null : this.extraDetails.getValue(); - } - - /** - * @param value Extra details about the service that can't be placed in the other fields. - */ - public HealthcareService setExtraDetails(String value) { - if (Utilities.noString(value)) - this.extraDetails = null; - else { - if (this.extraDetails == null) - this.extraDetails = new StringType(); - this.extraDetails.setValue(value); - } - return this; - } - - /** - * @return {@link #freeProvisionCode} (The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.) - */ - public CodeableConcept getFreeProvisionCode() { - if (this.freeProvisionCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.freeProvisionCode"); - else if (Configuration.doAutoCreate()) - this.freeProvisionCode = new CodeableConcept(); - return this.freeProvisionCode; - } - - public boolean hasFreeProvisionCode() { - return this.freeProvisionCode != null && !this.freeProvisionCode.isEmpty(); - } - - /** - * @param value {@link #freeProvisionCode} (The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.) - */ - public HealthcareService setFreeProvisionCode(CodeableConcept value) { - this.freeProvisionCode = value; - return this; - } - - /** - * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) - */ - public CodeableConcept getEligibility() { - if (this.eligibility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.eligibility"); - else if (Configuration.doAutoCreate()) - this.eligibility = new CodeableConcept(); - return this.eligibility; - } - - public boolean hasEligibility() { - return this.eligibility != null && !this.eligibility.isEmpty(); - } - - /** - * @param value {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) - */ - public HealthcareService setEligibility(CodeableConcept value) { - this.eligibility = value; - return this; - } - - /** - * @return {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value - */ - public StringType getEligibilityNoteElement() { - if (this.eligibilityNote == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.eligibilityNote"); - else if (Configuration.doAutoCreate()) - this.eligibilityNote = new StringType(); - return this.eligibilityNote; - } - - public boolean hasEligibilityNoteElement() { - return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); - } - - public boolean hasEligibilityNote() { - return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); - } - - /** - * @param value {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value - */ - public HealthcareService setEligibilityNoteElement(StringType value) { - this.eligibilityNote = value; - return this; - } - - /** - * @return The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. - */ - public String getEligibilityNote() { - return this.eligibilityNote == null ? null : this.eligibilityNote.getValue(); - } - - /** - * @param value The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. - */ - public HealthcareService setEligibilityNote(String value) { - if (Utilities.noString(value)) - this.eligibilityNote = null; - else { - if (this.eligibilityNote == null) - this.eligibilityNote = new StringType(); - this.eligibilityNote.setValue(value); - } - return this; - } - - /** - * @return {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).) - */ - public CodeableConcept getAppointmentRequired() { - if (this.appointmentRequired == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.appointmentRequired"); - else if (Configuration.doAutoCreate()) - this.appointmentRequired = new CodeableConcept(); - return this.appointmentRequired; - } - - public boolean hasAppointmentRequired() { - return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); - } - - /** - * @param value {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).) - */ - public HealthcareService setAppointmentRequired(CodeableConcept value) { - this.appointmentRequired = value; - return this; - } - - /** - * @return {@link #imageURI} (If there is an image associated with this Service Site, its URI can be included here.). This is the underlying object with id, value and extensions. The accessor "getImageURI" gives direct access to the value - */ - public UriType getImageURIElement() { - if (this.imageURI == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.imageURI"); - else if (Configuration.doAutoCreate()) - this.imageURI = new UriType(); - return this.imageURI; - } - - public boolean hasImageURIElement() { - return this.imageURI != null && !this.imageURI.isEmpty(); - } - - public boolean hasImageURI() { - return this.imageURI != null && !this.imageURI.isEmpty(); - } - - /** - * @param value {@link #imageURI} (If there is an image associated with this Service Site, its URI can be included here.). This is the underlying object with id, value and extensions. The accessor "getImageURI" gives direct access to the value - */ - public HealthcareService setImageURIElement(UriType value) { - this.imageURI = value; - return this; - } - - /** - * @return If there is an image associated with this Service Site, its URI can be included here. - */ - public String getImageURI() { - return this.imageURI == null ? null : this.imageURI.getValue(); - } - - /** - * @param value If there is an image associated with this Service Site, its URI can be included here. - */ - public HealthcareService setImageURI(String value) { - if (Utilities.noString(value)) - this.imageURI = null; - else { - if (this.imageURI == null) - this.imageURI = new UriType(); - this.imageURI.setValue(value); - } - return this; - } - - /** - * @return {@link #availableTime} (A Collection of times that the Service Site is available.) - */ - public List getAvailableTime() { - if (this.availableTime == null) - this.availableTime = new ArrayList(); - return this.availableTime; - } - - public boolean hasAvailableTime() { - if (this.availableTime == null) - return false; - for (HealthcareServiceAvailableTimeComponent item : this.availableTime) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #availableTime} (A Collection of times that the Service Site is available.) - */ - // syntactic sugar - public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3 - HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent(); - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return t; - } - - /** - * @return {@link #notAvailableTime} (Not avail times - need better description.) - */ - public List getNotAvailableTime() { - if (this.notAvailableTime == null) - this.notAvailableTime = new ArrayList(); - return this.notAvailableTime; - } - - public boolean hasNotAvailableTime() { - if (this.notAvailableTime == null) - return false; - for (HealthcareServiceNotAvailableTimeComponent item : this.notAvailableTime) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notAvailableTime} (Not avail times - need better description.) - */ - // syntactic sugar - public HealthcareServiceNotAvailableTimeComponent addNotAvailableTime() { //3 - HealthcareServiceNotAvailableTimeComponent t = new HealthcareServiceNotAvailableTimeComponent(); - if (this.notAvailableTime == null) - this.notAvailableTime = new ArrayList(); - this.notAvailableTime.add(t); - return t; - } - - /** - * @return {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public StringType getAvailabilityExceptionsElement() { - if (this.availabilityExceptions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions"); - else if (Configuration.doAutoCreate()) - this.availabilityExceptions = new StringType(); - return this.availabilityExceptions; - } - - public boolean hasAvailabilityExceptionsElement() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - public boolean hasAvailabilityExceptions() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - /** - * @param value {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public HealthcareService setAvailabilityExceptionsElement(StringType value) { - this.availabilityExceptions = value; - return this; - } - - /** - * @return A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. - */ - public String getAvailabilityExceptions() { - return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); - } - - /** - * @param value A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. - */ - public HealthcareService setAvailabilityExceptions(String value) { - if (Utilities.noString(value)) - this.availabilityExceptions = null; - else { - if (this.availabilityExceptions == null) - this.availabilityExceptions = new StringType(); - this.availabilityExceptions.setValue(value); - } - return this; - } - - /** - * @return {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value - */ - public StringType getPublicKeyElement() { - if (this.publicKey == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.publicKey"); - else if (Configuration.doAutoCreate()) - this.publicKey = new StringType(); - return this.publicKey; - } - - public boolean hasPublicKeyElement() { - return this.publicKey != null && !this.publicKey.isEmpty(); - } - - public boolean hasPublicKey() { - return this.publicKey != null && !this.publicKey.isEmpty(); - } - - /** - * @param value {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value - */ - public HealthcareService setPublicKeyElement(StringType value) { - this.publicKey = value; - return this; - } - - /** - * @return The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - public String getPublicKey() { - return this.publicKey == null ? null : this.publicKey.getValue(); - } - - /** - * @param value The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - public HealthcareService setPublicKey(String value) { - if (Utilities.noString(value)) - this.publicKey = null; - else { - if (this.publicKey == null) - this.publicKey = new StringType(); - this.publicKey.setValue(value); - } - return this; - } - - /** - * @return {@link #programName} (Program Names that can be used to categorize the service.) - */ - public List getProgramName() { - if (this.programName == null) - this.programName = new ArrayList(); - return this.programName; - } - - public boolean hasProgramName() { - if (this.programName == null) - return false; - for (StringType item : this.programName) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programName} (Program Names that can be used to categorize the service.) - */ - // syntactic sugar - public StringType addProgramNameElement() {//2 - StringType t = new StringType(); - if (this.programName == null) - this.programName = new ArrayList(); - this.programName.add(t); - return t; - } - - /** - * @param value {@link #programName} (Program Names that can be used to categorize the service.) - */ - public HealthcareService addProgramName(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.programName == null) - this.programName = new ArrayList(); - this.programName.add(t); - return this; - } - - /** - * @param value {@link #programName} (Program Names that can be used to categorize the service.) - */ - public boolean hasProgramName(String value) { - if (this.programName == null) - return false; - for (StringType v : this.programName) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #contactPoint} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) - */ - public List getContactPoint() { - if (this.contactPoint == null) - this.contactPoint = new ArrayList(); - return this.contactPoint; - } - - public boolean hasContactPoint() { - if (this.contactPoint == null) - return false; - for (ContactPoint item : this.contactPoint) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contactPoint} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) - */ - // syntactic sugar - public ContactPoint addContactPoint() { //3 - ContactPoint t = new ContactPoint(); - if (this.contactPoint == null) - this.contactPoint = new ArrayList(); - this.contactPoint.add(t); - return t; - } - - /** - * @return {@link #characteristic} (Collection of Characteristics (attributes).) - */ - public List getCharacteristic() { - if (this.characteristic == null) - this.characteristic = new ArrayList(); - return this.characteristic; - } - - public boolean hasCharacteristic() { - if (this.characteristic == null) - return false; - for (CodeableConcept item : this.characteristic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #characteristic} (Collection of Characteristics (attributes).) - */ - // syntactic sugar - public CodeableConcept addCharacteristic() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return t; - } - - /** - * @return {@link #referralMethod} (Ways that the service accepts referrals.) - */ - public List getReferralMethod() { - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - return this.referralMethod; - } - - public boolean hasReferralMethod() { - if (this.referralMethod == null) - return false; - for (CodeableConcept item : this.referralMethod) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referralMethod} (Ways that the service accepts referrals.) - */ - // syntactic sugar - public CodeableConcept addReferralMethod() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - this.referralMethod.add(t); - return t; - } - - /** - * @return {@link #setting} (The setting where this service can be provided, such is in home, or at location in organisation.) - */ - public List getSetting() { - if (this.setting == null) - this.setting = new ArrayList(); - return this.setting; - } - - public boolean hasSetting() { - if (this.setting == null) - return false; - for (CodeableConcept item : this.setting) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #setting} (The setting where this service can be provided, such is in home, or at location in organisation.) - */ - // syntactic sugar - public CodeableConcept addSetting() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.setting == null) - this.setting = new ArrayList(); - this.setting.add(t); - return t; - } - - /** - * @return {@link #targetGroup} (Collection of Target Groups for the Service Site (The target audience that this service is for).) - */ - public List getTargetGroup() { - if (this.targetGroup == null) - this.targetGroup = new ArrayList(); - return this.targetGroup; - } - - public boolean hasTargetGroup() { - if (this.targetGroup == null) - return false; - for (CodeableConcept item : this.targetGroup) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #targetGroup} (Collection of Target Groups for the Service Site (The target audience that this service is for).) - */ - // syntactic sugar - public CodeableConcept addTargetGroup() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.targetGroup == null) - this.targetGroup = new ArrayList(); - this.targetGroup.add(t); - return t; - } - - /** - * @return {@link #coverageArea} (Need better description.) - */ - public List getCoverageArea() { - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - return this.coverageArea; - } - - public boolean hasCoverageArea() { - if (this.coverageArea == null) - return false; - for (CodeableConcept item : this.coverageArea) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverageArea} (Need better description.) - */ - // syntactic sugar - public CodeableConcept addCoverageArea() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - this.coverageArea.add(t); - return t; - } - - /** - * @return {@link #catchmentArea} (Need better description.) - */ - public List getCatchmentArea() { - if (this.catchmentArea == null) - this.catchmentArea = new ArrayList(); - return this.catchmentArea; - } - - public boolean hasCatchmentArea() { - if (this.catchmentArea == null) - return false; - for (CodeableConcept item : this.catchmentArea) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #catchmentArea} (Need better description.) - */ - // syntactic sugar - public CodeableConcept addCatchmentArea() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.catchmentArea == null) - this.catchmentArea = new ArrayList(); - this.catchmentArea.add(t); - return t; - } - - /** - * @return {@link #serviceCode} (List of the specific.) - */ - public List getServiceCode() { - if (this.serviceCode == null) - this.serviceCode = new ArrayList(); - return this.serviceCode; - } - - public boolean hasServiceCode() { - if (this.serviceCode == null) - return false; - for (CodeableConcept item : this.serviceCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceCode} (List of the specific.) - */ - // syntactic sugar - public CodeableConcept addServiceCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceCode == null) - this.serviceCode = new ArrayList(); - this.serviceCode.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("location", "Reference(Location)", "The location where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("serviceType", "", "A specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, serviceType)); - childrenList.add(new Property("serviceName", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, java.lang.Integer.MAX_VALUE, serviceName)); - childrenList.add(new Property("comment", "string", "Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("extraDetails", "string", "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE, extraDetails)); - childrenList.add(new Property("freeProvisionCode", "CodeableConcept", "The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.", 0, java.lang.Integer.MAX_VALUE, freeProvisionCode)); - childrenList.add(new Property("eligibility", "CodeableConcept", "Does this service have specific eligibility requirements that need to be met in order to use the service.", 0, java.lang.Integer.MAX_VALUE, eligibility)); - childrenList.add(new Property("eligibilityNote", "string", "The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.", 0, java.lang.Integer.MAX_VALUE, eligibilityNote)); - childrenList.add(new Property("appointmentRequired", "CodeableConcept", "Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).", 0, java.lang.Integer.MAX_VALUE, appointmentRequired)); - childrenList.add(new Property("imageURI", "uri", "If there is an image associated with this Service Site, its URI can be included here.", 0, java.lang.Integer.MAX_VALUE, imageURI)); - childrenList.add(new Property("availableTime", "", "A Collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); - childrenList.add(new Property("notAvailableTime", "", "Not avail times - need better description.", 0, java.lang.Integer.MAX_VALUE, notAvailableTime)); - childrenList.add(new Property("availabilityExceptions", "string", "A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); - childrenList.add(new Property("publicKey", "string", "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.", 0, java.lang.Integer.MAX_VALUE, publicKey)); - childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.", 0, java.lang.Integer.MAX_VALUE, programName)); - childrenList.add(new Property("contactPoint", "ContactPoint", "List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.", 0, java.lang.Integer.MAX_VALUE, contactPoint)); - childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of Characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic)); - childrenList.add(new Property("referralMethod", "CodeableConcept", "Ways that the service accepts referrals.", 0, java.lang.Integer.MAX_VALUE, referralMethod)); - childrenList.add(new Property("setting", "CodeableConcept", "The setting where this service can be provided, such is in home, or at location in organisation.", 0, java.lang.Integer.MAX_VALUE, setting)); - childrenList.add(new Property("targetGroup", "CodeableConcept", "Collection of Target Groups for the Service Site (The target audience that this service is for).", 0, java.lang.Integer.MAX_VALUE, targetGroup)); - childrenList.add(new Property("coverageArea", "CodeableConcept", "Need better description.", 0, java.lang.Integer.MAX_VALUE, coverageArea)); - childrenList.add(new Property("catchmentArea", "CodeableConcept", "Need better description.", 0, java.lang.Integer.MAX_VALUE, catchmentArea)); - childrenList.add(new Property("serviceCode", "CodeableConcept", "List of the specific.", 0, java.lang.Integer.MAX_VALUE, serviceCode)); - } - - public HealthcareService copy() { - HealthcareService dst = new HealthcareService(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.location = location == null ? null : location.copy(); - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - if (serviceType != null) { - dst.serviceType = new ArrayList(); - for (ServiceTypeComponent i : serviceType) - dst.serviceType.add(i.copy()); - }; - dst.serviceName = serviceName == null ? null : serviceName.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.extraDetails = extraDetails == null ? null : extraDetails.copy(); - dst.freeProvisionCode = freeProvisionCode == null ? null : freeProvisionCode.copy(); - dst.eligibility = eligibility == null ? null : eligibility.copy(); - dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy(); - dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy(); - dst.imageURI = imageURI == null ? null : imageURI.copy(); - if (availableTime != null) { - dst.availableTime = new ArrayList(); - for (HealthcareServiceAvailableTimeComponent i : availableTime) - dst.availableTime.add(i.copy()); - }; - if (notAvailableTime != null) { - dst.notAvailableTime = new ArrayList(); - for (HealthcareServiceNotAvailableTimeComponent i : notAvailableTime) - dst.notAvailableTime.add(i.copy()); - }; - dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); - dst.publicKey = publicKey == null ? null : publicKey.copy(); - if (programName != null) { - dst.programName = new ArrayList(); - for (StringType i : programName) - dst.programName.add(i.copy()); - }; - if (contactPoint != null) { - dst.contactPoint = new ArrayList(); - for (ContactPoint i : contactPoint) - dst.contactPoint.add(i.copy()); - }; - if (characteristic != null) { - dst.characteristic = new ArrayList(); - for (CodeableConcept i : characteristic) - dst.characteristic.add(i.copy()); - }; - if (referralMethod != null) { - dst.referralMethod = new ArrayList(); - for (CodeableConcept i : referralMethod) - dst.referralMethod.add(i.copy()); - }; - if (setting != null) { - dst.setting = new ArrayList(); - for (CodeableConcept i : setting) - dst.setting.add(i.copy()); - }; - if (targetGroup != null) { - dst.targetGroup = new ArrayList(); - for (CodeableConcept i : targetGroup) - dst.targetGroup.add(i.copy()); - }; - if (coverageArea != null) { - dst.coverageArea = new ArrayList(); - for (CodeableConcept i : coverageArea) - dst.coverageArea.add(i.copy()); - }; - if (catchmentArea != null) { - dst.catchmentArea = new ArrayList(); - for (CodeableConcept i : catchmentArea) - dst.catchmentArea.add(i.copy()); - }; - if (serviceCode != null) { - dst.serviceCode = new ArrayList(); - for (CodeableConcept i : serviceCode) - dst.serviceCode.add(i.copy()); - }; - return dst; - } - - protected HealthcareService typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (location == null || location.isEmpty()) - && (serviceCategory == null || serviceCategory.isEmpty()) && (serviceType == null || serviceType.isEmpty()) - && (serviceName == null || serviceName.isEmpty()) && (comment == null || comment.isEmpty()) - && (extraDetails == null || extraDetails.isEmpty()) && (freeProvisionCode == null || freeProvisionCode.isEmpty()) - && (eligibility == null || eligibility.isEmpty()) && (eligibilityNote == null || eligibilityNote.isEmpty()) - && (appointmentRequired == null || appointmentRequired.isEmpty()) && (imageURI == null || imageURI.isEmpty()) - && (availableTime == null || availableTime.isEmpty()) && (notAvailableTime == null || notAvailableTime.isEmpty()) - && (availabilityExceptions == null || availabilityExceptions.isEmpty()) && (publicKey == null || publicKey.isEmpty()) - && (programName == null || programName.isEmpty()) && (contactPoint == null || contactPoint.isEmpty()) - && (characteristic == null || characteristic.isEmpty()) && (referralMethod == null || referralMethod.isEmpty()) - && (setting == null || setting.isEmpty()) && (targetGroup == null || targetGroup.isEmpty()) - && (coverageArea == null || coverageArea.isEmpty()) && (catchmentArea == null || catchmentArea.isEmpty()) - && (serviceCode == null || serviceCode.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.HealthcareService; - } - - @SearchParamDefinition(name="servicecategory", path="HealthcareService.serviceCategory", description="Service Category of the Healthcare Service", type="token" ) - public static final String SP_SERVICECATEGORY = "servicecategory"; - @SearchParamDefinition(name="servicetype", path="HealthcareService.serviceType.type", description="The type of service provided by this healthcare service", type="token" ) - public static final String SP_SERVICETYPE = "servicetype"; - @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="name", path="HealthcareService.serviceName", description="A portion of the Healthcare service name", type="string" ) - public static final String SP_NAME = "name"; - -} - + +/* + 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; +/** + * (informative) The details of a Healthcare Service available at a location. + */ +@ResourceDef(name="HealthcareService", profile="http://hl7.org/fhir/Profile/HealthcareService") +public class HealthcareService extends DomainResource { + + @Block() + public static class ServiceTypeComponent extends BackboneElement { + /** + * The specific type of service being delivered or performed. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="The specific type of service being delivered or performed", formalDefinition="The specific type of service being delivered or performed." ) + protected CodeableConcept type; + + /** + * Collection of Specialties handled by the Service Site. This is more of a Medical Term. + */ + @Child(name="specialty", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term", formalDefinition="Collection of Specialties handled by the Service Site. This is more of a Medical Term." ) + protected List specialty; + + private static final long serialVersionUID = 1703986174L; + + public ServiceTypeComponent() { + super(); + } + + public ServiceTypeComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (The specific type of service being delivered or performed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ServiceTypeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The specific type of service being delivered or performed.) + */ + public ServiceTypeComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Collection of Specialties handled by the Service Site. This is more of a Medical Term.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "The specific type of service being delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("specialty", "CodeableConcept", "Collection of Specialties handled by the Service Site. This is more of a Medical Term.", 0, java.lang.Integer.MAX_VALUE, specialty)); + } + + public ServiceTypeComponent copy() { + ServiceTypeComponent dst = new ServiceTypeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) + ; + } + + } + + @Block() + public static class HealthcareServiceAvailableTimeComponent extends BackboneElement { + /** + * Indicates which Days of the week are available between the Start and End Times. + */ + @Child(name="daysOfWeek", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indicates which Days of the week are available between the Start and End Times", formalDefinition="Indicates which Days of the week are available between the Start and End Times." ) + protected List daysOfWeek; + + /** + * Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + @Child(name="allDay", type={BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) + protected BooleanType allDay; + + /** + * The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name="availableStartTime", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored." ) + protected DateTimeType availableStartTime; + + /** + * The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. + */ + @Child(name="availableEndTime", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored", formalDefinition="The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored." ) + protected DateTimeType availableEndTime; + + private static final long serialVersionUID = 1384198535L; + + public HealthcareServiceAvailableTimeComponent() { + super(); + } + + /** + * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) + */ + public List getDaysOfWeek() { + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList(); + return this.daysOfWeek; + } + + public boolean hasDaysOfWeek() { + if (this.daysOfWeek == null) + return false; + for (CodeableConcept item : this.daysOfWeek) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #daysOfWeek} (Indicates which Days of the week are available between the Start and End Times.) + */ + // syntactic sugar + public CodeableConcept addDaysOfWeek() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.daysOfWeek == null) + this.daysOfWeek = new ArrayList(); + this.daysOfWeek.add(t); + return t; + } + + /** + * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public BooleanType getAllDayElement() { + if (this.allDay == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay"); + else if (Configuration.doAutoCreate()) + this.allDay = new BooleanType(); + return this.allDay; + } + + public boolean hasAllDayElement() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + public boolean hasAllDay() { + return this.allDay != null && !this.allDay.isEmpty(); + } + + /** + * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) { + this.allDay = value; + return this; + } + + /** + * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public boolean getAllDay() { + return this.allDay == null ? false : this.allDay.getValue(); + } + + /** + * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. + */ + public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) { + if (value == false) + this.allDay = null; + else { + if (this.allDay == null) + this.allDay = new BooleanType(); + this.allDay.setValue(value); + } + return this; + } + + /** + * @return {@link #availableStartTime} (The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public DateTimeType getAvailableStartTimeElement() { + if (this.availableStartTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime"); + else if (Configuration.doAutoCreate()) + this.availableStartTime = new DateTimeType(); + return this.availableStartTime; + } + + public boolean hasAvailableStartTimeElement() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + public boolean hasAvailableStartTime() { + return this.availableStartTime != null && !this.availableStartTime.isEmpty(); + } + + /** + * @param value {@link #availableStartTime} (The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(DateTimeType value) { + this.availableStartTime = value; + return this; + } + + /** + * @return The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. + */ + 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(Date value) { + if (value == null) + this.availableStartTime = null; + else { + if (this.availableStartTime == null) + this.availableStartTime = new DateTimeType(); + this.availableStartTime.setValue(value); + } + return this; + } + + /** + * @return {@link #availableEndTime} (The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public DateTimeType getAvailableEndTimeElement() { + if (this.availableEndTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime"); + else if (Configuration.doAutoCreate()) + this.availableEndTime = new DateTimeType(); + return this.availableEndTime; + } + + public boolean hasAvailableEndTimeElement() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + public boolean hasAvailableEndTime() { + return this.availableEndTime != null && !this.availableEndTime.isEmpty(); + } + + /** + * @param value {@link #availableEndTime} (The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value + */ + public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(DateTimeType value) { + this.availableEndTime = value; + return this; + } + + /** + * @return The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. + */ + 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(Date value) { + if (value == null) + this.availableEndTime = null; + else { + if (this.availableEndTime == null) + this.availableEndTime = new DateTimeType(); + this.availableEndTime.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("daysOfWeek", "CodeableConcept", "Indicates which Days of the week are available between the Start and End Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); + childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); + childrenList.add(new Property("availableStartTime", "dateTime", "The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); + childrenList.add(new Property("availableEndTime", "dateTime", "The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); + } + + public HealthcareServiceAvailableTimeComponent copy() { + HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent(); + copyValues(dst); + if (daysOfWeek != null) { + dst.daysOfWeek = new ArrayList(); + for (CodeableConcept i : daysOfWeek) + dst.daysOfWeek.add(i.copy()); + }; + dst.allDay = allDay == null ? null : allDay.copy(); + dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); + dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) + && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) + ; + } + + } + + @Block() + public static class HealthcareServiceNotAvailableTimeComponent extends BackboneElement { + /** + * The reason that can be presented to the user as to why this time is not available. + */ + @Child(name="description", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="The reason that can be presented to the user as to why this time is not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) + protected StringType description; + + /** + * Service is not available (seasonally or for a public holiday) from this date. + */ + @Child(name="startDate", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Service is not available (seasonally or for a public holiday) from this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) + protected DateTimeType startDate; + + /** + * Service is not available (seasonally or for a public holiday) until this date. + */ + @Child(name="endDate", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Service is not available (seasonally or for a public holiday) until this date", formalDefinition="Service is not available (seasonally or for a public holiday) until this date." ) + protected DateTimeType endDate; + + private static final long serialVersionUID = -1448794L; + + public HealthcareServiceNotAvailableTimeComponent() { + super(); + } + + public HealthcareServiceNotAvailableTimeComponent(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). 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 HealthcareServiceNotAvailableTimeComponent.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} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public HealthcareServiceNotAvailableTimeComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason that can be presented to the user as to why this time is not available. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason that can be presented to the user as to why this time is not available. + */ + public HealthcareServiceNotAvailableTimeComponent setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #startDate} (Service is not available (seasonally or for a public holiday) from this date.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value + */ + public DateTimeType getStartDateElement() { + if (this.startDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceNotAvailableTimeComponent.startDate"); + else if (Configuration.doAutoCreate()) + this.startDate = new DateTimeType(); + return this.startDate; + } + + public boolean hasStartDateElement() { + return this.startDate != null && !this.startDate.isEmpty(); + } + + public boolean hasStartDate() { + return this.startDate != null && !this.startDate.isEmpty(); + } + + /** + * @param value {@link #startDate} (Service is not available (seasonally or for a public holiday) from this date.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value + */ + public HealthcareServiceNotAvailableTimeComponent setStartDateElement(DateTimeType value) { + this.startDate = value; + return this; + } + + /** + * @return Service is not available (seasonally or for a public holiday) from this date. + */ + 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(Date value) { + if (value == null) + this.startDate = null; + else { + if (this.startDate == null) + this.startDate = new DateTimeType(); + this.startDate.setValue(value); + } + return this; + } + + /** + * @return {@link #endDate} (Service is not available (seasonally or for a public holiday) until this date.). This is the underlying object with id, value and extensions. The accessor "getEndDate" gives direct access to the value + */ + public DateTimeType getEndDateElement() { + if (this.endDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareServiceNotAvailableTimeComponent.endDate"); + else if (Configuration.doAutoCreate()) + this.endDate = new DateTimeType(); + return this.endDate; + } + + public boolean hasEndDateElement() { + return this.endDate != null && !this.endDate.isEmpty(); + } + + public boolean hasEndDate() { + return this.endDate != null && !this.endDate.isEmpty(); + } + + /** + * @param value {@link #endDate} (Service is not available (seasonally or for a public holiday) until this date.). This is the underlying object with id, value and extensions. The accessor "getEndDate" gives direct access to the value + */ + public HealthcareServiceNotAvailableTimeComponent setEndDateElement(DateTimeType value) { + this.endDate = value; + return this; + } + + /** + * @return Service is not available (seasonally or for a public holiday) until this date. + */ + 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(Date value) { + if (value == null) + this.endDate = null; + else { + if (this.endDate == null) + this.endDate = new DateTimeType(); + this.endDate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("startDate", "dateTime", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, startDate)); + childrenList.add(new Property("endDate", "dateTime", "Service is not available (seasonally or for a public holiday) until this date.", 0, java.lang.Integer.MAX_VALUE, endDate)); + } + + public HealthcareServiceNotAvailableTimeComponent copy() { + HealthcareServiceNotAvailableTimeComponent dst = new HealthcareServiceNotAvailableTimeComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.startDate = startDate == null ? null : startDate.copy(); + dst.endDate = endDate == null ? null : endDate.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (startDate == null || startDate.isEmpty()) + && (endDate == null || endDate.isEmpty()); + } + + } + + /** + * External Ids for this item. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * The location where this healthcare service may be provided. + */ + @Child(name="location", type={Location.class}, order=0, min=1, max=1) + @Description(shortDefinition="The location where this healthcare service may be provided", formalDefinition="The location where this healthcare service may be provided." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The location where this healthcare service may be provided.) + */ + protected Location locationTarget; + + /** + * Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type. + */ + @Child(name="serviceCategory", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type", formalDefinition="Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type." ) + protected CodeableConcept serviceCategory; + + /** + * A specific type of service that may be delivered or performed. + */ + @Child(name="serviceType", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A specific type of service that may be delivered or performed", formalDefinition="A specific type of service that may be delivered or performed." ) + protected List serviceType; + + /** + * Further description of the service as it would be presented to a consumer while searching. + */ + @Child(name="serviceName", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Further description of the service as it would be presented to a consumer while searching", formalDefinition="Further description of the service as it would be presented to a consumer while searching." ) + protected StringType serviceName; + + /** + * Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + @Child(name="comment", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName", formalDefinition="Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName." ) + protected StringType comment; + + /** + * Extra details about the service that can't be placed in the other fields. + */ + @Child(name="extraDetails", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Extra details about the service that can't be placed in the other fields", formalDefinition="Extra details about the service that can't be placed in the other fields." ) + protected StringType extraDetails; + + /** + * The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type. + */ + @Child(name="freeProvisionCode", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type", formalDefinition="The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type." ) + protected CodeableConcept freeProvisionCode; + + /** + * Does this service have specific eligibility requirements that need to be met in order to use the service. + */ + @Child(name="eligibility", type={CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service", formalDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service." ) + protected CodeableConcept eligibility; + + /** + * The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + */ + @Child(name="eligibilityNote", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Describes the eligibility conditions for the service", formalDefinition="The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page." ) + protected StringType eligibilityNote; + + /** + * Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum). + */ + @Child(name="appointmentRequired", type={CodeableConcept.class}, order=9, min=0, max=1) + @Description(shortDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum)", formalDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum)." ) + protected CodeableConcept appointmentRequired; + + /** + * If there is an image associated with this Service Site, its URI can be included here. + */ + @Child(name="imageURI", type={UriType.class}, order=10, min=0, max=1) + @Description(shortDefinition="If there is an image associated with this Service Site, its URI can be included here", formalDefinition="If there is an image associated with this Service Site, its URI can be included here." ) + protected UriType imageURI; + + /** + * A Collection of times that the Service Site is available. + */ + @Child(name="availableTime", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Collection of times that the Service Site is available", formalDefinition="A Collection of times that the Service Site is available." ) + protected List availableTime; + + /** + * Not avail times - need better description. + */ + @Child(name="notAvailableTime", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Not avail times - need better description", formalDefinition="Not avail times - need better description." ) + protected List notAvailableTime; + + /** + * A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + */ + @Child(name="availabilityExceptions", type={StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times", formalDefinition="A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times." ) + protected StringType availabilityExceptions; + + /** + * The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + @Child(name="publicKey", type={StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available", formalDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available." ) + protected StringType publicKey; + + /** + * Program Names that can be used to categorize the service. + */ + @Child(name="programName", type={StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Program Names that can be used to categorize the service", formalDefinition="Program Names that can be used to categorize the service." ) + protected List programName; + + /** + * List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts. + */ + @Child(name="contactPoint", type={ContactPoint.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts", formalDefinition="List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts." ) + protected List contactPoint; + + /** + * Collection of Characteristics (attributes). + */ + @Child(name="characteristic", type={CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collection of Characteristics (attributes)", formalDefinition="Collection of Characteristics (attributes)." ) + protected List characteristic; + + /** + * Ways that the service accepts referrals. + */ + @Child(name="referralMethod", type={CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Ways that the service accepts referrals", formalDefinition="Ways that the service accepts referrals." ) + protected List referralMethod; + + /** + * The setting where this service can be provided, such is in home, or at location in organisation. + */ + @Child(name="setting", type={CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The setting where this service can be provided, such is in home, or at location in organisation", formalDefinition="The setting where this service can be provided, such is in home, or at location in organisation." ) + protected List setting; + + /** + * Collection of Target Groups for the Service Site (The target audience that this service is for). + */ + @Child(name="targetGroup", type={CodeableConcept.class}, order=20, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collection of Target Groups for the Service Site (The target audience that this service is for)", formalDefinition="Collection of Target Groups for the Service Site (The target audience that this service is for)." ) + protected List targetGroup; + + /** + * Need better description. + */ + @Child(name="coverageArea", type={CodeableConcept.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Need better description", formalDefinition="Need better description." ) + protected List coverageArea; + + /** + * Need better description. + */ + @Child(name="catchmentArea", type={CodeableConcept.class}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Need better description", formalDefinition="Need better description." ) + protected List catchmentArea; + + /** + * List of the specific. + */ + @Child(name="serviceCode", type={CodeableConcept.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of the specific", formalDefinition="List of the specific." ) + protected List serviceCode; + + private static final long serialVersionUID = 1768613427L; + + public HealthcareService() { + super(); + } + + public HealthcareService(Reference location) { + super(); + this.location = location; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #location} (The location where this healthcare service may be provided.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The location where this healthcare service may be provided.) + */ + public HealthcareService setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 location where this healthcare service may be provided.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 location where this healthcare service may be provided.) + */ + public HealthcareService setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) + */ + public CodeableConcept getServiceCategory() { + if (this.serviceCategory == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.serviceCategory"); + else if (Configuration.doAutoCreate()) + this.serviceCategory = new CodeableConcept(); + return this.serviceCategory; + } + + public boolean hasServiceCategory() { + return this.serviceCategory != null && !this.serviceCategory.isEmpty(); + } + + /** + * @param value {@link #serviceCategory} (Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.) + */ + public HealthcareService setServiceCategory(CodeableConcept value) { + this.serviceCategory = value; + return this; + } + + /** + * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) + */ + public List getServiceType() { + if (this.serviceType == null) + this.serviceType = new ArrayList(); + return this.serviceType; + } + + public boolean hasServiceType() { + if (this.serviceType == null) + return false; + for (ServiceTypeComponent item : this.serviceType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceType} (A specific type of service that may be delivered or performed.) + */ + // syntactic sugar + public ServiceTypeComponent addServiceType() { //3 + ServiceTypeComponent t = new ServiceTypeComponent(); + if (this.serviceType == null) + this.serviceType = new ArrayList(); + this.serviceType.add(t); + return t; + } + + /** + * @return {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value + */ + public StringType getServiceNameElement() { + if (this.serviceName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.serviceName"); + else if (Configuration.doAutoCreate()) + this.serviceName = new StringType(); + return this.serviceName; + } + + public boolean hasServiceNameElement() { + return this.serviceName != null && !this.serviceName.isEmpty(); + } + + public boolean hasServiceName() { + return this.serviceName != null && !this.serviceName.isEmpty(); + } + + /** + * @param value {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value + */ + public HealthcareService setServiceNameElement(StringType value) { + this.serviceName = value; + return this; + } + + /** + * @return Further description of the service as it would be presented to a consumer while searching. + */ + public String getServiceName() { + return this.serviceName == null ? null : this.serviceName.getValue(); + } + + /** + * @param value Further description of the service as it would be presented to a consumer while searching. + */ + public HealthcareService setServiceName(String value) { + if (Utilities.noString(value)) + this.serviceName = null; + else { + if (this.serviceName == null) + this.serviceName = new StringType(); + this.serviceName.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public HealthcareService setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + */ + public HealthcareService setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value + */ + public StringType getExtraDetailsElement() { + if (this.extraDetails == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.extraDetails"); + else if (Configuration.doAutoCreate()) + this.extraDetails = new StringType(); + return this.extraDetails; + } + + public boolean hasExtraDetailsElement() { + return this.extraDetails != null && !this.extraDetails.isEmpty(); + } + + public boolean hasExtraDetails() { + return this.extraDetails != null && !this.extraDetails.isEmpty(); + } + + /** + * @param value {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value + */ + public HealthcareService setExtraDetailsElement(StringType value) { + this.extraDetails = value; + return this; + } + + /** + * @return Extra details about the service that can't be placed in the other fields. + */ + public String getExtraDetails() { + return this.extraDetails == null ? null : this.extraDetails.getValue(); + } + + /** + * @param value Extra details about the service that can't be placed in the other fields. + */ + public HealthcareService setExtraDetails(String value) { + if (Utilities.noString(value)) + this.extraDetails = null; + else { + if (this.extraDetails == null) + this.extraDetails = new StringType(); + this.extraDetails.setValue(value); + } + return this; + } + + /** + * @return {@link #freeProvisionCode} (The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.) + */ + public CodeableConcept getFreeProvisionCode() { + if (this.freeProvisionCode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.freeProvisionCode"); + else if (Configuration.doAutoCreate()) + this.freeProvisionCode = new CodeableConcept(); + return this.freeProvisionCode; + } + + public boolean hasFreeProvisionCode() { + return this.freeProvisionCode != null && !this.freeProvisionCode.isEmpty(); + } + + /** + * @param value {@link #freeProvisionCode} (The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.) + */ + public HealthcareService setFreeProvisionCode(CodeableConcept value) { + this.freeProvisionCode = value; + return this; + } + + /** + * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) + */ + public CodeableConcept getEligibility() { + if (this.eligibility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.eligibility"); + else if (Configuration.doAutoCreate()) + this.eligibility = new CodeableConcept(); + return this.eligibility; + } + + public boolean hasEligibility() { + return this.eligibility != null && !this.eligibility.isEmpty(); + } + + /** + * @param value {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service.) + */ + public HealthcareService setEligibility(CodeableConcept value) { + this.eligibility = value; + return this; + } + + /** + * @return {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value + */ + public StringType getEligibilityNoteElement() { + if (this.eligibilityNote == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.eligibilityNote"); + else if (Configuration.doAutoCreate()) + this.eligibilityNote = new StringType(); + return this.eligibilityNote; + } + + public boolean hasEligibilityNoteElement() { + return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); + } + + public boolean hasEligibilityNote() { + return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); + } + + /** + * @param value {@link #eligibilityNote} (The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value + */ + public HealthcareService setEligibilityNoteElement(StringType value) { + this.eligibilityNote = value; + return this; + } + + /** + * @return The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + */ + public String getEligibilityNote() { + return this.eligibilityNote == null ? null : this.eligibilityNote.getValue(); + } + + /** + * @param value The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + */ + public HealthcareService setEligibilityNote(String value) { + if (Utilities.noString(value)) + this.eligibilityNote = null; + else { + if (this.eligibilityNote == null) + this.eligibilityNote = new StringType(); + this.eligibilityNote.setValue(value); + } + return this; + } + + /** + * @return {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).) + */ + public CodeableConcept getAppointmentRequired() { + if (this.appointmentRequired == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.appointmentRequired"); + else if (Configuration.doAutoCreate()) + this.appointmentRequired = new CodeableConcept(); + return this.appointmentRequired; + } + + public boolean hasAppointmentRequired() { + return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); + } + + /** + * @param value {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).) + */ + public HealthcareService setAppointmentRequired(CodeableConcept value) { + this.appointmentRequired = value; + return this; + } + + /** + * @return {@link #imageURI} (If there is an image associated with this Service Site, its URI can be included here.). This is the underlying object with id, value and extensions. The accessor "getImageURI" gives direct access to the value + */ + public UriType getImageURIElement() { + if (this.imageURI == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.imageURI"); + else if (Configuration.doAutoCreate()) + this.imageURI = new UriType(); + return this.imageURI; + } + + public boolean hasImageURIElement() { + return this.imageURI != null && !this.imageURI.isEmpty(); + } + + public boolean hasImageURI() { + return this.imageURI != null && !this.imageURI.isEmpty(); + } + + /** + * @param value {@link #imageURI} (If there is an image associated with this Service Site, its URI can be included here.). This is the underlying object with id, value and extensions. The accessor "getImageURI" gives direct access to the value + */ + public HealthcareService setImageURIElement(UriType value) { + this.imageURI = value; + return this; + } + + /** + * @return If there is an image associated with this Service Site, its URI can be included here. + */ + public String getImageURI() { + return this.imageURI == null ? null : this.imageURI.getValue(); + } + + /** + * @param value If there is an image associated with this Service Site, its URI can be included here. + */ + public HealthcareService setImageURI(String value) { + if (Utilities.noString(value)) + this.imageURI = null; + else { + if (this.imageURI == null) + this.imageURI = new UriType(); + this.imageURI.setValue(value); + } + return this; + } + + /** + * @return {@link #availableTime} (A Collection of times that the Service Site is available.) + */ + public List getAvailableTime() { + if (this.availableTime == null) + this.availableTime = new ArrayList(); + return this.availableTime; + } + + public boolean hasAvailableTime() { + if (this.availableTime == null) + return false; + for (HealthcareServiceAvailableTimeComponent item : this.availableTime) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #availableTime} (A Collection of times that the Service Site is available.) + */ + // syntactic sugar + public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3 + HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent(); + if (this.availableTime == null) + this.availableTime = new ArrayList(); + this.availableTime.add(t); + return t; + } + + /** + * @return {@link #notAvailableTime} (Not avail times - need better description.) + */ + public List getNotAvailableTime() { + if (this.notAvailableTime == null) + this.notAvailableTime = new ArrayList(); + return this.notAvailableTime; + } + + public boolean hasNotAvailableTime() { + if (this.notAvailableTime == null) + return false; + for (HealthcareServiceNotAvailableTimeComponent item : this.notAvailableTime) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notAvailableTime} (Not avail times - need better description.) + */ + // syntactic sugar + public HealthcareServiceNotAvailableTimeComponent addNotAvailableTime() { //3 + HealthcareServiceNotAvailableTimeComponent t = new HealthcareServiceNotAvailableTimeComponent(); + if (this.notAvailableTime == null) + this.notAvailableTime = new ArrayList(); + this.notAvailableTime.add(t); + return t; + } + + /** + * @return {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public StringType getAvailabilityExceptionsElement() { + if (this.availabilityExceptions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions"); + else if (Configuration.doAutoCreate()) + this.availabilityExceptions = new StringType(); + return this.availabilityExceptions; + } + + public boolean hasAvailabilityExceptionsElement() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + public boolean hasAvailabilityExceptions() { + return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); + } + + /** + * @param value {@link #availabilityExceptions} (A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value + */ + public HealthcareService setAvailabilityExceptionsElement(StringType value) { + this.availabilityExceptions = value; + return this; + } + + /** + * @return A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + */ + public String getAvailabilityExceptions() { + return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); + } + + /** + * @param value A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + */ + public HealthcareService setAvailabilityExceptions(String value) { + if (Utilities.noString(value)) + this.availabilityExceptions = null; + else { + if (this.availabilityExceptions == null) + this.availabilityExceptions = new StringType(); + this.availabilityExceptions.setValue(value); + } + return this; + } + + /** + * @return {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value + */ + public StringType getPublicKeyElement() { + if (this.publicKey == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HealthcareService.publicKey"); + else if (Configuration.doAutoCreate()) + this.publicKey = new StringType(); + return this.publicKey; + } + + public boolean hasPublicKeyElement() { + return this.publicKey != null && !this.publicKey.isEmpty(); + } + + public boolean hasPublicKey() { + return this.publicKey != null && !this.publicKey.isEmpty(); + } + + /** + * @param value {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value + */ + public HealthcareService setPublicKeyElement(StringType value) { + this.publicKey = value; + return this; + } + + /** + * @return The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + public String getPublicKey() { + return this.publicKey == null ? null : this.publicKey.getValue(); + } + + /** + * @param value The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + */ + public HealthcareService setPublicKey(String value) { + if (Utilities.noString(value)) + this.publicKey = null; + else { + if (this.publicKey == null) + this.publicKey = new StringType(); + this.publicKey.setValue(value); + } + return this; + } + + /** + * @return {@link #programName} (Program Names that can be used to categorize the service.) + */ + public List getProgramName() { + if (this.programName == null) + this.programName = new ArrayList(); + return this.programName; + } + + public boolean hasProgramName() { + if (this.programName == null) + return false; + for (StringType item : this.programName) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #programName} (Program Names that can be used to categorize the service.) + */ + // syntactic sugar + public StringType addProgramNameElement() {//2 + StringType t = new StringType(); + if (this.programName == null) + this.programName = new ArrayList(); + this.programName.add(t); + return t; + } + + /** + * @param value {@link #programName} (Program Names that can be used to categorize the service.) + */ + public HealthcareService addProgramName(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.programName == null) + this.programName = new ArrayList(); + this.programName.add(t); + return this; + } + + /** + * @param value {@link #programName} (Program Names that can be used to categorize the service.) + */ + public boolean hasProgramName(String value) { + if (this.programName == null) + return false; + for (StringType v : this.programName) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #contactPoint} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) + */ + public List getContactPoint() { + if (this.contactPoint == null) + this.contactPoint = new ArrayList(); + return this.contactPoint; + } + + public boolean hasContactPoint() { + if (this.contactPoint == null) + return false; + for (ContactPoint item : this.contactPoint) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contactPoint} (List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.) + */ + // syntactic sugar + public ContactPoint addContactPoint() { //3 + ContactPoint t = new ContactPoint(); + if (this.contactPoint == null) + this.contactPoint = new ArrayList(); + this.contactPoint.add(t); + return t; + } + + /** + * @return {@link #characteristic} (Collection of Characteristics (attributes).) + */ + public List getCharacteristic() { + if (this.characteristic == null) + this.characteristic = new ArrayList(); + return this.characteristic; + } + + public boolean hasCharacteristic() { + if (this.characteristic == null) + return false; + for (CodeableConcept item : this.characteristic) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #characteristic} (Collection of Characteristics (attributes).) + */ + // syntactic sugar + public CodeableConcept addCharacteristic() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.characteristic == null) + this.characteristic = new ArrayList(); + this.characteristic.add(t); + return t; + } + + /** + * @return {@link #referralMethod} (Ways that the service accepts referrals.) + */ + public List getReferralMethod() { + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + return this.referralMethod; + } + + public boolean hasReferralMethod() { + if (this.referralMethod == null) + return false; + for (CodeableConcept item : this.referralMethod) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referralMethod} (Ways that the service accepts referrals.) + */ + // syntactic sugar + public CodeableConcept addReferralMethod() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.referralMethod == null) + this.referralMethod = new ArrayList(); + this.referralMethod.add(t); + return t; + } + + /** + * @return {@link #setting} (The setting where this service can be provided, such is in home, or at location in organisation.) + */ + public List getSetting() { + if (this.setting == null) + this.setting = new ArrayList(); + return this.setting; + } + + public boolean hasSetting() { + if (this.setting == null) + return false; + for (CodeableConcept item : this.setting) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #setting} (The setting where this service can be provided, such is in home, or at location in organisation.) + */ + // syntactic sugar + public CodeableConcept addSetting() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.setting == null) + this.setting = new ArrayList(); + this.setting.add(t); + return t; + } + + /** + * @return {@link #targetGroup} (Collection of Target Groups for the Service Site (The target audience that this service is for).) + */ + public List getTargetGroup() { + if (this.targetGroup == null) + this.targetGroup = new ArrayList(); + return this.targetGroup; + } + + public boolean hasTargetGroup() { + if (this.targetGroup == null) + return false; + for (CodeableConcept item : this.targetGroup) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #targetGroup} (Collection of Target Groups for the Service Site (The target audience that this service is for).) + */ + // syntactic sugar + public CodeableConcept addTargetGroup() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.targetGroup == null) + this.targetGroup = new ArrayList(); + this.targetGroup.add(t); + return t; + } + + /** + * @return {@link #coverageArea} (Need better description.) + */ + public List getCoverageArea() { + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + return this.coverageArea; + } + + public boolean hasCoverageArea() { + if (this.coverageArea == null) + return false; + for (CodeableConcept item : this.coverageArea) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverageArea} (Need better description.) + */ + // syntactic sugar + public CodeableConcept addCoverageArea() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.coverageArea == null) + this.coverageArea = new ArrayList(); + this.coverageArea.add(t); + return t; + } + + /** + * @return {@link #catchmentArea} (Need better description.) + */ + public List getCatchmentArea() { + if (this.catchmentArea == null) + this.catchmentArea = new ArrayList(); + return this.catchmentArea; + } + + public boolean hasCatchmentArea() { + if (this.catchmentArea == null) + return false; + for (CodeableConcept item : this.catchmentArea) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #catchmentArea} (Need better description.) + */ + // syntactic sugar + public CodeableConcept addCatchmentArea() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.catchmentArea == null) + this.catchmentArea = new ArrayList(); + this.catchmentArea.add(t); + return t; + } + + /** + * @return {@link #serviceCode} (List of the specific.) + */ + public List getServiceCode() { + if (this.serviceCode == null) + this.serviceCode = new ArrayList(); + return this.serviceCode; + } + + public boolean hasServiceCode() { + if (this.serviceCode == null) + return false; + for (CodeableConcept item : this.serviceCode) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceCode} (List of the specific.) + */ + // syntactic sugar + public CodeableConcept addServiceCode() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceCode == null) + this.serviceCode = new ArrayList(); + this.serviceCode.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("location", "Reference(Location)", "The location where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("serviceCategory", "CodeableConcept", "Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); + childrenList.add(new Property("serviceType", "", "A specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, serviceType)); + childrenList.add(new Property("serviceName", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, java.lang.Integer.MAX_VALUE, serviceName)); + childrenList.add(new Property("comment", "string", "Additional description of the or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("extraDetails", "string", "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE, extraDetails)); + childrenList.add(new Property("freeProvisionCode", "CodeableConcept", "The free provision code provides a link to the Free Provision reference entity to enable the selection of one free provision type.", 0, java.lang.Integer.MAX_VALUE, freeProvisionCode)); + childrenList.add(new Property("eligibility", "CodeableConcept", "Does this service have specific eligibility requirements that need to be met in order to use the service.", 0, java.lang.Integer.MAX_VALUE, eligibility)); + childrenList.add(new Property("eligibilityNote", "string", "The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page.", 0, java.lang.Integer.MAX_VALUE, eligibilityNote)); + childrenList.add(new Property("appointmentRequired", "CodeableConcept", "Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. If this flag is 'NotDefined', then this flag is overridden by the Site's availability flag. (ConditionalIndicator Enum).", 0, java.lang.Integer.MAX_VALUE, appointmentRequired)); + childrenList.add(new Property("imageURI", "uri", "If there is an image associated with this Service Site, its URI can be included here.", 0, java.lang.Integer.MAX_VALUE, imageURI)); + childrenList.add(new Property("availableTime", "", "A Collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); + childrenList.add(new Property("notAvailableTime", "", "Not avail times - need better description.", 0, java.lang.Integer.MAX_VALUE, notAvailableTime)); + childrenList.add(new Property("availabilityExceptions", "string", "A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); + childrenList.add(new Property("publicKey", "string", "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.", 0, java.lang.Integer.MAX_VALUE, publicKey)); + childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.", 0, java.lang.Integer.MAX_VALUE, programName)); + childrenList.add(new Property("contactPoint", "ContactPoint", "List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts.", 0, java.lang.Integer.MAX_VALUE, contactPoint)); + childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of Characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic)); + childrenList.add(new Property("referralMethod", "CodeableConcept", "Ways that the service accepts referrals.", 0, java.lang.Integer.MAX_VALUE, referralMethod)); + childrenList.add(new Property("setting", "CodeableConcept", "The setting where this service can be provided, such is in home, or at location in organisation.", 0, java.lang.Integer.MAX_VALUE, setting)); + childrenList.add(new Property("targetGroup", "CodeableConcept", "Collection of Target Groups for the Service Site (The target audience that this service is for).", 0, java.lang.Integer.MAX_VALUE, targetGroup)); + childrenList.add(new Property("coverageArea", "CodeableConcept", "Need better description.", 0, java.lang.Integer.MAX_VALUE, coverageArea)); + childrenList.add(new Property("catchmentArea", "CodeableConcept", "Need better description.", 0, java.lang.Integer.MAX_VALUE, catchmentArea)); + childrenList.add(new Property("serviceCode", "CodeableConcept", "List of the specific.", 0, java.lang.Integer.MAX_VALUE, serviceCode)); + } + + public HealthcareService copy() { + HealthcareService dst = new HealthcareService(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.location = location == null ? null : location.copy(); + dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); + if (serviceType != null) { + dst.serviceType = new ArrayList(); + for (ServiceTypeComponent i : serviceType) + dst.serviceType.add(i.copy()); + }; + dst.serviceName = serviceName == null ? null : serviceName.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.extraDetails = extraDetails == null ? null : extraDetails.copy(); + dst.freeProvisionCode = freeProvisionCode == null ? null : freeProvisionCode.copy(); + dst.eligibility = eligibility == null ? null : eligibility.copy(); + dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy(); + dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy(); + dst.imageURI = imageURI == null ? null : imageURI.copy(); + if (availableTime != null) { + dst.availableTime = new ArrayList(); + for (HealthcareServiceAvailableTimeComponent i : availableTime) + dst.availableTime.add(i.copy()); + }; + if (notAvailableTime != null) { + dst.notAvailableTime = new ArrayList(); + for (HealthcareServiceNotAvailableTimeComponent i : notAvailableTime) + dst.notAvailableTime.add(i.copy()); + }; + dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); + dst.publicKey = publicKey == null ? null : publicKey.copy(); + if (programName != null) { + dst.programName = new ArrayList(); + for (StringType i : programName) + dst.programName.add(i.copy()); + }; + if (contactPoint != null) { + dst.contactPoint = new ArrayList(); + for (ContactPoint i : contactPoint) + dst.contactPoint.add(i.copy()); + }; + if (characteristic != null) { + dst.characteristic = new ArrayList(); + for (CodeableConcept i : characteristic) + dst.characteristic.add(i.copy()); + }; + if (referralMethod != null) { + dst.referralMethod = new ArrayList(); + for (CodeableConcept i : referralMethod) + dst.referralMethod.add(i.copy()); + }; + if (setting != null) { + dst.setting = new ArrayList(); + for (CodeableConcept i : setting) + dst.setting.add(i.copy()); + }; + if (targetGroup != null) { + dst.targetGroup = new ArrayList(); + for (CodeableConcept i : targetGroup) + dst.targetGroup.add(i.copy()); + }; + if (coverageArea != null) { + dst.coverageArea = new ArrayList(); + for (CodeableConcept i : coverageArea) + dst.coverageArea.add(i.copy()); + }; + if (catchmentArea != null) { + dst.catchmentArea = new ArrayList(); + for (CodeableConcept i : catchmentArea) + dst.catchmentArea.add(i.copy()); + }; + if (serviceCode != null) { + dst.serviceCode = new ArrayList(); + for (CodeableConcept i : serviceCode) + dst.serviceCode.add(i.copy()); + }; + return dst; + } + + protected HealthcareService typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (location == null || location.isEmpty()) + && (serviceCategory == null || serviceCategory.isEmpty()) && (serviceType == null || serviceType.isEmpty()) + && (serviceName == null || serviceName.isEmpty()) && (comment == null || comment.isEmpty()) + && (extraDetails == null || extraDetails.isEmpty()) && (freeProvisionCode == null || freeProvisionCode.isEmpty()) + && (eligibility == null || eligibility.isEmpty()) && (eligibilityNote == null || eligibilityNote.isEmpty()) + && (appointmentRequired == null || appointmentRequired.isEmpty()) && (imageURI == null || imageURI.isEmpty()) + && (availableTime == null || availableTime.isEmpty()) && (notAvailableTime == null || notAvailableTime.isEmpty()) + && (availabilityExceptions == null || availabilityExceptions.isEmpty()) && (publicKey == null || publicKey.isEmpty()) + && (programName == null || programName.isEmpty()) && (contactPoint == null || contactPoint.isEmpty()) + && (characteristic == null || characteristic.isEmpty()) && (referralMethod == null || referralMethod.isEmpty()) + && (setting == null || setting.isEmpty()) && (targetGroup == null || targetGroup.isEmpty()) + && (coverageArea == null || coverageArea.isEmpty()) && (catchmentArea == null || catchmentArea.isEmpty()) + && (serviceCode == null || serviceCode.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.HealthcareService; + } + + @SearchParamDefinition(name="servicecategory", path="HealthcareService.serviceCategory", description="Service Category of the Healthcare Service", type="token" ) + public static final String SP_SERVICECATEGORY = "servicecategory"; + @SearchParamDefinition(name="servicetype", path="HealthcareService.serviceType.type", description="The type of service provided by this healthcare service", type="token" ) + public static final String SP_SERVICETYPE = "servicetype"; + @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="name", path="HealthcareService.serviceName", description="A portion of the Healthcare service name", type="string" ) + public static final String SP_NAME = "name"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java index b84d438f671..d0061feb326 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java @@ -20,639 +20,639 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A human's name with the ability to identify parts and usage. - */ -@DatatypeDef(name="HumanName") -public class HumanName extends Type implements ICompositeType { - - public enum NameUse implements FhirEnum { - /** - * Known as/conventional/the one you normally use. - */ - USUAL, - /** - * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". - */ - OFFICIAL, - /** - * A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. - */ - TEMP, - /** - * A name that is used to address the person in an informal manner, but is not part of their formal or usual name. - */ - NICKNAME, - /** - * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). - */ - ANONYMOUS, - /** - * This name is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. - */ - MAIDEN, - /** - * added to help the parsers - */ - NULL; - - 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)) - return USUAL; - if ("official".equals(codeString)) - return OFFICIAL; - if ("temp".equals(codeString)) - return TEMP; - if ("nickname".equals(codeString)) - return NICKNAME; - if ("anonymous".equals(codeString)) - return ANONYMOUS; - if ("old".equals(codeString)) - return OLD; - if ("maiden".equals(codeString)) - return MAIDEN; - throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case NICKNAME: return "nickname"; - case ANONYMOUS: return "anonymous"; - case OLD: return "old"; - case MAIDEN: return "maiden"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case USUAL: return ""; - case OFFICIAL: return ""; - case TEMP: return ""; - case NICKNAME: return ""; - case ANONYMOUS: return ""; - case OLD: return ""; - case MAIDEN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case USUAL: return "Known as/conventional/the one you normally use."; - case OFFICIAL: return "The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called 'legal name'."; - case TEMP: return "A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations."; - case NICKNAME: return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name."; - case ANONYMOUS: return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)."; - case OLD: return "This name is no longer in use (or was never correct, but retained for records)."; - case MAIDEN: return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store 'maiden' names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case NICKNAME: return "nickname"; - case ANONYMOUS: return "anonymous"; - case OLD: return "old"; - case MAIDEN: return "maiden"; - default: return "?"; - } - } - } - - public static class NameUseEnumFactory implements EnumFactory { - public NameUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return NameUse.USUAL; - if ("official".equals(codeString)) - return NameUse.OFFICIAL; - if ("temp".equals(codeString)) - return NameUse.TEMP; - if ("nickname".equals(codeString)) - return NameUse.NICKNAME; - if ("anonymous".equals(codeString)) - return NameUse.ANONYMOUS; - if ("old".equals(codeString)) - return NameUse.OLD; - if ("maiden".equals(codeString)) - return NameUse.MAIDEN; - throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); - } - public String toCode(NameUse code) throws IllegalArgumentException { - if (code == NameUse.USUAL) - return "usual"; - if (code == NameUse.OFFICIAL) - return "official"; - if (code == NameUse.TEMP) - return "temp"; - if (code == NameUse.NICKNAME) - return "nickname"; - if (code == NameUse.ANONYMOUS) - return "anonymous"; - if (code == NameUse.OLD) - return "old"; - if (code == NameUse.MAIDEN) - return "maiden"; - return "?"; - } - } - - /** - * Identifies the purpose for this name. - */ - @Child(name="use", type={CodeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="usual | official | temp | nickname | anonymous | old | maiden", formalDefinition="Identifies the purpose for this name." ) - protected Enumeration use; - - /** - * A full text representation of the name. - */ - @Child(name="text", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Text representation of the full name", formalDefinition="A full text representation of the name." ) - protected StringType text; - - /** - * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. - */ - @Child(name="family", type={StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Family name (often called 'Surname')", formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." ) - protected List family; - - /** - * Given name. - */ - @Child(name="given", type={StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Given names (not always 'first'). Includes middle names", formalDefinition="Given name." ) - protected List given; - - /** - * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. - */ - @Child(name="prefix", type={StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parts that come before the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name." ) - protected List prefix; - - /** - * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. - */ - @Child(name="suffix", type={StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parts that come after the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name." ) - protected List suffix; - - /** - * Indicates the period of time when this name was valid for the named person. - */ - @Child(name="period", type={Period.class}, order=5, min=0, max=1) - @Description(shortDefinition="Time period when name was/is in use", formalDefinition="Indicates the period of time when this name was valid for the named person." ) - protected Period period; - - private static final long serialVersionUID = -210174642L; - - public HumanName() { - super(); - } - - /** - * @return {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public HumanName setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Identifies the purpose for this name. - */ - public NameUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Identifies the purpose for this name. - */ - public HumanName setUse(NameUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(NameUse.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public HumanName setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A full text representation of the name. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A full text representation of the name. - */ - public HumanName setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public List getFamily() { - if (this.family == null) - this.family = new ArrayList(); - return this.family; - } - - public boolean hasFamily() { - if (this.family == null) - return false; - for (StringType item : this.family) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - // syntactic sugar - public StringType addFamilyElement() {//2 - StringType t = new StringType(); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return t; - } - - /** - * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public HumanName addFamily(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return this; - } - - /** - * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public boolean hasFamily(String value) { - if (this.family == null) - return false; - for (StringType v : this.family) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #given} (Given name.) - */ - public List getGiven() { - if (this.given == null) - this.given = new ArrayList(); - return this.given; - } - - public boolean hasGiven() { - if (this.given == null) - return false; - for (StringType item : this.given) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #given} (Given name.) - */ - // syntactic sugar - public StringType addGivenElement() {//2 - StringType t = new StringType(); - if (this.given == null) - this.given = new ArrayList(); - this.given.add(t); - return t; - } - - /** - * @param value {@link #given} (Given name.) - */ - public HumanName addGiven(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.given == null) - this.given = new ArrayList(); - this.given.add(t); - return this; - } - - /** - * @param value {@link #given} (Given name.) - */ - public boolean hasGiven(String value) { - if (this.given == null) - return false; - for (StringType v : this.given) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public List getPrefix() { - if (this.prefix == null) - this.prefix = new ArrayList(); - return this.prefix; - } - - public boolean hasPrefix() { - if (this.prefix == null) - return false; - for (StringType item : this.prefix) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - // syntactic sugar - public StringType addPrefixElement() {//2 - StringType t = new StringType(); - if (this.prefix == null) - this.prefix = new ArrayList(); - this.prefix.add(t); - return t; - } - - /** - * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public HumanName addPrefix(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.prefix == null) - this.prefix = new ArrayList(); - this.prefix.add(t); - return this; - } - - /** - * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public boolean hasPrefix(String value) { - if (this.prefix == null) - return false; - for (StringType v : this.prefix) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public List getSuffix() { - if (this.suffix == null) - this.suffix = new ArrayList(); - return this.suffix; - } - - public boolean hasSuffix() { - if (this.suffix == null) - return false; - for (StringType item : this.suffix) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - // syntactic sugar - public StringType addSuffixElement() {//2 - StringType t = new StringType(); - if (this.suffix == null) - this.suffix = new ArrayList(); - this.suffix.add(t); - return t; - } - - /** - * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public HumanName addSuffix(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.suffix == null) - this.suffix = new ArrayList(); - this.suffix.add(t); - return this; - } - - /** - * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public boolean hasSuffix(String value) { - if (this.suffix == null) - return false; - for (StringType v : this.suffix) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #period} (Indicates the period of time when this name was valid for the named person.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.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 the period of time when this name was valid for the named person.) - */ - public HumanName setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "Identifies the purpose for this name.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("text", "string", "A full text representation of the name.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("family", "string", "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.", 0, java.lang.Integer.MAX_VALUE, family)); - childrenList.add(new Property("given", "string", "Given name.", 0, java.lang.Integer.MAX_VALUE, given)); - childrenList.add(new Property("prefix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", 0, java.lang.Integer.MAX_VALUE, prefix)); - childrenList.add(new Property("suffix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", 0, java.lang.Integer.MAX_VALUE, suffix)); - childrenList.add(new Property("period", "Period", "Indicates the period of time when this name was valid for the named person.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public HumanName copy() { - HumanName dst = new HumanName(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.text = text == null ? null : text.copy(); - if (family != null) { - dst.family = new ArrayList(); - for (StringType i : family) - dst.family.add(i.copy()); - }; - if (given != null) { - dst.given = new ArrayList(); - for (StringType i : given) - dst.given.add(i.copy()); - }; - if (prefix != null) { - dst.prefix = new ArrayList(); - for (StringType i : prefix) - dst.prefix.add(i.copy()); - }; - if (suffix != null) { - dst.suffix = new ArrayList(); - for (StringType i : suffix) - dst.suffix.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected HumanName typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) - && (family == null || family.isEmpty()) && (given == null || given.isEmpty()) && (prefix == null || prefix.isEmpty()) - && (suffix == null || suffix.isEmpty()) && (period == null || period.isEmpty()); - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A human's name with the ability to identify parts and usage. + */ +@DatatypeDef(name="HumanName") +public class HumanName extends Type implements ICompositeType { + + public enum NameUse implements FhirEnum { + /** + * Known as/conventional/the one you normally use. + */ + USUAL, + /** + * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". + */ + OFFICIAL, + /** + * A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. + */ + TEMP, + /** + * A name that is used to address the person in an informal manner, but is not part of their formal or usual name. + */ + NICKNAME, + /** + * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). + */ + ANONYMOUS, + /** + * This name is no longer in use (or was never correct, but retained for records). + */ + OLD, + /** + * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. + */ + MAIDEN, + /** + * added to help the parsers + */ + NULL; + + 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)) + return USUAL; + if ("official".equals(codeString)) + return OFFICIAL; + if ("temp".equals(codeString)) + return TEMP; + if ("nickname".equals(codeString)) + return NICKNAME; + if ("anonymous".equals(codeString)) + return ANONYMOUS; + if ("old".equals(codeString)) + return OLD; + if ("maiden".equals(codeString)) + return MAIDEN; + throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case NICKNAME: return "nickname"; + case ANONYMOUS: return "anonymous"; + case OLD: return "old"; + case MAIDEN: return "maiden"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case USUAL: return ""; + case OFFICIAL: return ""; + case TEMP: return ""; + case NICKNAME: return ""; + case ANONYMOUS: return ""; + case OLD: return ""; + case MAIDEN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case USUAL: return "Known as/conventional/the one you normally use."; + case OFFICIAL: return "The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called 'legal name'."; + case TEMP: return "A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations."; + case NICKNAME: return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name."; + case ANONYMOUS: return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)."; + case OLD: return "This name is no longer in use (or was never correct, but retained for records)."; + case MAIDEN: return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store 'maiden' names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case NICKNAME: return "nickname"; + case ANONYMOUS: return "anonymous"; + case OLD: return "old"; + case MAIDEN: return "maiden"; + default: return "?"; + } + } + } + + public static class NameUseEnumFactory implements EnumFactory { + public NameUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return NameUse.USUAL; + if ("official".equals(codeString)) + return NameUse.OFFICIAL; + if ("temp".equals(codeString)) + return NameUse.TEMP; + if ("nickname".equals(codeString)) + return NameUse.NICKNAME; + if ("anonymous".equals(codeString)) + return NameUse.ANONYMOUS; + if ("old".equals(codeString)) + return NameUse.OLD; + if ("maiden".equals(codeString)) + return NameUse.MAIDEN; + throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); + } + public String toCode(NameUse code) throws IllegalArgumentException { + if (code == NameUse.USUAL) + return "usual"; + if (code == NameUse.OFFICIAL) + return "official"; + if (code == NameUse.TEMP) + return "temp"; + if (code == NameUse.NICKNAME) + return "nickname"; + if (code == NameUse.ANONYMOUS) + return "anonymous"; + if (code == NameUse.OLD) + return "old"; + if (code == NameUse.MAIDEN) + return "maiden"; + return "?"; + } + } + + /** + * Identifies the purpose for this name. + */ + @Child(name="use", type={CodeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="usual | official | temp | nickname | anonymous | old | maiden", formalDefinition="Identifies the purpose for this name." ) + protected Enumeration use; + + /** + * A full text representation of the name. + */ + @Child(name="text", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Text representation of the full name", formalDefinition="A full text representation of the name." ) + protected StringType text; + + /** + * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. + */ + @Child(name="family", type={StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Family name (often called 'Surname')", formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father." ) + protected List family; + + /** + * Given name. + */ + @Child(name="given", type={StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Given names (not always 'first'). Includes middle names", formalDefinition="Given name." ) + protected List given; + + /** + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. + */ + @Child(name="prefix", type={StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parts that come before the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name." ) + protected List prefix; + + /** + * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. + */ + @Child(name="suffix", type={StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parts that come after the name", formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name." ) + protected List suffix; + + /** + * Indicates the period of time when this name was valid for the named person. + */ + @Child(name="period", type={Period.class}, order=5, min=0, max=1) + @Description(shortDefinition="Time period when name was/is in use", formalDefinition="Indicates the period of time when this name was valid for the named person." ) + protected Period period; + + private static final long serialVersionUID = -210174642L; + + public HumanName() { + super(); + } + + /** + * @return {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public HumanName setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Identifies the purpose for this name. + */ + public NameUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Identifies the purpose for this name. + */ + public HumanName setUse(NameUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(NameUse.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public HumanName setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return A full text representation of the name. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value A full text representation of the name. + */ + public HumanName setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public List getFamily() { + if (this.family == null) + this.family = new ArrayList(); + return this.family; + } + + public boolean hasFamily() { + if (this.family == null) + return false; + for (StringType item : this.family) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + // syntactic sugar + public StringType addFamilyElement() {//2 + StringType t = new StringType(); + if (this.family == null) + this.family = new ArrayList(); + this.family.add(t); + return t; + } + + /** + * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public HumanName addFamily(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.family == null) + this.family = new ArrayList(); + this.family.add(t); + return this; + } + + /** + * @param value {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) + */ + public boolean hasFamily(String value) { + if (this.family == null) + return false; + for (StringType v : this.family) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #given} (Given name.) + */ + public List getGiven() { + if (this.given == null) + this.given = new ArrayList(); + return this.given; + } + + public boolean hasGiven() { + if (this.given == null) + return false; + for (StringType item : this.given) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #given} (Given name.) + */ + // syntactic sugar + public StringType addGivenElement() {//2 + StringType t = new StringType(); + if (this.given == null) + this.given = new ArrayList(); + this.given.add(t); + return t; + } + + /** + * @param value {@link #given} (Given name.) + */ + public HumanName addGiven(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.given == null) + this.given = new ArrayList(); + this.given.add(t); + return this; + } + + /** + * @param value {@link #given} (Given name.) + */ + public boolean hasGiven(String value) { + if (this.given == null) + return false; + for (StringType v : this.given) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public List getPrefix() { + if (this.prefix == null) + this.prefix = new ArrayList(); + return this.prefix; + } + + public boolean hasPrefix() { + if (this.prefix == null) + return false; + for (StringType item : this.prefix) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + // syntactic sugar + public StringType addPrefixElement() {//2 + StringType t = new StringType(); + if (this.prefix == null) + this.prefix = new ArrayList(); + this.prefix.add(t); + return t; + } + + /** + * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public HumanName addPrefix(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.prefix == null) + this.prefix = new ArrayList(); + this.prefix.add(t); + return this; + } + + /** + * @param value {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) + */ + public boolean hasPrefix(String value) { + if (this.prefix == null) + return false; + for (StringType v : this.prefix) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public List getSuffix() { + if (this.suffix == null) + this.suffix = new ArrayList(); + return this.suffix; + } + + public boolean hasSuffix() { + if (this.suffix == null) + return false; + for (StringType item : this.suffix) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + // syntactic sugar + public StringType addSuffixElement() {//2 + StringType t = new StringType(); + if (this.suffix == null) + this.suffix = new ArrayList(); + this.suffix.add(t); + return t; + } + + /** + * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public HumanName addSuffix(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.suffix == null) + this.suffix = new ArrayList(); + this.suffix.add(t); + return this; + } + + /** + * @param value {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) + */ + public boolean hasSuffix(String value) { + if (this.suffix == null) + return false; + for (StringType v : this.suffix) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #period} (Indicates the period of time when this name was valid for the named person.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create HumanName.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 the period of time when this name was valid for the named person.) + */ + public HumanName setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "Identifies the purpose for this name.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("text", "string", "A full text representation of the name.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("family", "string", "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.", 0, java.lang.Integer.MAX_VALUE, family)); + childrenList.add(new Property("given", "string", "Given name.", 0, java.lang.Integer.MAX_VALUE, given)); + childrenList.add(new Property("prefix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", 0, java.lang.Integer.MAX_VALUE, prefix)); + childrenList.add(new Property("suffix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", 0, java.lang.Integer.MAX_VALUE, suffix)); + childrenList.add(new Property("period", "Period", "Indicates the period of time when this name was valid for the named person.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public HumanName copy() { + HumanName dst = new HumanName(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.text = text == null ? null : text.copy(); + if (family != null) { + dst.family = new ArrayList(); + for (StringType i : family) + dst.family.add(i.copy()); + }; + if (given != null) { + dst.given = new ArrayList(); + for (StringType i : given) + dst.given.add(i.copy()); + }; + if (prefix != null) { + dst.prefix = new ArrayList(); + for (StringType i : prefix) + dst.prefix.add(i.copy()); + }; + if (suffix != null) { + dst.suffix = new ArrayList(); + for (StringType i : suffix) + dst.suffix.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected HumanName typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (text == null || text.isEmpty()) + && (family == null || family.isEmpty()) && (given == null || given.isEmpty()) && (prefix == null || prefix.isEmpty()) + && (suffix == null || suffix.isEmpty()) && (period == null || period.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java index 9a601577a70..8306c37cf5a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.instance.model; /* @@ -48,43 +48,43 @@ package org.hl7.fhir.instance.model; * #L% */ - -/** - * Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "." - */ -public class IdType extends PrimitiveType { - - public static final int MAX_LENGTH = 64; - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public IdType() { - super(); - } - - /** - * Constructor - */ - public IdType(String theValue) { - setValue(theValue); - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public IdType copy() { - return new IdType(getValue()); - } - -} \ No newline at end of file + +/** + * Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "." + */ +public class IdType extends PrimitiveType { + + public static final int MAX_LENGTH = 64; + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public IdType() { + super(); + } + + /** + * Constructor + */ + public IdType(String theValue) { + setValue(theValue); + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public IdType copy() { + return new IdType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java index 714b1744c1e..1b67aaa6907 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java @@ -20,503 +20,503 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A technical identifier - identifies some entity uniquely and unambiguously. - */ -@DatatypeDef(name="Identifier") -public class Identifier extends Type implements ICompositeType{ - - public enum IdentifierUse implements FhirEnum { - /** - * the identifier recommended for display and use in real-world interactions. - */ - USUAL, - /** - * the identifier considered to be most trusted for the identification of this item. - */ - OFFICIAL, - /** - * A temporary identifier. - */ - TEMP, - /** - * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context. - */ - SECONDARY, - /** - * added to help the parsers - */ - NULL; - - 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)) - return USUAL; - if ("official".equals(codeString)) - return OFFICIAL; - if ("temp".equals(codeString)) - return TEMP; - if ("secondary".equals(codeString)) - return SECONDARY; - throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case SECONDARY: return "secondary"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case USUAL: return ""; - case OFFICIAL: return ""; - case TEMP: return ""; - case SECONDARY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case USUAL: return "the identifier recommended for display and use in real-world interactions."; - case OFFICIAL: return "the identifier considered to be most trusted for the identification of this item."; - case TEMP: return "A temporary identifier."; - case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case SECONDARY: return "secondary"; - default: return "?"; - } - } - } - - public static class IdentifierUseEnumFactory implements EnumFactory { - public IdentifierUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return IdentifierUse.USUAL; - if ("official".equals(codeString)) - return IdentifierUse.OFFICIAL; - if ("temp".equals(codeString)) - return IdentifierUse.TEMP; - if ("secondary".equals(codeString)) - return IdentifierUse.SECONDARY; - throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); - } - public String toCode(IdentifierUse code) throws IllegalArgumentException { - if (code == IdentifierUse.USUAL) - return "usual"; - if (code == IdentifierUse.OFFICIAL) - return "official"; - if (code == IdentifierUse.TEMP) - return "temp"; - if (code == IdentifierUse.SECONDARY) - return "secondary"; - return "?"; - } - } - - /** - * The purpose of this identifier. - */ - @Child(name="use", type={CodeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="usual | official | temp | secondary (If known)", formalDefinition="The purpose of this identifier." ) - protected Enumeration use; - - /** - * A text string for the identifier that can be displayed to a human so they can recognize the identifier. - */ - @Child(name="label", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Description of identifier", formalDefinition="A text string for the identifier that can be displayed to a human so they can recognize the identifier." ) - protected StringType label; - - /** - * Establishes the namespace in which set of possible id values is unique. - */ - @Child(name="system", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="The namespace for the identifier", formalDefinition="Establishes the namespace in which set of possible id values is unique." ) - protected UriType system; - - /** - * The portion of the identifier typically displayed to the user and which is unique within the context of the system. - */ - @Child(name="value", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system." ) - protected StringType value; - - /** - * Time period during which identifier is/was valid for use. - */ - @Child(name="period", type={Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." ) - protected Period period; - - /** - * Organization that issued/manages the identifier. - */ - @Child(name="assigner", type={Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." ) - protected Reference assigner; - - /** - * The actual object that is the target of the reference (Organization that issued/manages the identifier.) - */ - protected Organization assignerTarget; - - private static final long serialVersionUID = 334577297L; - - public Identifier() { - super(); - } - - /** - * @return {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Identifier setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return The purpose of this identifier. - */ - public IdentifierUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value The purpose of this identifier. - */ - public Identifier setUse(IdentifierUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(IdentifierUse.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #label} (A text string for the identifier that can be displayed to a human so they can recognize the identifier.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (A text string for the identifier that can be displayed to a human so they can recognize the identifier.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public Identifier setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return A text string for the identifier that can be displayed to a human so they can recognize the identifier. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value A text string for the identifier that can be displayed to a human so they can recognize the identifier. - */ - public Identifier setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Identifier setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return Establishes the namespace in which set of possible id values is unique. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value Establishes the namespace in which set of possible id values is unique. - */ - public Identifier setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Identifier setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The portion of the identifier typically displayed to the user and which is unique within the context of the system. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The portion of the identifier typically displayed to the user and which is unique within the context of the system. - */ - public Identifier setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period during which identifier is/was valid for use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.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} (Time period during which identifier is/was valid for use.) - */ - public Identifier setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #assigner} (Organization that issued/manages the identifier.) - */ - public Reference getAssigner() { - if (this.assigner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.assigner"); - else if (Configuration.doAutoCreate()) - this.assigner = new Reference(); - return this.assigner; - } - - public boolean hasAssigner() { - return this.assigner != null && !this.assigner.isEmpty(); - } - - /** - * @param value {@link #assigner} (Organization that issued/manages the identifier.) - */ - public Identifier setAssigner(Reference value) { - this.assigner = value; - return this; - } - - /** - * @return {@link #assigner} 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. (Organization that issued/manages the identifier.) - */ - public Organization getAssignerTarget() { - if (this.assignerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.assigner"); - else if (Configuration.doAutoCreate()) - this.assignerTarget = new Organization(); - return this.assignerTarget; - } - - /** - * @param value {@link #assigner} 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. (Organization that issued/manages the identifier.) - */ - public Identifier setAssignerTarget(Organization value) { - this.assignerTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "The purpose of this identifier.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("label", "string", "A text string for the identifier that can be displayed to a human so they can recognize the identifier.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("system", "uri", "Establishes the namespace in which set of possible id values is unique.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("value", "string", "The portion of the identifier typically displayed to the user and which is unique within the context of the system.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, java.lang.Integer.MAX_VALUE, assigner)); - } - - public Identifier copy() { - Identifier dst = new Identifier(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.label = label == null ? null : label.copy(); - dst.system = system == null ? null : system.copy(); - dst.value = value == null ? null : value.copy(); - dst.period = period == null ? null : period.copy(); - dst.assigner = assigner == null ? null : assigner.copy(); - return dst; - } - - protected Identifier typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (label == null || label.isEmpty()) - && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) && (period == null || period.isEmpty()) - && (assigner == null || assigner.isEmpty()); - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A technical identifier - identifies some entity uniquely and unambiguously. + */ +@DatatypeDef(name="Identifier") +public class Identifier extends Type implements ICompositeType{ + + public enum IdentifierUse implements FhirEnum { + /** + * the identifier recommended for display and use in real-world interactions. + */ + USUAL, + /** + * the identifier considered to be most trusted for the identification of this item. + */ + OFFICIAL, + /** + * A temporary identifier. + */ + TEMP, + /** + * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context. + */ + SECONDARY, + /** + * added to help the parsers + */ + NULL; + + 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)) + return USUAL; + if ("official".equals(codeString)) + return OFFICIAL; + if ("temp".equals(codeString)) + return TEMP; + if ("secondary".equals(codeString)) + return SECONDARY; + throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case SECONDARY: return "secondary"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case USUAL: return ""; + case OFFICIAL: return ""; + case TEMP: return ""; + case SECONDARY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case USUAL: return "the identifier recommended for display and use in real-world interactions."; + case OFFICIAL: return "the identifier considered to be most trusted for the identification of this item."; + case TEMP: return "A temporary identifier."; + case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case USUAL: return "usual"; + case OFFICIAL: return "official"; + case TEMP: return "temp"; + case SECONDARY: return "secondary"; + default: return "?"; + } + } + } + + public static class IdentifierUseEnumFactory implements EnumFactory { + public IdentifierUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("usual".equals(codeString)) + return IdentifierUse.USUAL; + if ("official".equals(codeString)) + return IdentifierUse.OFFICIAL; + if ("temp".equals(codeString)) + return IdentifierUse.TEMP; + if ("secondary".equals(codeString)) + return IdentifierUse.SECONDARY; + throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); + } + public String toCode(IdentifierUse code) throws IllegalArgumentException { + if (code == IdentifierUse.USUAL) + return "usual"; + if (code == IdentifierUse.OFFICIAL) + return "official"; + if (code == IdentifierUse.TEMP) + return "temp"; + if (code == IdentifierUse.SECONDARY) + return "secondary"; + return "?"; + } + } + + /** + * The purpose of this identifier. + */ + @Child(name="use", type={CodeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="usual | official | temp | secondary (If known)", formalDefinition="The purpose of this identifier." ) + protected Enumeration use; + + /** + * A text string for the identifier that can be displayed to a human so they can recognize the identifier. + */ + @Child(name="label", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Description of identifier", formalDefinition="A text string for the identifier that can be displayed to a human so they can recognize the identifier." ) + protected StringType label; + + /** + * Establishes the namespace in which set of possible id values is unique. + */ + @Child(name="system", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The namespace for the identifier", formalDefinition="Establishes the namespace in which set of possible id values is unique." ) + protected UriType system; + + /** + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + */ + @Child(name="value", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system." ) + protected StringType value; + + /** + * Time period during which identifier is/was valid for use. + */ + @Child(name="period", type={Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." ) + protected Period period; + + /** + * Organization that issued/manages the identifier. + */ + @Child(name="assigner", type={Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." ) + protected Reference assigner; + + /** + * The actual object that is the target of the reference (Organization that issued/manages the identifier.) + */ + protected Organization assignerTarget; + + private static final long serialVersionUID = 334577297L; + + public Identifier() { + super(); + } + + /** + * @return {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Identifier setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return The purpose of this identifier. + */ + public IdentifierUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value The purpose of this identifier. + */ + public Identifier setUse(IdentifierUse value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(IdentifierUse.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #label} (A text string for the identifier that can be displayed to a human so they can recognize the identifier.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public StringType getLabelElement() { + if (this.label == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.label"); + else if (Configuration.doAutoCreate()) + this.label = new StringType(); + return this.label; + } + + public boolean hasLabelElement() { + return this.label != null && !this.label.isEmpty(); + } + + public boolean hasLabel() { + return this.label != null && !this.label.isEmpty(); + } + + /** + * @param value {@link #label} (A text string for the identifier that can be displayed to a human so they can recognize the identifier.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value + */ + public Identifier setLabelElement(StringType value) { + this.label = value; + return this; + } + + /** + * @return A text string for the identifier that can be displayed to a human so they can recognize the identifier. + */ + public String getLabel() { + return this.label == null ? null : this.label.getValue(); + } + + /** + * @param value A text string for the identifier that can be displayed to a human so they can recognize the identifier. + */ + public Identifier setLabel(String value) { + if (Utilities.noString(value)) + this.label = null; + else { + if (this.label == null) + this.label = new StringType(); + this.label.setValue(value); + } + return this; + } + + /** + * @return {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Identifier setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return Establishes the namespace in which set of possible id values is unique. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value Establishes the namespace in which set of possible id values is unique. + */ + public Identifier setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The portion of the identifier typically displayed to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Identifier setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The portion of the identifier typically displayed to the user and which is unique within the context of the system. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The portion of the identifier typically displayed to the user and which is unique within the context of the system. + */ + public Identifier setValue(String value) { + if (Utilities.noString(value)) + this.value = null; + else { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Time period during which identifier is/was valid for use.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.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} (Time period during which identifier is/was valid for use.) + */ + public Identifier setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #assigner} (Organization that issued/manages the identifier.) + */ + public Reference getAssigner() { + if (this.assigner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.assigner"); + else if (Configuration.doAutoCreate()) + this.assigner = new Reference(); + return this.assigner; + } + + public boolean hasAssigner() { + return this.assigner != null && !this.assigner.isEmpty(); + } + + /** + * @param value {@link #assigner} (Organization that issued/manages the identifier.) + */ + public Identifier setAssigner(Reference value) { + this.assigner = value; + return this; + } + + /** + * @return {@link #assigner} 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. (Organization that issued/manages the identifier.) + */ + public Organization getAssignerTarget() { + if (this.assignerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Identifier.assigner"); + else if (Configuration.doAutoCreate()) + this.assignerTarget = new Organization(); + return this.assignerTarget; + } + + /** + * @param value {@link #assigner} 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. (Organization that issued/manages the identifier.) + */ + public Identifier setAssignerTarget(Organization value) { + this.assignerTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("use", "code", "The purpose of this identifier.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("label", "string", "A text string for the identifier that can be displayed to a human so they can recognize the identifier.", 0, java.lang.Integer.MAX_VALUE, label)); + childrenList.add(new Property("system", "uri", "Establishes the namespace in which set of possible id values is unique.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("value", "string", "The portion of the identifier typically displayed to the user and which is unique within the context of the system.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, java.lang.Integer.MAX_VALUE, assigner)); + } + + public Identifier copy() { + Identifier dst = new Identifier(); + copyValues(dst); + dst.use = use == null ? null : use.copy(); + dst.label = label == null ? null : label.copy(); + dst.system = system == null ? null : system.copy(); + dst.value = value == null ? null : value.copy(); + dst.period = period == null ? null : period.copy(); + dst.assigner = assigner == null ? null : assigner.copy(); + return dst; + } + + protected Identifier typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (use == null || use.isEmpty()) && (label == null || label.isEmpty()) + && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) && (period == null || period.isEmpty()) + && (assigner == null || assigner.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java index c247bdb0b59..6303edf626a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java @@ -20,1214 +20,1214 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. - */ -@ResourceDef(name="ImagingObjectSelection", profile="http://hl7.org/fhir/Profile/ImagingObjectSelection") -public class ImagingObjectSelection extends DomainResource { - - @Block() - public static class StudyComponent extends BackboneElement { - /** - * Study instance uid of the SOP instances in the selection. - */ - @Child(name="uid", type={OidType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Study instance uid", formalDefinition="Study instance uid of the SOP instances in the selection." ) - protected OidType uid; - - /** + +/* + 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; +/** + * A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + */ +@ResourceDef(name="ImagingObjectSelection", profile="http://hl7.org/fhir/Profile/ImagingObjectSelection") +public class ImagingObjectSelection extends DomainResource { + + @Block() + public static class StudyComponent extends BackboneElement { + /** + * Study instance uid of the SOP instances in the selection. + */ + @Child(name="uid", type={OidType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Study instance uid", formalDefinition="Study instance uid of the SOP instances in the selection." ) + protected OidType uid; + + /** * The DICOM Application Entity Title where the study can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection. - */ - @Child(name="retrieveAETitle", type={IdType.class}, order=2, min=0, max=1) - @Description(shortDefinition="AE Title where may be retrieved", formalDefinition="The DICOM Application Entity Title where the study can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection." ) - protected IdType retrieveAETitle; - - /** - * WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - @Child(name="retrieveUrl", type={UriType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection." ) - protected UriType retrieveUrl; - - /** - * Series indetity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name="series", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series indetity and locating information of the DICOM SOP instances in the selection." ) - protected List series; - - private static final long serialVersionUID = -1655229615L; - - public StudyComponent() { - super(); - } - - public StudyComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public StudyComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Study instance uid of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Study instance uid of the SOP instances in the selection. - */ - public StudyComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection. + */ + @Child(name="retrieveAETitle", type={IdType.class}, order=2, min=0, max=1) + @Description(shortDefinition="AE Title where may be retrieved", formalDefinition="The DICOM Application Entity Title where the study can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection." ) + protected IdType retrieveAETitle; + + /** + * WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + @Child(name="retrieveUrl", type={UriType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection." ) + protected UriType retrieveUrl; + + /** + * Series indetity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name="series", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series indetity and locating information of the DICOM SOP instances in the selection." ) + protected List series; + + private static final long serialVersionUID = -1655229615L; + + public StudyComponent() { + super(); + } + + public StudyComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Study instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public StudyComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Study instance uid of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Study instance uid of the SOP instances in the selection. + */ + public StudyComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** * @return {@link #retrieveAETitle} (The DICOM Application Entity Title where the study can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value - */ - public IdType getRetrieveAETitleElement() { - if (this.retrieveAETitle == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.retrieveAETitle"); - else if (Configuration.doAutoCreate()) - this.retrieveAETitle = new IdType(); - return this.retrieveAETitle; - } - - public boolean hasRetrieveAETitleElement() { - return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); - } - - public boolean hasRetrieveAETitle() { - return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value + */ + public IdType getRetrieveAETitleElement() { + if (this.retrieveAETitle == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.retrieveAETitle"); + else if (Configuration.doAutoCreate()) + this.retrieveAETitle = new IdType(); + return this.retrieveAETitle; + } + + public boolean hasRetrieveAETitleElement() { + return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); + } + + public boolean hasRetrieveAETitle() { + return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); + } + + /** * @param value {@link #retrieveAETitle} (The DICOM Application Entity Title where the study can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value - */ - public StudyComponent setRetrieveAETitleElement(IdType value) { - this.retrieveAETitle = value; - return this; - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value + */ + public StudyComponent setRetrieveAETitleElement(IdType value) { + this.retrieveAETitle = value; + return this; + } + + /** * @return The DICOM Application Entity Title where the study can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection. - */ - public String getRetrieveAETitle() { - return this.retrieveAETitle == null ? null : this.retrieveAETitle.getValue(); - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection. + */ + public String getRetrieveAETitle() { + return this.retrieveAETitle == null ? null : this.retrieveAETitle.getValue(); + } + + /** * @param value The DICOM Application Entity Title where the study can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection. - */ - public StudyComponent setRetrieveAETitle(String value) { - if (Utilities.noString(value)) - this.retrieveAETitle = null; - else { - if (this.retrieveAETitle == null) - this.retrieveAETitle = new IdType(); - this.retrieveAETitle.setValue(value); - } - return this; - } - - /** - * @return {@link #retrieveUrl} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value - */ - public UriType getRetrieveUrlElement() { - if (this.retrieveUrl == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.retrieveUrl"); - else if (Configuration.doAutoCreate()) - this.retrieveUrl = new UriType(); - return this.retrieveUrl; - } - - public boolean hasRetrieveUrlElement() { - return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); - } - - public boolean hasRetrieveUrl() { - return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); - } - - /** - * @param value {@link #retrieveUrl} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value - */ - public StudyComponent setRetrieveUrlElement(UriType value) { - this.retrieveUrl = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - public String getRetrieveUrl() { - return this.retrieveUrl == null ? null : this.retrieveUrl.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - public StudyComponent setRetrieveUrl(String value) { - if (Utilities.noString(value)) - this.retrieveUrl = null; - else { - if (this.retrieveUrl == null) - this.retrieveUrl = new UriType(); - this.retrieveUrl.setValue(value); - } - return this; - } - - /** - * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (SeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public SeriesComponent addSeries() { //3 - SeriesComponent t = new SeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Study instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("retrieveAETitle", "id", "The DICOM Application Entity Title where the study can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveAETitle)); - childrenList.add(new Property("retrieveUrl", "uri", "WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveUrl)); - childrenList.add(new Property("series", "", "Series indetity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - public StudyComponent copy() { - StudyComponent dst = new StudyComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.retrieveAETitle = retrieveAETitle == null ? null : retrieveAETitle.copy(); - dst.retrieveUrl = retrieveUrl == null ? null : retrieveUrl.copy(); - if (series != null) { - dst.series = new ArrayList(); - for (SeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (retrieveAETitle == null || retrieveAETitle.isEmpty()) - && (retrieveUrl == null || retrieveUrl.isEmpty()) && (series == null || series.isEmpty()) - ; - } - - } - - @Block() - public static class SeriesComponent extends BackboneElement { - /** - * Series instance uid of the SOP instances in the selection. - */ - @Child(name="uid", type={OidType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Series instance uid", formalDefinition="Series instance uid of the SOP instances in the selection." ) - protected OidType uid; - - /** +Note that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection. + */ + public StudyComponent setRetrieveAETitle(String value) { + if (Utilities.noString(value)) + this.retrieveAETitle = null; + else { + if (this.retrieveAETitle == null) + this.retrieveAETitle = new IdType(); + this.retrieveAETitle.setValue(value); + } + return this; + } + + /** + * @return {@link #retrieveUrl} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value + */ + public UriType getRetrieveUrlElement() { + if (this.retrieveUrl == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StudyComponent.retrieveUrl"); + else if (Configuration.doAutoCreate()) + this.retrieveUrl = new UriType(); + return this.retrieveUrl; + } + + public boolean hasRetrieveUrlElement() { + return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); + } + + public boolean hasRetrieveUrl() { + return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); + } + + /** + * @param value {@link #retrieveUrl} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value + */ + public StudyComponent setRetrieveUrlElement(UriType value) { + this.retrieveUrl = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + public String getRetrieveUrl() { + return this.retrieveUrl == null ? null : this.retrieveUrl.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + */ + public StudyComponent setRetrieveUrl(String value) { + if (Utilities.noString(value)) + this.retrieveUrl = null; + else { + if (this.retrieveUrl == null) + this.retrieveUrl = new UriType(); + this.retrieveUrl.setValue(value); + } + return this; + } + + /** + * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (SeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Series indetity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public SeriesComponent addSeries() { //3 + SeriesComponent t = new SeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Study instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("retrieveAETitle", "id", "The DICOM Application Entity Title where the study can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveAETitle)); + childrenList.add(new Property("retrieveUrl", "uri", "WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveUrl)); + childrenList.add(new Property("series", "", "Series indetity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + public StudyComponent copy() { + StudyComponent dst = new StudyComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.retrieveAETitle = retrieveAETitle == null ? null : retrieveAETitle.copy(); + dst.retrieveUrl = retrieveUrl == null ? null : retrieveUrl.copy(); + if (series != null) { + dst.series = new ArrayList(); + for (SeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (retrieveAETitle == null || retrieveAETitle.isEmpty()) + && (retrieveUrl == null || retrieveUrl.isEmpty()) && (series == null || series.isEmpty()) + ; + } + + } + + @Block() + public static class SeriesComponent extends BackboneElement { + /** + * Series instance uid of the SOP instances in the selection. + */ + @Child(name="uid", type={OidType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Series instance uid", formalDefinition="Series instance uid of the SOP instances in the selection." ) + protected OidType uid; + + /** * The DICOM Application Entity Title where the series can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection. - */ - @Child(name="retrieveAETitle", type={IdType.class}, order=2, min=0, max=1) - @Description(shortDefinition="AE Title where may be retrieved", formalDefinition="The DICOM Application Entity Title where the series can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection." ) - protected IdType retrieveAETitle; - - /** - * WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - @Child(name="retrieveUrl", type={UriType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection." ) - protected UriType retrieveUrl; - - /** - * Identity and locating information of the selected DICOM SOP instances. - */ - @Child(name="instance", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) - protected List instance; - - private static final long serialVersionUID = -156906991L; - - public SeriesComponent() { - super(); - } - - public SeriesComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public SeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Series instance uid of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Series instance uid of the SOP instances in the selection. - */ - public SeriesComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection. + */ + @Child(name="retrieveAETitle", type={IdType.class}, order=2, min=0, max=1) + @Description(shortDefinition="AE Title where may be retrieved", formalDefinition="The DICOM Application Entity Title where the series can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection." ) + protected IdType retrieveAETitle; + + /** + * WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + @Child(name="retrieveUrl", type={UriType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection." ) + protected UriType retrieveUrl; + + /** + * Identity and locating information of the selected DICOM SOP instances. + */ + @Child(name="instance", type={}, order=4, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) + protected List instance; + + private static final long serialVersionUID = -156906991L; + + public SeriesComponent() { + super(); + } + + public SeriesComponent(OidType uid) { + super(); + this.uid = uid; + } + + /** + * @return {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Series instance uid of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public SeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Series instance uid of the SOP instances in the selection. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Series instance uid of the SOP instances in the selection. + */ + public SeriesComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** * @return {@link #retrieveAETitle} (The DICOM Application Entity Title where the series can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value - */ - public IdType getRetrieveAETitleElement() { - if (this.retrieveAETitle == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.retrieveAETitle"); - else if (Configuration.doAutoCreate()) - this.retrieveAETitle = new IdType(); - return this.retrieveAETitle; - } - - public boolean hasRetrieveAETitleElement() { - return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); - } - - public boolean hasRetrieveAETitle() { - return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value + */ + public IdType getRetrieveAETitleElement() { + if (this.retrieveAETitle == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.retrieveAETitle"); + else if (Configuration.doAutoCreate()) + this.retrieveAETitle = new IdType(); + return this.retrieveAETitle; + } + + public boolean hasRetrieveAETitleElement() { + return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); + } + + public boolean hasRetrieveAETitle() { + return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); + } + + /** * @param value {@link #retrieveAETitle} (The DICOM Application Entity Title where the series can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value - */ - public SeriesComponent setRetrieveAETitleElement(IdType value) { - this.retrieveAETitle = value; - return this; - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value + */ + public SeriesComponent setRetrieveAETitleElement(IdType value) { + this.retrieveAETitle = value; + return this; + } + + /** * @return The DICOM Application Entity Title where the series can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection. - */ - public String getRetrieveAETitle() { - return this.retrieveAETitle == null ? null : this.retrieveAETitle.getValue(); - } - - /** +Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection. + */ + public String getRetrieveAETitle() { + return this.retrieveAETitle == null ? null : this.retrieveAETitle.getValue(); + } + + /** * @param value The DICOM Application Entity Title where the series can be retrieved. -Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection. - */ - public SeriesComponent setRetrieveAETitle(String value) { - if (Utilities.noString(value)) - this.retrieveAETitle = null; - else { - if (this.retrieveAETitle == null) - this.retrieveAETitle = new IdType(); - this.retrieveAETitle.setValue(value); - } - return this; - } - - /** - * @return {@link #retrieveUrl} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value - */ - public UriType getRetrieveUrlElement() { - if (this.retrieveUrl == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.retrieveUrl"); - else if (Configuration.doAutoCreate()) - this.retrieveUrl = new UriType(); - return this.retrieveUrl; - } - - public boolean hasRetrieveUrlElement() { - return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); - } - - public boolean hasRetrieveUrl() { - return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); - } - - /** - * @param value {@link #retrieveUrl} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value - */ - public SeriesComponent setRetrieveUrlElement(UriType value) { - this.retrieveUrl = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - public String getRetrieveUrl() { - return this.retrieveUrl == null ? null : this.retrieveUrl.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - public SeriesComponent setRetrieveUrl(String value) { - if (Utilities.noString(value)) - this.retrieveUrl = null; - else { - if (this.retrieveUrl == null) - this.retrieveUrl = new UriType(); - this.retrieveUrl.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (InstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - // syntactic sugar - public InstanceComponent addInstance() { //3 - InstanceComponent t = new InstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Series instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("retrieveAETitle", "id", "The DICOM Application Entity Title where the series can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveAETitle)); - childrenList.add(new Property("retrieveUrl", "uri", "WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveUrl)); - childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - public SeriesComponent copy() { - SeriesComponent dst = new SeriesComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.retrieveAETitle = retrieveAETitle == null ? null : retrieveAETitle.copy(); - dst.retrieveUrl = retrieveUrl == null ? null : retrieveUrl.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (InstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (retrieveAETitle == null || retrieveAETitle.isEmpty()) - && (retrieveUrl == null || retrieveUrl.isEmpty()) && (instance == null || instance.isEmpty()) - ; - } - - } - - @Block() - public static class InstanceComponent extends BackboneElement { - /** - * SOP class uid of the selected instance. - */ - @Child(name="sopClass", type={OidType.class}, order=1, min=1, max=1) - @Description(shortDefinition="SOP class uid of instance", formalDefinition="SOP class uid of the selected instance." ) - protected OidType sopClass; - - /** - * SOP Instance uid of the selected instance. - */ - @Child(name="uid", type={OidType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Uid of the selected instance", formalDefinition="SOP Instance uid of the selected instance." ) - protected OidType uid; - - /** - * The DICOM Application Entity Title where the DICOM SOP instance can be retrieved. - */ - @Child(name="retrieveAETitle", type={IdType.class}, order=3, min=0, max=1) - @Description(shortDefinition="AE Title where may be retrieved", formalDefinition="The DICOM Application Entity Title where the DICOM SOP instance can be retrieved." ) - protected IdType retrieveAETitle; - - /** - * WADO-RS URL to retrieve the DICOM SOP Instance. - */ - @Child(name="retrieveUrl", type={UriType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the DICOM SOP Instance." ) - protected UriType retrieveUrl; - - private static final long serialVersionUID = 1148429294L; - - public InstanceComponent() { - super(); - } - - public InstanceComponent(OidType sopClass, OidType uid) { - super(); - this.sopClass = sopClass; - this.uid = uid; - } - - /** - * @return {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public OidType getSopClassElement() { - if (this.sopClass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.sopClass"); - else if (Configuration.doAutoCreate()) - this.sopClass = new OidType(); - return this.sopClass; - } - - public boolean hasSopClassElement() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - public boolean hasSopClass() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - /** - * @param value {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public InstanceComponent setSopClassElement(OidType value) { - this.sopClass = value; - return this; - } - - /** - * @return SOP class uid of the selected instance. - */ - public String getSopClass() { - return this.sopClass == null ? null : this.sopClass.getValue(); - } - - /** - * @param value SOP class uid of the selected instance. - */ - public InstanceComponent setSopClass(String value) { - if (this.sopClass == null) - this.sopClass = new OidType(); - this.sopClass.setValue(value); - return this; - } - - /** - * @return {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public InstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return SOP Instance uid of the selected instance. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value SOP Instance uid of the selected instance. - */ - public InstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #retrieveAETitle} (The DICOM Application Entity Title where the DICOM SOP instance can be retrieved.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value - */ - public IdType getRetrieveAETitleElement() { - if (this.retrieveAETitle == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.retrieveAETitle"); - else if (Configuration.doAutoCreate()) - this.retrieveAETitle = new IdType(); - return this.retrieveAETitle; - } - - public boolean hasRetrieveAETitleElement() { - return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); - } - - public boolean hasRetrieveAETitle() { - return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); - } - - /** - * @param value {@link #retrieveAETitle} (The DICOM Application Entity Title where the DICOM SOP instance can be retrieved.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value - */ - public InstanceComponent setRetrieveAETitleElement(IdType value) { - this.retrieveAETitle = value; - return this; - } - - /** - * @return The DICOM Application Entity Title where the DICOM SOP instance can be retrieved. - */ - public String getRetrieveAETitle() { - return this.retrieveAETitle == null ? null : this.retrieveAETitle.getValue(); - } - - /** - * @param value The DICOM Application Entity Title where the DICOM SOP instance can be retrieved. - */ - public InstanceComponent setRetrieveAETitle(String value) { - if (Utilities.noString(value)) - this.retrieveAETitle = null; - else { - if (this.retrieveAETitle == null) - this.retrieveAETitle = new IdType(); - this.retrieveAETitle.setValue(value); - } - return this; - } - - /** - * @return {@link #retrieveUrl} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value - */ - public UriType getRetrieveUrlElement() { - if (this.retrieveUrl == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.retrieveUrl"); - else if (Configuration.doAutoCreate()) - this.retrieveUrl = new UriType(); - return this.retrieveUrl; - } - - public boolean hasRetrieveUrlElement() { - return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); - } - - public boolean hasRetrieveUrl() { - return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); - } - - /** - * @param value {@link #retrieveUrl} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value - */ - public InstanceComponent setRetrieveUrlElement(UriType value) { - this.retrieveUrl = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the DICOM SOP Instance. - */ - public String getRetrieveUrl() { - return this.retrieveUrl == null ? null : this.retrieveUrl.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the DICOM SOP Instance. - */ - public InstanceComponent setRetrieveUrl(String value) { - if (Utilities.noString(value)) - this.retrieveUrl = null; - else { - if (this.retrieveUrl == null) - this.retrieveUrl = new UriType(); - this.retrieveUrl.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sopClass", "oid", "SOP class uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); - childrenList.add(new Property("uid", "oid", "SOP Instance uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("retrieveAETitle", "id", "The DICOM Application Entity Title where the DICOM SOP instance can be retrieved.", 0, java.lang.Integer.MAX_VALUE, retrieveAETitle)); - childrenList.add(new Property("retrieveUrl", "uri", "WADO-RS URL to retrieve the DICOM SOP Instance.", 0, java.lang.Integer.MAX_VALUE, retrieveUrl)); - } - - public InstanceComponent copy() { - InstanceComponent dst = new InstanceComponent(); - copyValues(dst); - dst.sopClass = sopClass == null ? null : sopClass.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.retrieveAETitle = retrieveAETitle == null ? null : retrieveAETitle.copy(); - dst.retrieveUrl = retrieveUrl == null ? null : retrieveUrl.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) - && (retrieveAETitle == null || retrieveAETitle.isEmpty()) && (retrieveUrl == null || retrieveUrl.isEmpty()) - ; - } - - } - - /** - * Instance UID of the DICOM KOS SOP Instances represenetd in this resource. - */ - @Child(name="uid", type={OidType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Instance UID", formalDefinition="Instance UID of the DICOM KOS SOP Instances represenetd in this resource." ) - protected OidType uid; - - /** - * A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection. - */ - @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - protected Patient patientTarget; - - /** - * The reason for, or significance of, the selection of objects referenced in the resource. - */ - @Child(name="title", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) - protected CodeableConcept title; - - /** - * Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - @Child(name="description", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) - protected StringType description; - - /** - * Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. - */ - @Child(name="author", type={Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1) - @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - protected Resource authorTarget; - - /** - * 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. - */ - @Child(name="authoringTime", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Authoring time of the selection", formalDefinition="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." ) - protected DateTimeType authoringTime; - - /** - * Study identity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name="study", type={}, order=5, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) - protected List study; - - private static final long serialVersionUID = -1961832713L; - - public ImagingObjectSelection() { - super(); - } - - public ImagingObjectSelection(OidType uid, Reference patient, CodeableConcept title) { - super(); - this.uid = uid; - this.patient = patient; - this.title = title; - } - - /** - * @return {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingObjectSelection setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Instance UID of the DICOM KOS SOP Instances represenetd in this resource. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Instance UID of the DICOM KOS SOP Instances represenetd in this resource. - */ - public ImagingObjectSelection setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.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} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public ImagingObjectSelection 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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) - */ - public ImagingObjectSelection setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public CodeableConcept getTitle() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.title"); - else if (Configuration.doAutoCreate()) - this.title = new CodeableConcept(); - return this.title; - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public ImagingObjectSelection setTitle(CodeableConcept value) { - this.title = value; - return this; - } - - /** - * @return {@link #description} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). 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 ImagingObjectSelection.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} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingObjectSelection setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public ImagingObjectSelection setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingObjectSelection setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingObjectSelection setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #authoringTime} (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.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public DateTimeType getAuthoringTimeElement() { - if (this.authoringTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.authoringTime"); - else if (Configuration.doAutoCreate()) - this.authoringTime = new DateTimeType(); - return this.authoringTime; - } - - public boolean hasAuthoringTimeElement() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - public boolean hasAuthoringTime() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - /** - * @param value {@link #authoringTime} (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.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public ImagingObjectSelection setAuthoringTimeElement(DateTimeType value) { - this.authoringTime = value; - return this; - } - - /** - * @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 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(Date value) { - if (value == null) - this.authoringTime = null; - else { - if (this.authoringTime == null) - this.authoringTime = new DateTimeType(); - this.authoringTime.setValue(value); - } - return this; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - public List getStudy() { - if (this.study == null) - this.study = new ArrayList(); - return this.study; - } - - public boolean hasStudy() { - if (this.study == null) - return false; - for (StudyComponent item : this.study) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public StudyComponent addStudy() { //3 - StudyComponent t = new StudyComponent(); - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Instance UID of the DICOM KOS SOP Instances represenetd in this resource.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("authoringTime", "dateTime", "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.", 0, java.lang.Integer.MAX_VALUE, authoringTime)); - childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); - } - - public ImagingObjectSelection copy() { - ImagingObjectSelection dst = new ImagingObjectSelection(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.title = title == null ? null : title.copy(); - dst.description = description == null ? null : description.copy(); - dst.author = author == null ? null : author.copy(); - dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); - if (study != null) { - dst.study = new ArrayList(); - for (StudyComponent i : study) - dst.study.add(i.copy()); - }; - return dst; - } - - protected ImagingObjectSelection typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) - && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (author == null || author.isEmpty()) - && (authoringTime == null || authoringTime.isEmpty()) && (study == null || study.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingObjectSelection; - } - - @SearchParamDefinition(name="selected-study", path="ImagingObjectSelection.study.uid", description="Study selected in key DICOM object selection", type="token" ) - public static final String SP_SELECTEDSTUDY = "selected-study"; - @SearchParamDefinition(name="author", path="ImagingObjectSelection.author", description="Author of key DICOM object selection", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="title", path="ImagingObjectSelection.title", description="Title of key DICOM object selection", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="patient", path="ImagingObjectSelection.patient", description="Subject of key DICOM object selection", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="authoring-time", path="ImagingObjectSelection.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) - public static final String SP_AUTHORINGTIME = "authoring-time"; - @SearchParamDefinition(name="identifier", path="ImagingObjectSelection.uid", description="UID of key DICOM object selection", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +Note that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection. + */ + public SeriesComponent setRetrieveAETitle(String value) { + if (Utilities.noString(value)) + this.retrieveAETitle = null; + else { + if (this.retrieveAETitle == null) + this.retrieveAETitle = new IdType(); + this.retrieveAETitle.setValue(value); + } + return this; + } + + /** + * @return {@link #retrieveUrl} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value + */ + public UriType getRetrieveUrlElement() { + if (this.retrieveUrl == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SeriesComponent.retrieveUrl"); + else if (Configuration.doAutoCreate()) + this.retrieveUrl = new UriType(); + return this.retrieveUrl; + } + + public boolean hasRetrieveUrlElement() { + return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); + } + + public boolean hasRetrieveUrl() { + return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); + } + + /** + * @param value {@link #retrieveUrl} (WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value + */ + public SeriesComponent setRetrieveUrlElement(UriType value) { + this.retrieveUrl = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + public String getRetrieveUrl() { + return this.retrieveUrl == null ? null : this.retrieveUrl.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + */ + public SeriesComponent setRetrieveUrl(String value) { + if (Utilities.noString(value)) + this.retrieveUrl = null; + else { + if (this.retrieveUrl == null) + this.retrieveUrl = new UriType(); + this.retrieveUrl.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (InstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) + */ + // syntactic sugar + public InstanceComponent addInstance() { //3 + InstanceComponent t = new InstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Series instance uid of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("retrieveAETitle", "id", "The DICOM Application Entity Title where the series can be retrieved.\nNote that this AE Title is provided to retrieve all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveAETitle)); + childrenList.add(new Property("retrieveUrl", "uri", "WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, retrieveUrl)); + childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + public SeriesComponent copy() { + SeriesComponent dst = new SeriesComponent(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.retrieveAETitle = retrieveAETitle == null ? null : retrieveAETitle.copy(); + dst.retrieveUrl = retrieveUrl == null ? null : retrieveUrl.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (InstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (retrieveAETitle == null || retrieveAETitle.isEmpty()) + && (retrieveUrl == null || retrieveUrl.isEmpty()) && (instance == null || instance.isEmpty()) + ; + } + + } + + @Block() + public static class InstanceComponent extends BackboneElement { + /** + * SOP class uid of the selected instance. + */ + @Child(name="sopClass", type={OidType.class}, order=1, min=1, max=1) + @Description(shortDefinition="SOP class uid of instance", formalDefinition="SOP class uid of the selected instance." ) + protected OidType sopClass; + + /** + * SOP Instance uid of the selected instance. + */ + @Child(name="uid", type={OidType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Uid of the selected instance", formalDefinition="SOP Instance uid of the selected instance." ) + protected OidType uid; + + /** + * The DICOM Application Entity Title where the DICOM SOP instance can be retrieved. + */ + @Child(name="retrieveAETitle", type={IdType.class}, order=3, min=0, max=1) + @Description(shortDefinition="AE Title where may be retrieved", formalDefinition="The DICOM Application Entity Title where the DICOM SOP instance can be retrieved." ) + protected IdType retrieveAETitle; + + /** + * WADO-RS URL to retrieve the DICOM SOP Instance. + */ + @Child(name="retrieveUrl", type={UriType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Retrieve URL", formalDefinition="WADO-RS URL to retrieve the DICOM SOP Instance." ) + protected UriType retrieveUrl; + + private static final long serialVersionUID = 1148429294L; + + public InstanceComponent() { + super(); + } + + public InstanceComponent(OidType sopClass, OidType uid) { + super(); + this.sopClass = sopClass; + this.uid = uid; + } + + /** + * @return {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public OidType getSopClassElement() { + if (this.sopClass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.sopClass"); + else if (Configuration.doAutoCreate()) + this.sopClass = new OidType(); + return this.sopClass; + } + + public boolean hasSopClassElement() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + public boolean hasSopClass() { + return this.sopClass != null && !this.sopClass.isEmpty(); + } + + /** + * @param value {@link #sopClass} (SOP class uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value + */ + public InstanceComponent setSopClassElement(OidType value) { + this.sopClass = value; + return this; + } + + /** + * @return SOP class uid of the selected instance. + */ + public String getSopClass() { + return this.sopClass == null ? null : this.sopClass.getValue(); + } + + /** + * @param value SOP class uid of the selected instance. + */ + public InstanceComponent setSopClass(String value) { + if (this.sopClass == null) + this.sopClass = new OidType(); + this.sopClass.setValue(value); + return this; + } + + /** + * @return {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (SOP Instance uid of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public InstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return SOP Instance uid of the selected instance. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value SOP Instance uid of the selected instance. + */ + public InstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #retrieveAETitle} (The DICOM Application Entity Title where the DICOM SOP instance can be retrieved.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value + */ + public IdType getRetrieveAETitleElement() { + if (this.retrieveAETitle == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.retrieveAETitle"); + else if (Configuration.doAutoCreate()) + this.retrieveAETitle = new IdType(); + return this.retrieveAETitle; + } + + public boolean hasRetrieveAETitleElement() { + return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); + } + + public boolean hasRetrieveAETitle() { + return this.retrieveAETitle != null && !this.retrieveAETitle.isEmpty(); + } + + /** + * @param value {@link #retrieveAETitle} (The DICOM Application Entity Title where the DICOM SOP instance can be retrieved.). This is the underlying object with id, value and extensions. The accessor "getRetrieveAETitle" gives direct access to the value + */ + public InstanceComponent setRetrieveAETitleElement(IdType value) { + this.retrieveAETitle = value; + return this; + } + + /** + * @return The DICOM Application Entity Title where the DICOM SOP instance can be retrieved. + */ + public String getRetrieveAETitle() { + return this.retrieveAETitle == null ? null : this.retrieveAETitle.getValue(); + } + + /** + * @param value The DICOM Application Entity Title where the DICOM SOP instance can be retrieved. + */ + public InstanceComponent setRetrieveAETitle(String value) { + if (Utilities.noString(value)) + this.retrieveAETitle = null; + else { + if (this.retrieveAETitle == null) + this.retrieveAETitle = new IdType(); + this.retrieveAETitle.setValue(value); + } + return this; + } + + /** + * @return {@link #retrieveUrl} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value + */ + public UriType getRetrieveUrlElement() { + if (this.retrieveUrl == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstanceComponent.retrieveUrl"); + else if (Configuration.doAutoCreate()) + this.retrieveUrl = new UriType(); + return this.retrieveUrl; + } + + public boolean hasRetrieveUrlElement() { + return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); + } + + public boolean hasRetrieveUrl() { + return this.retrieveUrl != null && !this.retrieveUrl.isEmpty(); + } + + /** + * @param value {@link #retrieveUrl} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getRetrieveUrl" gives direct access to the value + */ + public InstanceComponent setRetrieveUrlElement(UriType value) { + this.retrieveUrl = value; + return this; + } + + /** + * @return WADO-RS URL to retrieve the DICOM SOP Instance. + */ + public String getRetrieveUrl() { + return this.retrieveUrl == null ? null : this.retrieveUrl.getValue(); + } + + /** + * @param value WADO-RS URL to retrieve the DICOM SOP Instance. + */ + public InstanceComponent setRetrieveUrl(String value) { + if (Utilities.noString(value)) + this.retrieveUrl = null; + else { + if (this.retrieveUrl == null) + this.retrieveUrl = new UriType(); + this.retrieveUrl.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sopClass", "oid", "SOP class uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); + childrenList.add(new Property("uid", "oid", "SOP Instance uid of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("retrieveAETitle", "id", "The DICOM Application Entity Title where the DICOM SOP instance can be retrieved.", 0, java.lang.Integer.MAX_VALUE, retrieveAETitle)); + childrenList.add(new Property("retrieveUrl", "uri", "WADO-RS URL to retrieve the DICOM SOP Instance.", 0, java.lang.Integer.MAX_VALUE, retrieveUrl)); + } + + public InstanceComponent copy() { + InstanceComponent dst = new InstanceComponent(); + copyValues(dst); + dst.sopClass = sopClass == null ? null : sopClass.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.retrieveAETitle = retrieveAETitle == null ? null : retrieveAETitle.copy(); + dst.retrieveUrl = retrieveUrl == null ? null : retrieveUrl.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) + && (retrieveAETitle == null || retrieveAETitle.isEmpty()) && (retrieveUrl == null || retrieveUrl.isEmpty()) + ; + } + + } + + /** + * Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + */ + @Child(name="uid", type={OidType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Instance UID", formalDefinition="Instance UID of the DICOM KOS SOP Instances represenetd in this resource." ) + protected OidType uid; + + /** + * A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection. + */ + @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + protected Patient patientTarget; + + /** + * The reason for, or significance of, the selection of objects referenced in the resource. + */ + @Child(name="title", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) + protected CodeableConcept title; + + /** + * Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) + protected StringType description; + + /** + * Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. + */ + @Child(name="author", type={Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1) + @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + protected Resource authorTarget; + + /** + * 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. + */ + @Child(name="authoringTime", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Authoring time of the selection", formalDefinition="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." ) + protected DateTimeType authoringTime; + + /** + * Study identity and locating information of the DICOM SOP instances in the selection. + */ + @Child(name="study", type={}, order=5, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) + protected List study; + + private static final long serialVersionUID = -1961832713L; + + public ImagingObjectSelection() { + super(); + } + + public ImagingObjectSelection(OidType uid, Reference patient, CodeableConcept title) { + super(); + this.uid = uid; + this.patient = patient; + this.title = title; + } + + /** + * @return {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Instance UID of the DICOM KOS SOP Instances represenetd in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingObjectSelection setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + */ + public ImagingObjectSelection setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.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} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public ImagingObjectSelection 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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.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. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.) + */ + public ImagingObjectSelection setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public CodeableConcept getTitle() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.title"); + else if (Configuration.doAutoCreate()) + this.title = new CodeableConcept(); + return this.title; + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) + */ + public ImagingObjectSelection setTitle(CodeableConcept value) { + this.title = value; + return this; + } + + /** + * @return {@link #description} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). 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 ImagingObjectSelection.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} (Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingObjectSelection setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + */ + public ImagingObjectSelection setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingObjectSelection setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) + */ + public ImagingObjectSelection setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #authoringTime} (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.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public DateTimeType getAuthoringTimeElement() { + if (this.authoringTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingObjectSelection.authoringTime"); + else if (Configuration.doAutoCreate()) + this.authoringTime = new DateTimeType(); + return this.authoringTime; + } + + public boolean hasAuthoringTimeElement() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + public boolean hasAuthoringTime() { + return this.authoringTime != null && !this.authoringTime.isEmpty(); + } + + /** + * @param value {@link #authoringTime} (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.). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value + */ + public ImagingObjectSelection setAuthoringTimeElement(DateTimeType value) { + this.authoringTime = value; + return this; + } + + /** + * @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 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(Date value) { + if (value == null) + this.authoringTime = null; + else { + if (this.authoringTime == null) + this.authoringTime = new DateTimeType(); + this.authoringTime.setValue(value); + } + return this; + } + + /** + * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + public List getStudy() { + if (this.study == null) + this.study = new ArrayList(); + return this.study; + } + + public boolean hasStudy() { + if (this.study == null) + return false; + for (StudyComponent item : this.study) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) + */ + // syntactic sugar + public StudyComponent addStudy() { //3 + StudyComponent t = new StudyComponent(); + if (this.study == null) + this.study = new ArrayList(); + this.study.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("uid", "oid", "Instance UID of the DICOM KOS SOP Instances represenetd in this resource.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("authoringTime", "dateTime", "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.", 0, java.lang.Integer.MAX_VALUE, authoringTime)); + childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); + } + + public ImagingObjectSelection copy() { + ImagingObjectSelection dst = new ImagingObjectSelection(); + copyValues(dst); + dst.uid = uid == null ? null : uid.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.title = title == null ? null : title.copy(); + dst.description = description == null ? null : description.copy(); + dst.author = author == null ? null : author.copy(); + dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); + if (study != null) { + dst.study = new ArrayList(); + for (StudyComponent i : study) + dst.study.add(i.copy()); + }; + return dst; + } + + protected ImagingObjectSelection typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) + && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (author == null || author.isEmpty()) + && (authoringTime == null || authoringTime.isEmpty()) && (study == null || study.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingObjectSelection; + } + + @SearchParamDefinition(name="selected-study", path="ImagingObjectSelection.study.uid", description="Study selected in key DICOM object selection", type="token" ) + public static final String SP_SELECTEDSTUDY = "selected-study"; + @SearchParamDefinition(name="author", path="ImagingObjectSelection.author", description="Author of key DICOM object selection", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="title", path="ImagingObjectSelection.title", description="Title of key DICOM object selection", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="patient", path="ImagingObjectSelection.patient", description="Subject of key DICOM object selection", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="authoring-time", path="ImagingObjectSelection.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) + public static final String SP_AUTHORINGTIME = "authoring-time"; + @SearchParamDefinition(name="identifier", path="ImagingObjectSelection.uid", description="UID of key DICOM object selection", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java index c57bdd5fe19..3e28b686691 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java @@ -20,3474 +20,3474 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. - */ -@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") -public class ImagingStudy extends DomainResource { - - public enum ImagingModality implements FhirEnum { - /** - * - */ - AR, - /** - * - */ - BMD, - /** - * - */ - BDUS, - /** - * - */ - EPS, - /** - * - */ - CR, - /** - * - */ - CT, - /** - * - */ - DX, - /** - * - */ - ECG, - /** - * - */ - ES, - /** - * - */ - XC, - /** - * - */ - GM, - /** - * - */ - HD, - /** - * - */ - IO, - /** - * - */ - IVOCT, - /** - * - */ - IVUS, - /** - * - */ - KER, - /** - * - */ - LEN, - /** - * - */ - MR, - /** - * - */ - MG, - /** - * - */ - NM, - /** - * - */ - OAM, - /** - * - */ - OCT, - /** - * - */ - OPM, - /** - * - */ - OP, - /** - * - */ - OPR, - /** - * - */ - OPT, - /** - * - */ - OPV, - /** - * - */ - PX, - /** - * - */ - PT, - /** - * - */ - RF, - /** - * - */ - RG, - /** - * - */ - SM, - /** - * - */ - SRF, - /** - * - */ - US, - /** - * - */ - VA, - /** - * - */ - XA, - /** - * added to help the parsers - */ - NULL; - - 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)) - return AR; - if ("BMD".equals(codeString)) - return BMD; - if ("BDUS".equals(codeString)) - return BDUS; - if ("EPS".equals(codeString)) - return EPS; - if ("CR".equals(codeString)) - return CR; - if ("CT".equals(codeString)) - return CT; - if ("DX".equals(codeString)) - return DX; - if ("ECG".equals(codeString)) - return ECG; - if ("ES".equals(codeString)) - return ES; - if ("XC".equals(codeString)) - return XC; - if ("GM".equals(codeString)) - return GM; - if ("HD".equals(codeString)) - return HD; - if ("IO".equals(codeString)) - return IO; - if ("IVOCT".equals(codeString)) - return IVOCT; - if ("IVUS".equals(codeString)) - return IVUS; - if ("KER".equals(codeString)) - return KER; - if ("LEN".equals(codeString)) - return LEN; - if ("MR".equals(codeString)) - return MR; - if ("MG".equals(codeString)) - return MG; - if ("NM".equals(codeString)) - return NM; - if ("OAM".equals(codeString)) - return OAM; - if ("OCT".equals(codeString)) - return OCT; - if ("OPM".equals(codeString)) - return OPM; - if ("OP".equals(codeString)) - return OP; - if ("OPR".equals(codeString)) - return OPR; - if ("OPT".equals(codeString)) - return OPT; - if ("OPV".equals(codeString)) - return OPV; - if ("PX".equals(codeString)) - return PX; - if ("PT".equals(codeString)) - return PT; - if ("RF".equals(codeString)) - return RF; - if ("RG".equals(codeString)) - return RG; - if ("SM".equals(codeString)) - return SM; - if ("SRF".equals(codeString)) - return SRF; - if ("US".equals(codeString)) - return US; - if ("VA".equals(codeString)) - return VA; - if ("XA".equals(codeString)) - return XA; - throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case AR: return "AR"; - case BMD: return "BMD"; - case BDUS: return "BDUS"; - case EPS: return "EPS"; - case CR: return "CR"; - case CT: return "CT"; - case DX: return "DX"; - case ECG: return "ECG"; - case ES: return "ES"; - case XC: return "XC"; - case GM: return "GM"; - case HD: return "HD"; - case IO: return "IO"; - case IVOCT: return "IVOCT"; - case IVUS: return "IVUS"; - case KER: return "KER"; - case LEN: return "LEN"; - case MR: return "MR"; - case MG: return "MG"; - case NM: return "NM"; - case OAM: return "OAM"; - case OCT: return "OCT"; - case OPM: return "OPM"; - case OP: return "OP"; - case OPR: return "OPR"; - case OPT: return "OPT"; - case OPV: return "OPV"; - case PX: return "PX"; - case PT: return "PT"; - case RF: return "RF"; - case RG: return "RG"; - case SM: return "SM"; - case SRF: return "SRF"; - case US: return "US"; - case VA: return "VA"; - case XA: return "XA"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AR: return "http://nema.org/dicom/dcid"; - case BMD: return "http://nema.org/dicom/dcid"; - case BDUS: return "http://nema.org/dicom/dcid"; - case EPS: return "http://nema.org/dicom/dcid"; - case CR: return "http://nema.org/dicom/dcid"; - case CT: return "http://nema.org/dicom/dcid"; - case DX: return "http://nema.org/dicom/dcid"; - case ECG: return "http://nema.org/dicom/dcid"; - case ES: return "http://nema.org/dicom/dcid"; - case XC: return "http://nema.org/dicom/dcid"; - case GM: return "http://nema.org/dicom/dcid"; - case HD: return "http://nema.org/dicom/dcid"; - case IO: return "http://nema.org/dicom/dcid"; - case IVOCT: return "http://nema.org/dicom/dcid"; - case IVUS: return "http://nema.org/dicom/dcid"; - case KER: return "http://nema.org/dicom/dcid"; - case LEN: return "http://nema.org/dicom/dcid"; - case MR: return "http://nema.org/dicom/dcid"; - case MG: return "http://nema.org/dicom/dcid"; - case NM: return "http://nema.org/dicom/dcid"; - case OAM: return "http://nema.org/dicom/dcid"; - case OCT: return "http://nema.org/dicom/dcid"; - case OPM: return "http://nema.org/dicom/dcid"; - case OP: return "http://nema.org/dicom/dcid"; - case OPR: return "http://nema.org/dicom/dcid"; - case OPT: return "http://nema.org/dicom/dcid"; - case OPV: return "http://nema.org/dicom/dcid"; - case PX: return "http://nema.org/dicom/dcid"; - case PT: return "http://nema.org/dicom/dcid"; - case RF: return "http://nema.org/dicom/dcid"; - case RG: return "http://nema.org/dicom/dcid"; - case SM: return "http://nema.org/dicom/dcid"; - case SRF: return "http://nema.org/dicom/dcid"; - case US: return "http://nema.org/dicom/dcid"; - case VA: return "http://nema.org/dicom/dcid"; - case XA: return "http://nema.org/dicom/dcid"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AR: return ""; - case BMD: return ""; - case BDUS: return ""; - case EPS: return ""; - case CR: return ""; - case CT: return ""; - case DX: return ""; - case ECG: return ""; - case ES: return ""; - case XC: return ""; - case GM: return ""; - case HD: return ""; - case IO: return ""; - case IVOCT: return ""; - case IVUS: return ""; - case KER: return ""; - case LEN: return ""; - case MR: return ""; - case MG: return ""; - case NM: return ""; - case OAM: return ""; - case OCT: return ""; - case OPM: return ""; - case OP: return ""; - case OPR: return ""; - case OPT: return ""; - case OPV: return ""; - case PX: return ""; - case PT: return ""; - case RF: return ""; - case RG: return ""; - case SM: return ""; - case SRF: return ""; - case US: return ""; - case VA: return ""; - case XA: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AR: return "AR"; - case BMD: return "BMD"; - case BDUS: return "BDUS"; - case EPS: return "EPS"; - case CR: return "CR"; - case CT: return "CT"; - case DX: return "DX"; - case ECG: return "ECG"; - case ES: return "ES"; - case XC: return "XC"; - case GM: return "GM"; - case HD: return "HD"; - case IO: return "IO"; - case IVOCT: return "IVOCT"; - case IVUS: return "IVUS"; - case KER: return "KER"; - case LEN: return "LEN"; - case MR: return "MR"; - case MG: return "MG"; - case NM: return "NM"; - case OAM: return "OAM"; - case OCT: return "OCT"; - case OPM: return "OPM"; - case OP: return "OP"; - case OPR: return "OPR"; - case OPT: return "OPT"; - case OPV: return "OPV"; - case PX: return "PX"; - case PT: return "PT"; - case RF: return "RF"; - case RG: return "RG"; - case SM: return "SM"; - case SRF: return "SRF"; - case US: return "US"; - case VA: return "VA"; - case XA: return "XA"; - default: return "?"; - } - } - } - - public static class ImagingModalityEnumFactory implements EnumFactory { - public ImagingModality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("AR".equals(codeString)) - return ImagingModality.AR; - if ("BMD".equals(codeString)) - return ImagingModality.BMD; - if ("BDUS".equals(codeString)) - return ImagingModality.BDUS; - if ("EPS".equals(codeString)) - return ImagingModality.EPS; - if ("CR".equals(codeString)) - return ImagingModality.CR; - if ("CT".equals(codeString)) - return ImagingModality.CT; - if ("DX".equals(codeString)) - return ImagingModality.DX; - if ("ECG".equals(codeString)) - return ImagingModality.ECG; - if ("ES".equals(codeString)) - return ImagingModality.ES; - if ("XC".equals(codeString)) - return ImagingModality.XC; - if ("GM".equals(codeString)) - return ImagingModality.GM; - if ("HD".equals(codeString)) - return ImagingModality.HD; - if ("IO".equals(codeString)) - return ImagingModality.IO; - if ("IVOCT".equals(codeString)) - return ImagingModality.IVOCT; - if ("IVUS".equals(codeString)) - return ImagingModality.IVUS; - if ("KER".equals(codeString)) - return ImagingModality.KER; - if ("LEN".equals(codeString)) - return ImagingModality.LEN; - if ("MR".equals(codeString)) - return ImagingModality.MR; - if ("MG".equals(codeString)) - return ImagingModality.MG; - if ("NM".equals(codeString)) - return ImagingModality.NM; - if ("OAM".equals(codeString)) - return ImagingModality.OAM; - if ("OCT".equals(codeString)) - return ImagingModality.OCT; - if ("OPM".equals(codeString)) - return ImagingModality.OPM; - if ("OP".equals(codeString)) - return ImagingModality.OP; - if ("OPR".equals(codeString)) - return ImagingModality.OPR; - if ("OPT".equals(codeString)) - return ImagingModality.OPT; - if ("OPV".equals(codeString)) - return ImagingModality.OPV; - if ("PX".equals(codeString)) - return ImagingModality.PX; - if ("PT".equals(codeString)) - return ImagingModality.PT; - if ("RF".equals(codeString)) - return ImagingModality.RF; - if ("RG".equals(codeString)) - return ImagingModality.RG; - if ("SM".equals(codeString)) - return ImagingModality.SM; - if ("SRF".equals(codeString)) - return ImagingModality.SRF; - if ("US".equals(codeString)) - return ImagingModality.US; - if ("VA".equals(codeString)) - return ImagingModality.VA; - if ("XA".equals(codeString)) - return ImagingModality.XA; - throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); - } - public String toCode(ImagingModality code) throws IllegalArgumentException { - if (code == ImagingModality.AR) - return "AR"; - if (code == ImagingModality.BMD) - return "BMD"; - if (code == ImagingModality.BDUS) - return "BDUS"; - if (code == ImagingModality.EPS) - return "EPS"; - if (code == ImagingModality.CR) - return "CR"; - if (code == ImagingModality.CT) - return "CT"; - if (code == ImagingModality.DX) - return "DX"; - if (code == ImagingModality.ECG) - return "ECG"; - if (code == ImagingModality.ES) - return "ES"; - if (code == ImagingModality.XC) - return "XC"; - if (code == ImagingModality.GM) - return "GM"; - if (code == ImagingModality.HD) - return "HD"; - if (code == ImagingModality.IO) - return "IO"; - if (code == ImagingModality.IVOCT) - return "IVOCT"; - if (code == ImagingModality.IVUS) - return "IVUS"; - if (code == ImagingModality.KER) - return "KER"; - if (code == ImagingModality.LEN) - return "LEN"; - if (code == ImagingModality.MR) - return "MR"; - if (code == ImagingModality.MG) - return "MG"; - if (code == ImagingModality.NM) - return "NM"; - if (code == ImagingModality.OAM) - return "OAM"; - if (code == ImagingModality.OCT) - return "OCT"; - if (code == ImagingModality.OPM) - return "OPM"; - if (code == ImagingModality.OP) - return "OP"; - if (code == ImagingModality.OPR) - return "OPR"; - if (code == ImagingModality.OPT) - return "OPT"; - if (code == ImagingModality.OPV) - return "OPV"; - if (code == ImagingModality.PX) - return "PX"; - if (code == ImagingModality.PT) - return "PT"; - if (code == ImagingModality.RF) - return "RF"; - if (code == ImagingModality.RG) - return "RG"; - if (code == ImagingModality.SM) - return "SM"; - if (code == ImagingModality.SRF) - return "SRF"; - if (code == ImagingModality.US) - return "US"; - if (code == ImagingModality.VA) - return "VA"; - if (code == ImagingModality.XA) - return "XA"; - return "?"; - } - } - - public enum InstanceAvailability implements FhirEnum { - /** - * Resources are immediately available,. - */ - ONLINE, - /** - * Resources need to be retrieved by manual intervention. - */ - OFFLINE, - /** - * Resources need to be retrieved from relatively slow media. - */ - NEARLINE, - /** - * Resources cannot be retrieved. - */ - UNAVAILABLE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ONLINE; - if ("OFFLINE".equals(codeString)) - return OFFLINE; - if ("NEARLINE".equals(codeString)) - return NEARLINE; - if ("UNAVAILABLE".equals(codeString)) - return UNAVAILABLE; - throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ONLINE: return "ONLINE"; - case OFFLINE: return "OFFLINE"; - case NEARLINE: return "NEARLINE"; - case UNAVAILABLE: return "UNAVAILABLE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ONLINE: return "http://nema.org/dicom/dcid"; - case OFFLINE: return "http://nema.org/dicom/dcid"; - case NEARLINE: return "http://nema.org/dicom/dcid"; - case UNAVAILABLE: return "http://nema.org/dicom/dcid"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ONLINE: return "Resources are immediately available,."; - case OFFLINE: return "Resources need to be retrieved by manual intervention."; - case NEARLINE: return "Resources need to be retrieved from relatively slow media."; - case UNAVAILABLE: return "Resources cannot be retrieved."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ONLINE: return "ONLINE"; - case OFFLINE: return "OFFLINE"; - case NEARLINE: return "NEARLINE"; - case UNAVAILABLE: return "UNAVAILABLE"; - default: return "?"; - } - } - } - - public static class InstanceAvailabilityEnumFactory implements EnumFactory { - public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ONLINE".equals(codeString)) - return InstanceAvailability.ONLINE; - if ("OFFLINE".equals(codeString)) - return InstanceAvailability.OFFLINE; - if ("NEARLINE".equals(codeString)) - return InstanceAvailability.NEARLINE; - if ("UNAVAILABLE".equals(codeString)) - return InstanceAvailability.UNAVAILABLE; - throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); - } - public String toCode(InstanceAvailability code) throws IllegalArgumentException { - if (code == InstanceAvailability.ONLINE) - return "ONLINE"; - if (code == InstanceAvailability.OFFLINE) - return "OFFLINE"; - if (code == InstanceAvailability.NEARLINE) - return "NEARLINE"; - if (code == InstanceAvailability.UNAVAILABLE) - return "UNAVAILABLE"; - return "?"; - } - } - - public enum Modality implements FhirEnum { - /** - * - */ - AR, - /** - * - */ - AU, - /** - * - */ - BDUS, - /** - * - */ - BI, - /** - * - */ - BMD, - /** - * - */ - CR, - /** - * - */ - CT, - /** - * - */ - DG, - /** - * - */ - DX, - /** - * - */ - ECG, - /** - * - */ - EPS, - /** - * - */ - ES, - /** - * - */ - GM, - /** - * - */ - HC, - /** - * - */ - HD, - /** - * - */ - IO, - /** - * - */ - IVOCT, - /** - * - */ - IVUS, - /** - * - */ - KER, - /** - * - */ - KO, - /** - * - */ - LEN, - /** - * - */ - LS, - /** - * - */ - MG, - /** - * - */ - MR, - /** - * - */ - NM, - /** - * - */ - OAM, - /** - * - */ - OCT, - /** - * - */ - OP, - /** - * - */ - OPM, - /** - * - */ - OPT, - /** - * - */ - OPV, - /** - * - */ - OT, - /** - * - */ - PR, - /** - * - */ - PT, - /** - * - */ - PX, - /** - * - */ - REG, - /** - * - */ - RF, - /** - * - */ - RG, - /** - * - */ - RTDOSE, - /** - * - */ - RTIMAGE, - /** - * - */ - RTPLAN, - /** - * - */ - RTRECORD, - /** - * - */ - RTSTRUCT, - /** - * - */ - SEG, - /** - * - */ - SM, - /** - * - */ - SMR, - /** - * - */ - SR, - /** - * - */ - SRF, - /** - * - */ - TG, - /** - * - */ - US, - /** - * - */ - VA, - /** - * - */ - XA, - /** - * - */ - XC, - /** - * added to help the parsers - */ - NULL; - - 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)) - return AR; - if ("AU".equals(codeString)) - return AU; - if ("BDUS".equals(codeString)) - return BDUS; - if ("BI".equals(codeString)) - return BI; - if ("BMD".equals(codeString)) - return BMD; - if ("CR".equals(codeString)) - return CR; - if ("CT".equals(codeString)) - return CT; - if ("DG".equals(codeString)) - return DG; - if ("DX".equals(codeString)) - return DX; - if ("ECG".equals(codeString)) - return ECG; - if ("EPS".equals(codeString)) - return EPS; - if ("ES".equals(codeString)) - return ES; - if ("GM".equals(codeString)) - return GM; - if ("HC".equals(codeString)) - return HC; - if ("HD".equals(codeString)) - return HD; - if ("IO".equals(codeString)) - return IO; - if ("IVOCT".equals(codeString)) - return IVOCT; - if ("IVUS".equals(codeString)) - return IVUS; - if ("KER".equals(codeString)) - return KER; - if ("KO".equals(codeString)) - return KO; - if ("LEN".equals(codeString)) - return LEN; - if ("LS".equals(codeString)) - return LS; - if ("MG".equals(codeString)) - return MG; - if ("MR".equals(codeString)) - return MR; - if ("NM".equals(codeString)) - return NM; - if ("OAM".equals(codeString)) - return OAM; - if ("OCT".equals(codeString)) - return OCT; - if ("OP".equals(codeString)) - return OP; - if ("OPM".equals(codeString)) - return OPM; - if ("OPT".equals(codeString)) - return OPT; - if ("OPV".equals(codeString)) - return OPV; - if ("OT".equals(codeString)) - return OT; - if ("PR".equals(codeString)) - return PR; - if ("PT".equals(codeString)) - return PT; - if ("PX".equals(codeString)) - return PX; - if ("REG".equals(codeString)) - return REG; - if ("RF".equals(codeString)) - return RF; - if ("RG".equals(codeString)) - return RG; - if ("RTDOSE".equals(codeString)) - return RTDOSE; - if ("RTIMAGE".equals(codeString)) - return RTIMAGE; - if ("RTPLAN".equals(codeString)) - return RTPLAN; - if ("RTRECORD".equals(codeString)) - return RTRECORD; - if ("RTSTRUCT".equals(codeString)) - return RTSTRUCT; - if ("SEG".equals(codeString)) - return SEG; - if ("SM".equals(codeString)) - return SM; - if ("SMR".equals(codeString)) - return SMR; - if ("SR".equals(codeString)) - return SR; - if ("SRF".equals(codeString)) - return SRF; - if ("TG".equals(codeString)) - return TG; - if ("US".equals(codeString)) - return US; - if ("VA".equals(codeString)) - return VA; - if ("XA".equals(codeString)) - return XA; - if ("XC".equals(codeString)) - return XC; - throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case AR: return "AR"; - case AU: return "AU"; - case BDUS: return "BDUS"; - case BI: return "BI"; - case BMD: return "BMD"; - case CR: return "CR"; - case CT: return "CT"; - case DG: return "DG"; - case DX: return "DX"; - case ECG: return "ECG"; - case EPS: return "EPS"; - case ES: return "ES"; - case GM: return "GM"; - case HC: return "HC"; - case HD: return "HD"; - case IO: return "IO"; - case IVOCT: return "IVOCT"; - case IVUS: return "IVUS"; - case KER: return "KER"; - case KO: return "KO"; - case LEN: return "LEN"; - case LS: return "LS"; - case MG: return "MG"; - case MR: return "MR"; - case NM: return "NM"; - case OAM: return "OAM"; - case OCT: return "OCT"; - case OP: return "OP"; - case OPM: return "OPM"; - case OPT: return "OPT"; - case OPV: return "OPV"; - case OT: return "OT"; - case PR: return "PR"; - case PT: return "PT"; - case PX: return "PX"; - case REG: return "REG"; - case RF: return "RF"; - case RG: return "RG"; - case RTDOSE: return "RTDOSE"; - case RTIMAGE: return "RTIMAGE"; - case RTPLAN: return "RTPLAN"; - case RTRECORD: return "RTRECORD"; - case RTSTRUCT: return "RTSTRUCT"; - case SEG: return "SEG"; - case SM: return "SM"; - case SMR: return "SMR"; - case SR: return "SR"; - case SRF: return "SRF"; - case TG: return "TG"; - case US: return "US"; - case VA: return "VA"; - case XA: return "XA"; - case XC: return "XC"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AR: return "http://nema.org/dicom/dcid"; - case AU: return "http://nema.org/dicom/dcid"; - case BDUS: return "http://nema.org/dicom/dcid"; - case BI: return "http://nema.org/dicom/dcid"; - case BMD: return "http://nema.org/dicom/dcid"; - case CR: return "http://nema.org/dicom/dcid"; - case CT: return "http://nema.org/dicom/dcid"; - case DG: return "http://nema.org/dicom/dcid"; - case DX: return "http://nema.org/dicom/dcid"; - case ECG: return "http://nema.org/dicom/dcid"; - case EPS: return "http://nema.org/dicom/dcid"; - case ES: return "http://nema.org/dicom/dcid"; - case GM: return "http://nema.org/dicom/dcid"; - case HC: return "http://nema.org/dicom/dcid"; - case HD: return "http://nema.org/dicom/dcid"; - case IO: return "http://nema.org/dicom/dcid"; - case IVOCT: return "http://nema.org/dicom/dcid"; - case IVUS: return "http://nema.org/dicom/dcid"; - case KER: return "http://nema.org/dicom/dcid"; - case KO: return "http://nema.org/dicom/dcid"; - case LEN: return "http://nema.org/dicom/dcid"; - case LS: return "http://nema.org/dicom/dcid"; - case MG: return "http://nema.org/dicom/dcid"; - case MR: return "http://nema.org/dicom/dcid"; - case NM: return "http://nema.org/dicom/dcid"; - case OAM: return "http://nema.org/dicom/dcid"; - case OCT: return "http://nema.org/dicom/dcid"; - case OP: return "http://nema.org/dicom/dcid"; - case OPM: return "http://nema.org/dicom/dcid"; - case OPT: return "http://nema.org/dicom/dcid"; - case OPV: return "http://nema.org/dicom/dcid"; - case OT: return "http://nema.org/dicom/dcid"; - case PR: return "http://nema.org/dicom/dcid"; - case PT: return "http://nema.org/dicom/dcid"; - case PX: return "http://nema.org/dicom/dcid"; - case REG: return "http://nema.org/dicom/dcid"; - case RF: return "http://nema.org/dicom/dcid"; - case RG: return "http://nema.org/dicom/dcid"; - case RTDOSE: return "http://nema.org/dicom/dcid"; - case RTIMAGE: return "http://nema.org/dicom/dcid"; - case RTPLAN: return "http://nema.org/dicom/dcid"; - case RTRECORD: return "http://nema.org/dicom/dcid"; - case RTSTRUCT: return "http://nema.org/dicom/dcid"; - case SEG: return "http://nema.org/dicom/dcid"; - case SM: return "http://nema.org/dicom/dcid"; - case SMR: return "http://nema.org/dicom/dcid"; - case SR: return "http://nema.org/dicom/dcid"; - case SRF: return "http://nema.org/dicom/dcid"; - case TG: return "http://nema.org/dicom/dcid"; - case US: return "http://nema.org/dicom/dcid"; - case VA: return "http://nema.org/dicom/dcid"; - case XA: return "http://nema.org/dicom/dcid"; - case XC: return "http://nema.org/dicom/dcid"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AR: return ""; - case AU: return ""; - case BDUS: return ""; - case BI: return ""; - case BMD: return ""; - case CR: return ""; - case CT: return ""; - case DG: return ""; - case DX: return ""; - case ECG: return ""; - case EPS: return ""; - case ES: return ""; - case GM: return ""; - case HC: return ""; - case HD: return ""; - case IO: return ""; - case IVOCT: return ""; - case IVUS: return ""; - case KER: return ""; - case KO: return ""; - case LEN: return ""; - case LS: return ""; - case MG: return ""; - case MR: return ""; - case NM: return ""; - case OAM: return ""; - case OCT: return ""; - case OP: return ""; - case OPM: return ""; - case OPT: return ""; - case OPV: return ""; - case OT: return ""; - case PR: return ""; - case PT: return ""; - case PX: return ""; - case REG: return ""; - case RF: return ""; - case RG: return ""; - case RTDOSE: return ""; - case RTIMAGE: return ""; - case RTPLAN: return ""; - case RTRECORD: return ""; - case RTSTRUCT: return ""; - case SEG: return ""; - case SM: return ""; - case SMR: return ""; - case SR: return ""; - case SRF: return ""; - case TG: return ""; - case US: return ""; - case VA: return ""; - case XA: return ""; - case XC: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AR: return "AR"; - case AU: return "AU"; - case BDUS: return "BDUS"; - case BI: return "BI"; - case BMD: return "BMD"; - case CR: return "CR"; - case CT: return "CT"; - case DG: return "DG"; - case DX: return "DX"; - case ECG: return "ECG"; - case EPS: return "EPS"; - case ES: return "ES"; - case GM: return "GM"; - case HC: return "HC"; - case HD: return "HD"; - case IO: return "IO"; - case IVOCT: return "IVOCT"; - case IVUS: return "IVUS"; - case KER: return "KER"; - case KO: return "KO"; - case LEN: return "LEN"; - case LS: return "LS"; - case MG: return "MG"; - case MR: return "MR"; - case NM: return "NM"; - case OAM: return "OAM"; - case OCT: return "OCT"; - case OP: return "OP"; - case OPM: return "OPM"; - case OPT: return "OPT"; - case OPV: return "OPV"; - case OT: return "OT"; - case PR: return "PR"; - case PT: return "PT"; - case PX: return "PX"; - case REG: return "REG"; - case RF: return "RF"; - case RG: return "RG"; - case RTDOSE: return "RTDOSE"; - case RTIMAGE: return "RTIMAGE"; - case RTPLAN: return "RTPLAN"; - case RTRECORD: return "RTRECORD"; - case RTSTRUCT: return "RTSTRUCT"; - case SEG: return "SEG"; - case SM: return "SM"; - case SMR: return "SMR"; - case SR: return "SR"; - case SRF: return "SRF"; - case TG: return "TG"; - case US: return "US"; - case VA: return "VA"; - case XA: return "XA"; - case XC: return "XC"; - default: return "?"; - } - } - } - - public static class ModalityEnumFactory implements EnumFactory { - public Modality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("AR".equals(codeString)) - return Modality.AR; - if ("AU".equals(codeString)) - return Modality.AU; - if ("BDUS".equals(codeString)) - return Modality.BDUS; - if ("BI".equals(codeString)) - return Modality.BI; - if ("BMD".equals(codeString)) - return Modality.BMD; - if ("CR".equals(codeString)) - return Modality.CR; - if ("CT".equals(codeString)) - return Modality.CT; - if ("DG".equals(codeString)) - return Modality.DG; - if ("DX".equals(codeString)) - return Modality.DX; - if ("ECG".equals(codeString)) - return Modality.ECG; - if ("EPS".equals(codeString)) - return Modality.EPS; - if ("ES".equals(codeString)) - return Modality.ES; - if ("GM".equals(codeString)) - return Modality.GM; - if ("HC".equals(codeString)) - return Modality.HC; - if ("HD".equals(codeString)) - return Modality.HD; - if ("IO".equals(codeString)) - return Modality.IO; - if ("IVOCT".equals(codeString)) - return Modality.IVOCT; - if ("IVUS".equals(codeString)) - return Modality.IVUS; - if ("KER".equals(codeString)) - return Modality.KER; - if ("KO".equals(codeString)) - return Modality.KO; - if ("LEN".equals(codeString)) - return Modality.LEN; - if ("LS".equals(codeString)) - return Modality.LS; - if ("MG".equals(codeString)) - return Modality.MG; - if ("MR".equals(codeString)) - return Modality.MR; - if ("NM".equals(codeString)) - return Modality.NM; - if ("OAM".equals(codeString)) - return Modality.OAM; - if ("OCT".equals(codeString)) - return Modality.OCT; - if ("OP".equals(codeString)) - return Modality.OP; - if ("OPM".equals(codeString)) - return Modality.OPM; - if ("OPT".equals(codeString)) - return Modality.OPT; - if ("OPV".equals(codeString)) - return Modality.OPV; - if ("OT".equals(codeString)) - return Modality.OT; - if ("PR".equals(codeString)) - return Modality.PR; - if ("PT".equals(codeString)) - return Modality.PT; - if ("PX".equals(codeString)) - return Modality.PX; - if ("REG".equals(codeString)) - return Modality.REG; - if ("RF".equals(codeString)) - return Modality.RF; - if ("RG".equals(codeString)) - return Modality.RG; - if ("RTDOSE".equals(codeString)) - return Modality.RTDOSE; - if ("RTIMAGE".equals(codeString)) - return Modality.RTIMAGE; - if ("RTPLAN".equals(codeString)) - return Modality.RTPLAN; - if ("RTRECORD".equals(codeString)) - return Modality.RTRECORD; - if ("RTSTRUCT".equals(codeString)) - return Modality.RTSTRUCT; - if ("SEG".equals(codeString)) - return Modality.SEG; - if ("SM".equals(codeString)) - return Modality.SM; - if ("SMR".equals(codeString)) - return Modality.SMR; - if ("SR".equals(codeString)) - return Modality.SR; - if ("SRF".equals(codeString)) - return Modality.SRF; - if ("TG".equals(codeString)) - return Modality.TG; - if ("US".equals(codeString)) - return Modality.US; - if ("VA".equals(codeString)) - return Modality.VA; - if ("XA".equals(codeString)) - return Modality.XA; - if ("XC".equals(codeString)) - return Modality.XC; - throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); - } - public String toCode(Modality code) throws IllegalArgumentException { - if (code == Modality.AR) - return "AR"; - if (code == Modality.AU) - return "AU"; - if (code == Modality.BDUS) - return "BDUS"; - if (code == Modality.BI) - return "BI"; - if (code == Modality.BMD) - return "BMD"; - if (code == Modality.CR) - return "CR"; - if (code == Modality.CT) - return "CT"; - if (code == Modality.DG) - return "DG"; - if (code == Modality.DX) - return "DX"; - if (code == Modality.ECG) - return "ECG"; - if (code == Modality.EPS) - return "EPS"; - if (code == Modality.ES) - return "ES"; - if (code == Modality.GM) - return "GM"; - if (code == Modality.HC) - return "HC"; - if (code == Modality.HD) - return "HD"; - if (code == Modality.IO) - return "IO"; - if (code == Modality.IVOCT) - return "IVOCT"; - if (code == Modality.IVUS) - return "IVUS"; - if (code == Modality.KER) - return "KER"; - if (code == Modality.KO) - return "KO"; - if (code == Modality.LEN) - return "LEN"; - if (code == Modality.LS) - return "LS"; - if (code == Modality.MG) - return "MG"; - if (code == Modality.MR) - return "MR"; - if (code == Modality.NM) - return "NM"; - if (code == Modality.OAM) - return "OAM"; - if (code == Modality.OCT) - return "OCT"; - if (code == Modality.OP) - return "OP"; - if (code == Modality.OPM) - return "OPM"; - if (code == Modality.OPT) - return "OPT"; - if (code == Modality.OPV) - return "OPV"; - if (code == Modality.OT) - return "OT"; - if (code == Modality.PR) - return "PR"; - if (code == Modality.PT) - return "PT"; - if (code == Modality.PX) - return "PX"; - if (code == Modality.REG) - return "REG"; - if (code == Modality.RF) - return "RF"; - if (code == Modality.RG) - return "RG"; - if (code == Modality.RTDOSE) - return "RTDOSE"; - if (code == Modality.RTIMAGE) - return "RTIMAGE"; - if (code == Modality.RTPLAN) - return "RTPLAN"; - if (code == Modality.RTRECORD) - return "RTRECORD"; - if (code == Modality.RTSTRUCT) - return "RTSTRUCT"; - if (code == Modality.SEG) - return "SEG"; - if (code == Modality.SM) - return "SM"; - if (code == Modality.SMR) - return "SMR"; - if (code == Modality.SR) - return "SR"; - if (code == Modality.SRF) - return "SRF"; - if (code == Modality.TG) - return "TG"; - if (code == Modality.US) - return "US"; - if (code == Modality.VA) - return "VA"; - if (code == Modality.XA) - return "XA"; - if (code == Modality.XC) - return "XC"; - return "?"; - } - } - - @Block() - public static class ImagingStudySeriesComponent extends BackboneElement { - /** - * The Numeric identifier of this series in the study. - */ - @Child(name="number", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Numeric identifier of this series (0020,0011)", formalDefinition="The Numeric identifier of this series in the study." ) - protected IntegerType number; - - /** - * The modality of this series sequence. - */ - @Child(name="modality", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The modality of the instances in the series (0008,0060)", formalDefinition="The modality of this series sequence." ) - protected Enumeration modality; - - /** - * Formal identifier for this series. - */ - @Child(name="uid", type={OidType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Formal identifier for this series (0020,000E)", formalDefinition="Formal identifier for this series." ) - protected OidType uid; - - /** - * A description of the series. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="A description of the series (0008,103E)", formalDefinition="A description of the series." ) - protected StringType description; - - /** - * Sequence that contains attributes from the. - */ - @Child(name="numberOfInstances", type={IntegerType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Number of Series Related Instances (0020,1209)", formalDefinition="Sequence that contains attributes from the." ) - protected IntegerType numberOfInstances; - - /** - * Availability of series (online, offline or nearline). - */ - @Child(name="availability", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of series (online, offline or nearline)." ) - protected Enumeration availability; - - /** - * WADO-RS URI where Series is available. - */ - @Child(name="url", type={UriType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Retrieve URI (0008,1115 > 0008,1190)", formalDefinition="WADO-RS URI where Series is available." ) - protected UriType url; - - /** - * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed. - */ - @Child(name="bodySite", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Body part examined (Map from 0018,0015)", formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed." ) - protected Coding bodySite; - - /** - * The date when the series was started. - */ - @Child(name="dateTime", type={DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="When the series started", formalDefinition="The date when the series was started." ) - protected DateTimeType dateTime; - - /** - * A single image taken from a patient. - */ - @Child(name="instance", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A single instance taken from a patient (image or other)", formalDefinition="A single image taken from a patient." ) - protected List instance; - - private static final long serialVersionUID = -1442035574L; - - public ImagingStudySeriesComponent() { - super(); - } - - public ImagingStudySeriesComponent(Enumeration modality, OidType uid, IntegerType numberOfInstances) { - super(); - this.modality = modality; - this.uid = uid; - this.numberOfInstances = numberOfInstances; - } - - /** - * @return {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public IntegerType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new IntegerType(); - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public ImagingStudySeriesComponent setNumberElement(IntegerType value) { - this.number = value; - return this; - } - - /** - * @return The Numeric identifier of this series in the study. - */ - public int getNumber() { - return this.number == null ? null : this.number.getValue(); - } - - /** - * @param value The Numeric identifier of this series in the study. - */ - public ImagingStudySeriesComponent setNumber(int value) { - if (value == -1) - this.number = null; - else { - if (this.number == null) - this.number = new IntegerType(); - this.number.setValue(value); - } - return this; - } - - /** - * @return {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value - */ - public Enumeration getModalityElement() { - if (this.modality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality"); - else if (Configuration.doAutoCreate()) - this.modality = new Enumeration(); - return this.modality; - } - - public boolean hasModalityElement() { - return this.modality != null && !this.modality.isEmpty(); - } - - public boolean hasModality() { - return this.modality != null && !this.modality.isEmpty(); - } - - /** - * @param value {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value - */ - public ImagingStudySeriesComponent setModalityElement(Enumeration value) { - this.modality = value; - return this; - } - - /** - * @return The modality of this series sequence. - */ - public Modality getModality() { - return this.modality == null ? null : this.modality.getValue(); - } - - /** - * @param value The modality of this series sequence. - */ - public ImagingStudySeriesComponent setModality(Modality value) { - if (this.modality == null) - this.modality = new Enumeration(Modality.ENUM_FACTORY); - this.modality.setValue(value); - return this; - } - - /** - * @return {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudySeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for this series. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for this series. - */ - public ImagingStudySeriesComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of the series.). 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 ImagingStudySeriesComponent.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} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingStudySeriesComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the series. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the series. - */ - public ImagingStudySeriesComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #numberOfInstances} (Sequence that contains attributes from the.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public IntegerType getNumberOfInstancesElement() { - if (this.numberOfInstances == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances"); - else if (Configuration.doAutoCreate()) - this.numberOfInstances = new IntegerType(); - return this.numberOfInstances; - } - - public boolean hasNumberOfInstancesElement() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - public boolean hasNumberOfInstances() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - /** - * @param value {@link #numberOfInstances} (Sequence that contains attributes from the.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public ImagingStudySeriesComponent setNumberOfInstancesElement(IntegerType value) { - this.numberOfInstances = value; - return this; - } - - /** - * @return Sequence that contains attributes from the. - */ - public int getNumberOfInstances() { - return this.numberOfInstances == null ? null : this.numberOfInstances.getValue(); - } - - /** - * @param value Sequence that contains attributes from the. - */ - public ImagingStudySeriesComponent setNumberOfInstances(int value) { - if (this.numberOfInstances == null) - this.numberOfInstances = new IntegerType(); - this.numberOfInstances.setValue(value); - return this; - } - - /** - * @return {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public Enumeration getAvailabilityElement() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Enumeration(); - return this.availability; - } - - public boolean hasAvailabilityElement() { - return this.availability != null && !this.availability.isEmpty(); - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public ImagingStudySeriesComponent setAvailabilityElement(Enumeration value) { - this.availability = value; - return this; - } - - /** - * @return Availability of series (online, offline or nearline). - */ - public InstanceAvailability getAvailability() { - return this.availability == null ? null : this.availability.getValue(); - } - - /** - * @param value Availability of series (online, offline or nearline). - */ - public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { - if (value == null) - this.availability = null; - else { - if (this.availability == null) - this.availability = new Enumeration(InstanceAvailability.ENUM_FACTORY); - this.availability.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (WADO-RS URI where Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URI where Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudySeriesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URI where Series is available. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URI where Series is available. - */ - public ImagingStudySeriesComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) - */ - public ImagingStudySeriesComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #dateTime} (The date when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public ImagingStudySeriesComponent setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date when the series was started. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date when the series was started. - */ - public ImagingStudySeriesComponent setDateTime(Date value) { - if (value == null) - this.dateTime = null; - else { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (A single image taken from a patient.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (ImagingStudySeriesInstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (A single image taken from a patient.) - */ - // syntactic sugar - public ImagingStudySeriesInstanceComponent addInstance() { //3 - ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "integer", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("modality", "code", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality)); - childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("numberOfInstances", "integer", "Sequence that contains attributes from the.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); - childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("url", "uri", "WADO-RS URI where Series is available.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("bodySite", "Coding", "Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("dateTime", "dateTime", "The date when the series was started.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("instance", "", "A single image taken from a patient.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - public ImagingStudySeriesComponent copy() { - ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.modality = modality == null ? null : modality.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.description = description == null ? null : description.copy(); - dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); - dst.availability = availability == null ? null : availability.copy(); - dst.url = url == null ? null : url.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (ImagingStudySeriesInstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (modality == null || modality.isEmpty()) - && (uid == null || uid.isEmpty()) && (description == null || description.isEmpty()) && (numberOfInstances == null || numberOfInstances.isEmpty()) - && (availability == null || availability.isEmpty()) && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty()) - && (dateTime == null || dateTime.isEmpty()) && (instance == null || instance.isEmpty()); - } - - } - - @Block() - public static class ImagingStudySeriesInstanceComponent extends BackboneElement { - /** - * The number of this image in the series. - */ - @Child(name="number", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="The number of this instance in the series (0020,0013)", formalDefinition="The number of this image in the series." ) - protected IntegerType number; - - /** - * Formal identifier for this image. - */ - @Child(name="uid", type={OidType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Formal identifier for this instance (0008,0018)", formalDefinition="Formal identifier for this image." ) - protected OidType uid; - - /** - * DICOM Image type. - */ - @Child(name="sopclass", type={OidType.class}, order=3, min=1, max=1) - @Description(shortDefinition="DICOM class type (0008,0016)", formalDefinition="DICOM Image type." ) - protected OidType sopclass; - - /** - * The type of the instance. - */ - @Child(name="type", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Type of instance (image etc) (0004,1430)", formalDefinition="The type of the instance." ) - protected StringType type; - - /** - * The description of the instance. - */ - @Child(name="title", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)", formalDefinition="The description of the instance." ) - protected StringType title; - - /** - * WADO-RS url where image is available. - */ - @Child(name="url", type={UriType.class}, order=6, min=0, max=1) - @Description(shortDefinition="WADO-RS service where instance is available (0008,1199 > 0008,1190)", formalDefinition="WADO-RS url where image is available." ) - protected UriType url; - - /** - * A FHIR resource with content for this instance. - */ - @Child(name="attachment", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Content for this instance", formalDefinition="A FHIR resource with content for this instance." ) - protected Reference attachment; - - /** - * The actual object that is the target of the reference (A FHIR resource with content for this instance.) - */ - protected Resource attachmentTarget; - - private static final long serialVersionUID = -2008450480L; - - public ImagingStudySeriesInstanceComponent() { - super(); - } - - public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopclass) { - super(); - this.uid = uid; - this.sopclass = sopclass; - } - - /** - * @return {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public IntegerType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new IntegerType(); - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setNumberElement(IntegerType value) { - this.number = value; - return this; - } - - /** - * @return The number of this image in the series. - */ - public int getNumber() { - return this.number == null ? null : this.number.getValue(); - } - - /** - * @param value The number of this image in the series. - */ - public ImagingStudySeriesInstanceComponent setNumber(int value) { - if (value == -1) - this.number = null; - else { - if (this.number == null) - this.number = new IntegerType(); - this.number.setValue(value); - } - return this; - } - - /** - * @return {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for this image. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for this image. - */ - public ImagingStudySeriesInstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value - */ - public OidType getSopclassElement() { - if (this.sopclass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopclass"); - else if (Configuration.doAutoCreate()) - this.sopclass = new OidType(); - return this.sopclass; - } - - public boolean hasSopclassElement() { - return this.sopclass != null && !this.sopclass.isEmpty(); - } - - public boolean hasSopclass() { - return this.sopclass != null && !this.sopclass.isEmpty(); - } - - /** - * @param value {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setSopclassElement(OidType value) { - this.sopclass = value; - return this; - } - - /** - * @return DICOM Image type. - */ - public String getSopclass() { - return this.sopclass == null ? null : this.sopclass.getValue(); - } - - /** - * @param value DICOM Image type. - */ - public ImagingStudySeriesInstanceComponent setSopclass(String value) { - if (this.sopclass == null) - this.sopclass = new OidType(); - this.sopclass.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of the instance.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); - 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 of the instance.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return The type of the instance. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the instance. - */ - public ImagingStudySeriesInstanceComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The description of the instance. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The description of the instance. - */ - public ImagingStudySeriesInstanceComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (WADO-RS url where image is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS url where image is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS url where image is available. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS url where image is available. - */ - public ImagingStudySeriesInstanceComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #attachment} (A FHIR resource with content for this instance.) - */ - public Reference getAttachment() { - if (this.attachment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.attachment"); - else if (Configuration.doAutoCreate()) - this.attachment = new Reference(); - return this.attachment; - } - - public boolean hasAttachment() { - return this.attachment != null && !this.attachment.isEmpty(); - } - - /** - * @param value {@link #attachment} (A FHIR resource with content for this instance.) - */ - public ImagingStudySeriesInstanceComponent setAttachment(Reference value) { - this.attachment = value; - return this; - } - - /** - * @return {@link #attachment} 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 FHIR resource with content for this instance.) - */ - public Resource getAttachmentTarget() { - return this.attachmentTarget; - } - - /** - * @param value {@link #attachment} 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 FHIR resource with content for this instance.) - */ - public ImagingStudySeriesInstanceComponent setAttachmentTarget(Resource value) { - this.attachmentTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "integer", "The number of this image in the series.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("uid", "oid", "Formal identifier for this image.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("sopclass", "oid", "DICOM Image type.", 0, java.lang.Integer.MAX_VALUE, sopclass)); - childrenList.add(new Property("type", "string", "The type of the instance.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("url", "uri", "WADO-RS url where image is available.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("attachment", "Reference(Any)", "A FHIR resource with content for this instance.", 0, java.lang.Integer.MAX_VALUE, attachment)); - } - - public ImagingStudySeriesInstanceComponent copy() { - ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.sopclass = sopclass == null ? null : sopclass.copy(); - dst.type = type == null ? null : type.copy(); - dst.title = title == null ? null : title.copy(); - dst.url = url == null ? null : url.copy(); - dst.attachment = attachment == null ? null : attachment.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (uid == null || uid.isEmpty()) - && (sopclass == null || sopclass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty()) - && (url == null || url.isEmpty()) && (attachment == null || attachment.isEmpty()); - } - - } - - /** - * Date and Time the study started. - */ - @Child(name="started", type={DateTimeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="When the study was started (0008,0020)+(0008,0030)", formalDefinition="Date and Time the study started." ) - protected DateTimeType started; - - /** - * The patient for whom the images are of. - */ - @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Who the images are of", formalDefinition="The patient for whom the images are of." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient for whom the images are of.) - */ - protected Patient patientTarget; - - /** - * Formal identifier for the study. - */ - @Child(name="uid", type={OidType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Formal identifier for the study (0020,000D)", formalDefinition="Formal identifier for the study." ) - protected OidType uid; - - /** - * Accession Number. - */ - @Child(name="accession", type={Identifier.class}, order=2, min=0, max=1) - @Description(shortDefinition="Accession Number (0008,0050)", formalDefinition="Accession Number." ) - protected Identifier accession; - - /** - * Other identifiers for the study. - */ - @Child(name="identifier", type={Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the study (0020,0010)", formalDefinition="Other identifiers for the study." ) - protected List identifier; - - /** - * A list of the diagnostic orders that resulted in this imaging study being performed. - */ - @Child(name="order", type={DiagnosticOrder.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Order(s) that caused this study to be performed", formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed." ) - protected List order; - /** - * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - protected List orderTarget; - - - /** - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). - */ - @Child(name="modalityList", type={CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="All series.modality if actual acquisition modalities", formalDefinition="A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19)." ) - protected List> modalityList; - - /** - * The requesting/referring physician. - */ - @Child(name="referrer", type={Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." ) - protected Reference referrer; - - /** - * The actual object that is the target of the reference (The requesting/referring physician.) - */ - protected Practitioner referrerTarget; - - /** - * Availability of study (online, offline or nearline). - */ - @Child(name="availability", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." ) - protected Enumeration availability; - - /** - * WADO-RS URI where Study is available. - */ - @Child(name="url", type={UriType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Retrieve URI (0008,1190)", formalDefinition="WADO-RS URI where Study is available." ) - protected UriType url; - - /** - * Number of Series in Study. - */ - @Child(name="numberOfSeries", type={IntegerType.class}, order=9, min=1, max=1) - @Description(shortDefinition="Number of Study Related Series (0020,1206)", formalDefinition="Number of Series in Study." ) - protected IntegerType numberOfSeries; - - /** - * Number of SOP Instances in Study. - */ - @Child(name="numberOfInstances", type={IntegerType.class}, order=10, min=1, max=1) - @Description(shortDefinition="Number of Study Related Instances (0020,1208)", formalDefinition="Number of SOP Instances in Study." ) - protected IntegerType numberOfInstances; - - /** - * Diagnoses etc provided with request. - */ - @Child(name="clinicalInformation", type={StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Diagnoses etc with request (0040,1002)", formalDefinition="Diagnoses etc provided with request." ) - protected StringType clinicalInformation; - - /** - * Type of procedure performed. - */ - @Child(name="procedure", type={Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Type of procedure performed (0008,1032)", formalDefinition="Type of procedure performed." ) - protected List procedure; - - /** - * Who read study and interpreted the images. - */ - @Child(name="interpreter", type={Practitioner.class}, order=13, min=0, max=1) - @Description(shortDefinition="Who interpreted images (0008,1060)", formalDefinition="Who read study and interpreted the images." ) - protected Reference interpreter; - - /** - * The actual object that is the target of the reference (Who read study and interpreted the images.) - */ - protected Practitioner interpreterTarget; - - /** - * Institution-generated description or classification of the Study (component) performed. - */ - @Child(name="description", type={StringType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Institution-generated description (0008,1030)", formalDefinition="Institution-generated description or classification of the Study (component) performed." ) - protected StringType description; - - /** - * Each study has one or more series of image instances. - */ - @Child(name="series", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of image instances." ) - protected List series; - - private static final long serialVersionUID = 712301092L; - - public ImagingStudy() { - super(); - } - - public ImagingStudy(Reference patient, OidType uid, IntegerType numberOfSeries, IntegerType numberOfInstances) { - super(); - this.patient = patient; - this.uid = uid; - this.numberOfSeries = numberOfSeries; - this.numberOfInstances = numberOfInstances; - } - - /** - * @return {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public DateTimeType getStartedElement() { - if (this.started == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.started"); - else if (Configuration.doAutoCreate()) - this.started = new DateTimeType(); - return this.started; - } - - public boolean hasStartedElement() { - return this.started != null && !this.started.isEmpty(); - } - - public boolean hasStarted() { - return this.started != null && !this.started.isEmpty(); - } - - /** - * @param value {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public ImagingStudy setStartedElement(DateTimeType value) { - this.started = value; - return this; - } - - /** - * @return Date and Time the study started. - */ - public Date getStarted() { - return this.started == null ? null : this.started.getValue(); - } - - /** - * @param value Date and Time the study started. - */ - public ImagingStudy setStarted(Date value) { - if (value == null) - this.started = null; - else { - if (this.started == null) - this.started = new DateTimeType(); - this.started.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (The patient for whom the images are of.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.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} (The patient for whom the images are of.) - */ - public ImagingStudy 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. (The patient for whom the images are of.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.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. (The patient for whom the images are of.) - */ - public ImagingStudy setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudy setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for the study. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for the study. - */ - public ImagingStudy setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #accession} (Accession Number.) - */ - public Identifier getAccession() { - if (this.accession == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.accession"); - else if (Configuration.doAutoCreate()) - this.accession = new Identifier(); - return this.accession; - } - - public boolean hasAccession() { - return this.accession != null && !this.accession.isEmpty(); - } - - /** - * @param value {@link #accession} (Accession Number.) - */ - public ImagingStudy setAccession(Identifier value) { - this.accession = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers for the study.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Other identifiers for the study.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public List getOrder() { - if (this.order == null) - this.order = new ArrayList(); - return this.order; - } - - public boolean hasOrder() { - if (this.order == null) - return false; - for (Reference item : this.order) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - // syntactic sugar - public Reference addOrder() { //3 - Reference t = new Reference(); - if (this.order == null) - this.order = new ArrayList(); - this.order.add(t); - return t; - } - - /** - * @return {@link #order} (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. A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public List getOrderTarget() { - if (this.orderTarget == null) - this.orderTarget = new ArrayList(); - return this.orderTarget; - } - - // syntactic sugar - /** - * @return {@link #order} (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. A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public DiagnosticOrder addOrderTarget() { - DiagnosticOrder r = new DiagnosticOrder(); - if (this.orderTarget == null) - this.orderTarget = new ArrayList(); - this.orderTarget.add(r); - return r; - } - - /** - * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - public List> getModalityList() { - if (this.modalityList == null) - this.modalityList = new ArrayList>(); - return this.modalityList; - } - - public boolean hasModalityList() { - if (this.modalityList == null) - return false; - for (Enumeration item : this.modalityList) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - // syntactic sugar - public Enumeration addModalityListElement() {//2 - Enumeration t = new Enumeration(); - if (this.modalityList == null) - this.modalityList = new ArrayList>(); - this.modalityList.add(t); - return t; - } - - /** - * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - public ImagingStudy addModalityList(ImagingModality value) { //1 - Enumeration t = new Enumeration(); - t.setValue(value); - if (this.modalityList == null) - this.modalityList = new ArrayList>(); - this.modalityList.add(t); - return this; - } - - /** - * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) - */ - public boolean hasModalityList(ImagingModality value) { - if (this.modalityList == null) - return false; - for (Enumeration v : this.modalityList) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #referrer} (The requesting/referring physician.) - */ - public Reference getReferrer() { - if (this.referrer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.referrer"); - else if (Configuration.doAutoCreate()) - this.referrer = new Reference(); - return this.referrer; - } - - public boolean hasReferrer() { - return this.referrer != null && !this.referrer.isEmpty(); - } - - /** - * @param value {@link #referrer} (The requesting/referring physician.) - */ - public ImagingStudy setReferrer(Reference value) { - this.referrer = value; - return this; - } - - /** - * @return {@link #referrer} 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 requesting/referring physician.) - */ - public Practitioner getReferrerTarget() { - if (this.referrerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.referrer"); - else if (Configuration.doAutoCreate()) - this.referrerTarget = new Practitioner(); - return this.referrerTarget; - } - - /** - * @param value {@link #referrer} 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 requesting/referring physician.) - */ - public ImagingStudy setReferrerTarget(Practitioner value) { - this.referrerTarget = value; - return this; - } - - /** - * @return {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public Enumeration getAvailabilityElement() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Enumeration(); - return this.availability; - } - - public boolean hasAvailabilityElement() { - return this.availability != null && !this.availability.isEmpty(); - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public ImagingStudy setAvailabilityElement(Enumeration value) { - this.availability = value; - return this; - } - - /** - * @return Availability of study (online, offline or nearline). - */ - public InstanceAvailability getAvailability() { - return this.availability == null ? null : this.availability.getValue(); - } - - /** - * @param value Availability of study (online, offline or nearline). - */ - public ImagingStudy setAvailability(InstanceAvailability value) { - if (value == null) - this.availability = null; - else { - if (this.availability == null) - this.availability = new Enumeration(InstanceAvailability.ENUM_FACTORY); - this.availability.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (WADO-RS URI where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URI where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudy setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URI where Study is available. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URI where Study is available. - */ - public ImagingStudy setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value - */ - public IntegerType getNumberOfSeriesElement() { - if (this.numberOfSeries == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries"); - else if (Configuration.doAutoCreate()) - this.numberOfSeries = new IntegerType(); - return this.numberOfSeries; - } - - public boolean hasNumberOfSeriesElement() { - return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); - } - - public boolean hasNumberOfSeries() { - return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); - } - - /** - * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value - */ - public ImagingStudy setNumberOfSeriesElement(IntegerType value) { - this.numberOfSeries = value; - return this; - } - - /** - * @return Number of Series in Study. - */ - public int getNumberOfSeries() { - return this.numberOfSeries == null ? null : this.numberOfSeries.getValue(); - } - - /** - * @param value Number of Series in Study. - */ - public ImagingStudy setNumberOfSeries(int value) { - if (this.numberOfSeries == null) - this.numberOfSeries = new IntegerType(); - this.numberOfSeries.setValue(value); - return this; - } - - /** - * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public IntegerType getNumberOfInstancesElement() { - if (this.numberOfInstances == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances"); - else if (Configuration.doAutoCreate()) - this.numberOfInstances = new IntegerType(); - return this.numberOfInstances; - } - - public boolean hasNumberOfInstancesElement() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - public boolean hasNumberOfInstances() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - /** - * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public ImagingStudy setNumberOfInstancesElement(IntegerType value) { - this.numberOfInstances = value; - return this; - } - - /** - * @return Number of SOP Instances in Study. - */ - public int getNumberOfInstances() { - return this.numberOfInstances == null ? null : this.numberOfInstances.getValue(); - } - - /** - * @param value Number of SOP Instances in Study. - */ - public ImagingStudy setNumberOfInstances(int value) { - if (this.numberOfInstances == null) - this.numberOfInstances = new IntegerType(); - this.numberOfInstances.setValue(value); - return this; - } - - /** - * @return {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value - */ - public StringType getClinicalInformationElement() { - if (this.clinicalInformation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.clinicalInformation"); - else if (Configuration.doAutoCreate()) - this.clinicalInformation = new StringType(); - return this.clinicalInformation; - } - - public boolean hasClinicalInformationElement() { - return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); - } - - public boolean hasClinicalInformation() { - return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); - } - - /** - * @param value {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value - */ - public ImagingStudy setClinicalInformationElement(StringType value) { - this.clinicalInformation = value; - return this; - } - - /** - * @return Diagnoses etc provided with request. - */ - public String getClinicalInformation() { - return this.clinicalInformation == null ? null : this.clinicalInformation.getValue(); - } - - /** - * @param value Diagnoses etc provided with request. - */ - public ImagingStudy setClinicalInformation(String value) { - if (Utilities.noString(value)) - this.clinicalInformation = null; - else { - if (this.clinicalInformation == null) - this.clinicalInformation = new StringType(); - this.clinicalInformation.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (Type of procedure performed.) - */ - public List getProcedure() { - if (this.procedure == null) - this.procedure = new ArrayList(); - return this.procedure; - } - - public boolean hasProcedure() { - if (this.procedure == null) - return false; - for (Coding item : this.procedure) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #procedure} (Type of procedure performed.) - */ - // syntactic sugar - public Coding addProcedure() { //3 - Coding t = new Coding(); - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return t; - } - - /** - * @return {@link #interpreter} (Who read study and interpreted the images.) - */ - public Reference getInterpreter() { - if (this.interpreter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.interpreter"); - else if (Configuration.doAutoCreate()) - this.interpreter = new Reference(); - return this.interpreter; - } - - public boolean hasInterpreter() { - return this.interpreter != null && !this.interpreter.isEmpty(); - } - - /** - * @param value {@link #interpreter} (Who read study and interpreted the images.) - */ - public ImagingStudy setInterpreter(Reference value) { - this.interpreter = value; - return this; - } - - /** - * @return {@link #interpreter} 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. (Who read study and interpreted the images.) - */ - public Practitioner getInterpreterTarget() { - if (this.interpreterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.interpreter"); - else if (Configuration.doAutoCreate()) - this.interpreterTarget = new Practitioner(); - return this.interpreterTarget; - } - - /** - * @param value {@link #interpreter} 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. (Who read study and interpreted the images.) - */ - public ImagingStudy setInterpreterTarget(Practitioner value) { - this.interpreterTarget = value; - return this; - } - - /** - * @return {@link #description} (Institution-generated description or classification of the Study (component) performed.). 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 ImagingStudy.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} (Institution-generated description or classification of the Study (component) performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingStudy setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Institution-generated description or classification of the Study (component) performed. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Institution-generated description or classification of the Study (component) performed. - */ - public ImagingStudy setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #series} (Each study has one or more series of image instances.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (ImagingStudySeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Each study has one or more series of image instances.) - */ - // syntactic sugar - public ImagingStudySeriesComponent addSeries() { //3 - ImagingStudySeriesComponent t = new ImagingStudySeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("started", "dateTime", "Date and Time the study started.", 0, java.lang.Integer.MAX_VALUE, started)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient for whom the images are of.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("accession", "Identifier", "Accession Number.", 0, java.lang.Integer.MAX_VALUE, accession)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order)); - childrenList.add(new Property("modalityList", "code", "A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).", 0, java.lang.Integer.MAX_VALUE, modalityList)); - childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer)); - childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("url", "uri", "WADO-RS URI where Study is available.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("numberOfSeries", "integer", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries)); - childrenList.add(new Property("numberOfInstances", "integer", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); - childrenList.add(new Property("clinicalInformation", "string", "Diagnoses etc provided with request.", 0, java.lang.Integer.MAX_VALUE, clinicalInformation)); - childrenList.add(new Property("procedure", "Coding", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read study and interpreted the images.", 0, java.lang.Integer.MAX_VALUE, interpreter)); - childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study (component) performed.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("series", "", "Each study has one or more series of image instances.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - public ImagingStudy copy() { - ImagingStudy dst = new ImagingStudy(); - copyValues(dst); - dst.started = started == null ? null : started.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.accession = accession == null ? null : accession.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (order != null) { - dst.order = new ArrayList(); - for (Reference i : order) - dst.order.add(i.copy()); - }; - if (modalityList != null) { - dst.modalityList = new ArrayList>(); - for (Enumeration i : modalityList) - dst.modalityList.add(i.copy()); - }; - dst.referrer = referrer == null ? null : referrer.copy(); - dst.availability = availability == null ? null : availability.copy(); - dst.url = url == null ? null : url.copy(); - dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy(); - dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); - dst.clinicalInformation = clinicalInformation == null ? null : clinicalInformation.copy(); - if (procedure != null) { - dst.procedure = new ArrayList(); - for (Coding i : procedure) - dst.procedure.add(i.copy()); - }; - dst.interpreter = interpreter == null ? null : interpreter.copy(); - dst.description = description == null ? null : description.copy(); - if (series != null) { - dst.series = new ArrayList(); - for (ImagingStudySeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - protected ImagingStudy typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (started == null || started.isEmpty()) && (patient == null || patient.isEmpty()) - && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (order == null || order.isEmpty()) && (modalityList == null || modalityList.isEmpty()) - && (referrer == null || referrer.isEmpty()) && (availability == null || availability.isEmpty()) - && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty()) - && (numberOfInstances == null || numberOfInstances.isEmpty()) && (clinicalInformation == null || clinicalInformation.isEmpty()) - && (procedure == null || procedure.isEmpty()) && (interpreter == null || interpreter.isEmpty()) - && (description == null || description.isEmpty()) && (series == null || series.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingStudy; - } - - @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="Formal identifier for this instance (0008,0018)", type="token" ) - public static final String SP_UID = "uid"; - @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The series id for the image", type="token" ) - public static final String SP_SERIES = "series"; - @SearchParamDefinition(name="patient", path="ImagingStudy.patient", description="Who the study is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="Body part examined (Map from 0018,0015)", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession id for the image", type="token" ) - public static final String SP_ACCESSION = "accession"; - @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study id for the image", type="token" ) - public static final String SP_STUDY = "study"; - @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the image", type="token" ) - public static final String SP_MODALITY = "modality"; - @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" ) - public static final String SP_STARTED = "started"; - @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopclass", description="DICOM class type (0008,0016)", type="token" ) - public static final String SP_DICOMCLASS = "dicom-class"; - @SearchParamDefinition(name="size", path="", description="The size of the image in MB - may include > or < in the value", type="number" ) - public static final String SP_SIZE = "size"; - -} - + +/* + 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; +/** + * Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. + */ +@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") +public class ImagingStudy extends DomainResource { + + public enum ImagingModality implements FhirEnum { + /** + * + */ + AR, + /** + * + */ + BMD, + /** + * + */ + BDUS, + /** + * + */ + EPS, + /** + * + */ + CR, + /** + * + */ + CT, + /** + * + */ + DX, + /** + * + */ + ECG, + /** + * + */ + ES, + /** + * + */ + XC, + /** + * + */ + GM, + /** + * + */ + HD, + /** + * + */ + IO, + /** + * + */ + IVOCT, + /** + * + */ + IVUS, + /** + * + */ + KER, + /** + * + */ + LEN, + /** + * + */ + MR, + /** + * + */ + MG, + /** + * + */ + NM, + /** + * + */ + OAM, + /** + * + */ + OCT, + /** + * + */ + OPM, + /** + * + */ + OP, + /** + * + */ + OPR, + /** + * + */ + OPT, + /** + * + */ + OPV, + /** + * + */ + PX, + /** + * + */ + PT, + /** + * + */ + RF, + /** + * + */ + RG, + /** + * + */ + SM, + /** + * + */ + SRF, + /** + * + */ + US, + /** + * + */ + VA, + /** + * + */ + XA, + /** + * added to help the parsers + */ + NULL; + + 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)) + return AR; + if ("BMD".equals(codeString)) + return BMD; + if ("BDUS".equals(codeString)) + return BDUS; + if ("EPS".equals(codeString)) + return EPS; + if ("CR".equals(codeString)) + return CR; + if ("CT".equals(codeString)) + return CT; + if ("DX".equals(codeString)) + return DX; + if ("ECG".equals(codeString)) + return ECG; + if ("ES".equals(codeString)) + return ES; + if ("XC".equals(codeString)) + return XC; + if ("GM".equals(codeString)) + return GM; + if ("HD".equals(codeString)) + return HD; + if ("IO".equals(codeString)) + return IO; + if ("IVOCT".equals(codeString)) + return IVOCT; + if ("IVUS".equals(codeString)) + return IVUS; + if ("KER".equals(codeString)) + return KER; + if ("LEN".equals(codeString)) + return LEN; + if ("MR".equals(codeString)) + return MR; + if ("MG".equals(codeString)) + return MG; + if ("NM".equals(codeString)) + return NM; + if ("OAM".equals(codeString)) + return OAM; + if ("OCT".equals(codeString)) + return OCT; + if ("OPM".equals(codeString)) + return OPM; + if ("OP".equals(codeString)) + return OP; + if ("OPR".equals(codeString)) + return OPR; + if ("OPT".equals(codeString)) + return OPT; + if ("OPV".equals(codeString)) + return OPV; + if ("PX".equals(codeString)) + return PX; + if ("PT".equals(codeString)) + return PT; + if ("RF".equals(codeString)) + return RF; + if ("RG".equals(codeString)) + return RG; + if ("SM".equals(codeString)) + return SM; + if ("SRF".equals(codeString)) + return SRF; + if ("US".equals(codeString)) + return US; + if ("VA".equals(codeString)) + return VA; + if ("XA".equals(codeString)) + return XA; + throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case AR: return "AR"; + case BMD: return "BMD"; + case BDUS: return "BDUS"; + case EPS: return "EPS"; + case CR: return "CR"; + case CT: return "CT"; + case DX: return "DX"; + case ECG: return "ECG"; + case ES: return "ES"; + case XC: return "XC"; + case GM: return "GM"; + case HD: return "HD"; + case IO: return "IO"; + case IVOCT: return "IVOCT"; + case IVUS: return "IVUS"; + case KER: return "KER"; + case LEN: return "LEN"; + case MR: return "MR"; + case MG: return "MG"; + case NM: return "NM"; + case OAM: return "OAM"; + case OCT: return "OCT"; + case OPM: return "OPM"; + case OP: return "OP"; + case OPR: return "OPR"; + case OPT: return "OPT"; + case OPV: return "OPV"; + case PX: return "PX"; + case PT: return "PT"; + case RF: return "RF"; + case RG: return "RG"; + case SM: return "SM"; + case SRF: return "SRF"; + case US: return "US"; + case VA: return "VA"; + case XA: return "XA"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AR: return "http://nema.org/dicom/dcid"; + case BMD: return "http://nema.org/dicom/dcid"; + case BDUS: return "http://nema.org/dicom/dcid"; + case EPS: return "http://nema.org/dicom/dcid"; + case CR: return "http://nema.org/dicom/dcid"; + case CT: return "http://nema.org/dicom/dcid"; + case DX: return "http://nema.org/dicom/dcid"; + case ECG: return "http://nema.org/dicom/dcid"; + case ES: return "http://nema.org/dicom/dcid"; + case XC: return "http://nema.org/dicom/dcid"; + case GM: return "http://nema.org/dicom/dcid"; + case HD: return "http://nema.org/dicom/dcid"; + case IO: return "http://nema.org/dicom/dcid"; + case IVOCT: return "http://nema.org/dicom/dcid"; + case IVUS: return "http://nema.org/dicom/dcid"; + case KER: return "http://nema.org/dicom/dcid"; + case LEN: return "http://nema.org/dicom/dcid"; + case MR: return "http://nema.org/dicom/dcid"; + case MG: return "http://nema.org/dicom/dcid"; + case NM: return "http://nema.org/dicom/dcid"; + case OAM: return "http://nema.org/dicom/dcid"; + case OCT: return "http://nema.org/dicom/dcid"; + case OPM: return "http://nema.org/dicom/dcid"; + case OP: return "http://nema.org/dicom/dcid"; + case OPR: return "http://nema.org/dicom/dcid"; + case OPT: return "http://nema.org/dicom/dcid"; + case OPV: return "http://nema.org/dicom/dcid"; + case PX: return "http://nema.org/dicom/dcid"; + case PT: return "http://nema.org/dicom/dcid"; + case RF: return "http://nema.org/dicom/dcid"; + case RG: return "http://nema.org/dicom/dcid"; + case SM: return "http://nema.org/dicom/dcid"; + case SRF: return "http://nema.org/dicom/dcid"; + case US: return "http://nema.org/dicom/dcid"; + case VA: return "http://nema.org/dicom/dcid"; + case XA: return "http://nema.org/dicom/dcid"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AR: return ""; + case BMD: return ""; + case BDUS: return ""; + case EPS: return ""; + case CR: return ""; + case CT: return ""; + case DX: return ""; + case ECG: return ""; + case ES: return ""; + case XC: return ""; + case GM: return ""; + case HD: return ""; + case IO: return ""; + case IVOCT: return ""; + case IVUS: return ""; + case KER: return ""; + case LEN: return ""; + case MR: return ""; + case MG: return ""; + case NM: return ""; + case OAM: return ""; + case OCT: return ""; + case OPM: return ""; + case OP: return ""; + case OPR: return ""; + case OPT: return ""; + case OPV: return ""; + case PX: return ""; + case PT: return ""; + case RF: return ""; + case RG: return ""; + case SM: return ""; + case SRF: return ""; + case US: return ""; + case VA: return ""; + case XA: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AR: return "AR"; + case BMD: return "BMD"; + case BDUS: return "BDUS"; + case EPS: return "EPS"; + case CR: return "CR"; + case CT: return "CT"; + case DX: return "DX"; + case ECG: return "ECG"; + case ES: return "ES"; + case XC: return "XC"; + case GM: return "GM"; + case HD: return "HD"; + case IO: return "IO"; + case IVOCT: return "IVOCT"; + case IVUS: return "IVUS"; + case KER: return "KER"; + case LEN: return "LEN"; + case MR: return "MR"; + case MG: return "MG"; + case NM: return "NM"; + case OAM: return "OAM"; + case OCT: return "OCT"; + case OPM: return "OPM"; + case OP: return "OP"; + case OPR: return "OPR"; + case OPT: return "OPT"; + case OPV: return "OPV"; + case PX: return "PX"; + case PT: return "PT"; + case RF: return "RF"; + case RG: return "RG"; + case SM: return "SM"; + case SRF: return "SRF"; + case US: return "US"; + case VA: return "VA"; + case XA: return "XA"; + default: return "?"; + } + } + } + + public static class ImagingModalityEnumFactory implements EnumFactory { + public ImagingModality fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("AR".equals(codeString)) + return ImagingModality.AR; + if ("BMD".equals(codeString)) + return ImagingModality.BMD; + if ("BDUS".equals(codeString)) + return ImagingModality.BDUS; + if ("EPS".equals(codeString)) + return ImagingModality.EPS; + if ("CR".equals(codeString)) + return ImagingModality.CR; + if ("CT".equals(codeString)) + return ImagingModality.CT; + if ("DX".equals(codeString)) + return ImagingModality.DX; + if ("ECG".equals(codeString)) + return ImagingModality.ECG; + if ("ES".equals(codeString)) + return ImagingModality.ES; + if ("XC".equals(codeString)) + return ImagingModality.XC; + if ("GM".equals(codeString)) + return ImagingModality.GM; + if ("HD".equals(codeString)) + return ImagingModality.HD; + if ("IO".equals(codeString)) + return ImagingModality.IO; + if ("IVOCT".equals(codeString)) + return ImagingModality.IVOCT; + if ("IVUS".equals(codeString)) + return ImagingModality.IVUS; + if ("KER".equals(codeString)) + return ImagingModality.KER; + if ("LEN".equals(codeString)) + return ImagingModality.LEN; + if ("MR".equals(codeString)) + return ImagingModality.MR; + if ("MG".equals(codeString)) + return ImagingModality.MG; + if ("NM".equals(codeString)) + return ImagingModality.NM; + if ("OAM".equals(codeString)) + return ImagingModality.OAM; + if ("OCT".equals(codeString)) + return ImagingModality.OCT; + if ("OPM".equals(codeString)) + return ImagingModality.OPM; + if ("OP".equals(codeString)) + return ImagingModality.OP; + if ("OPR".equals(codeString)) + return ImagingModality.OPR; + if ("OPT".equals(codeString)) + return ImagingModality.OPT; + if ("OPV".equals(codeString)) + return ImagingModality.OPV; + if ("PX".equals(codeString)) + return ImagingModality.PX; + if ("PT".equals(codeString)) + return ImagingModality.PT; + if ("RF".equals(codeString)) + return ImagingModality.RF; + if ("RG".equals(codeString)) + return ImagingModality.RG; + if ("SM".equals(codeString)) + return ImagingModality.SM; + if ("SRF".equals(codeString)) + return ImagingModality.SRF; + if ("US".equals(codeString)) + return ImagingModality.US; + if ("VA".equals(codeString)) + return ImagingModality.VA; + if ("XA".equals(codeString)) + return ImagingModality.XA; + throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); + } + public String toCode(ImagingModality code) throws IllegalArgumentException { + if (code == ImagingModality.AR) + return "AR"; + if (code == ImagingModality.BMD) + return "BMD"; + if (code == ImagingModality.BDUS) + return "BDUS"; + if (code == ImagingModality.EPS) + return "EPS"; + if (code == ImagingModality.CR) + return "CR"; + if (code == ImagingModality.CT) + return "CT"; + if (code == ImagingModality.DX) + return "DX"; + if (code == ImagingModality.ECG) + return "ECG"; + if (code == ImagingModality.ES) + return "ES"; + if (code == ImagingModality.XC) + return "XC"; + if (code == ImagingModality.GM) + return "GM"; + if (code == ImagingModality.HD) + return "HD"; + if (code == ImagingModality.IO) + return "IO"; + if (code == ImagingModality.IVOCT) + return "IVOCT"; + if (code == ImagingModality.IVUS) + return "IVUS"; + if (code == ImagingModality.KER) + return "KER"; + if (code == ImagingModality.LEN) + return "LEN"; + if (code == ImagingModality.MR) + return "MR"; + if (code == ImagingModality.MG) + return "MG"; + if (code == ImagingModality.NM) + return "NM"; + if (code == ImagingModality.OAM) + return "OAM"; + if (code == ImagingModality.OCT) + return "OCT"; + if (code == ImagingModality.OPM) + return "OPM"; + if (code == ImagingModality.OP) + return "OP"; + if (code == ImagingModality.OPR) + return "OPR"; + if (code == ImagingModality.OPT) + return "OPT"; + if (code == ImagingModality.OPV) + return "OPV"; + if (code == ImagingModality.PX) + return "PX"; + if (code == ImagingModality.PT) + return "PT"; + if (code == ImagingModality.RF) + return "RF"; + if (code == ImagingModality.RG) + return "RG"; + if (code == ImagingModality.SM) + return "SM"; + if (code == ImagingModality.SRF) + return "SRF"; + if (code == ImagingModality.US) + return "US"; + if (code == ImagingModality.VA) + return "VA"; + if (code == ImagingModality.XA) + return "XA"; + return "?"; + } + } + + public enum InstanceAvailability implements FhirEnum { + /** + * Resources are immediately available,. + */ + ONLINE, + /** + * Resources need to be retrieved by manual intervention. + */ + OFFLINE, + /** + * Resources need to be retrieved from relatively slow media. + */ + NEARLINE, + /** + * Resources cannot be retrieved. + */ + UNAVAILABLE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ONLINE; + if ("OFFLINE".equals(codeString)) + return OFFLINE; + if ("NEARLINE".equals(codeString)) + return NEARLINE; + if ("UNAVAILABLE".equals(codeString)) + return UNAVAILABLE; + throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ONLINE: return "ONLINE"; + case OFFLINE: return "OFFLINE"; + case NEARLINE: return "NEARLINE"; + case UNAVAILABLE: return "UNAVAILABLE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ONLINE: return "http://nema.org/dicom/dcid"; + case OFFLINE: return "http://nema.org/dicom/dcid"; + case NEARLINE: return "http://nema.org/dicom/dcid"; + case UNAVAILABLE: return "http://nema.org/dicom/dcid"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ONLINE: return "Resources are immediately available,."; + case OFFLINE: return "Resources need to be retrieved by manual intervention."; + case NEARLINE: return "Resources need to be retrieved from relatively slow media."; + case UNAVAILABLE: return "Resources cannot be retrieved."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ONLINE: return "ONLINE"; + case OFFLINE: return "OFFLINE"; + case NEARLINE: return "NEARLINE"; + case UNAVAILABLE: return "UNAVAILABLE"; + default: return "?"; + } + } + } + + public static class InstanceAvailabilityEnumFactory implements EnumFactory { + public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ONLINE".equals(codeString)) + return InstanceAvailability.ONLINE; + if ("OFFLINE".equals(codeString)) + return InstanceAvailability.OFFLINE; + if ("NEARLINE".equals(codeString)) + return InstanceAvailability.NEARLINE; + if ("UNAVAILABLE".equals(codeString)) + return InstanceAvailability.UNAVAILABLE; + throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); + } + public String toCode(InstanceAvailability code) throws IllegalArgumentException { + if (code == InstanceAvailability.ONLINE) + return "ONLINE"; + if (code == InstanceAvailability.OFFLINE) + return "OFFLINE"; + if (code == InstanceAvailability.NEARLINE) + return "NEARLINE"; + if (code == InstanceAvailability.UNAVAILABLE) + return "UNAVAILABLE"; + return "?"; + } + } + + public enum Modality implements FhirEnum { + /** + * + */ + AR, + /** + * + */ + AU, + /** + * + */ + BDUS, + /** + * + */ + BI, + /** + * + */ + BMD, + /** + * + */ + CR, + /** + * + */ + CT, + /** + * + */ + DG, + /** + * + */ + DX, + /** + * + */ + ECG, + /** + * + */ + EPS, + /** + * + */ + ES, + /** + * + */ + GM, + /** + * + */ + HC, + /** + * + */ + HD, + /** + * + */ + IO, + /** + * + */ + IVOCT, + /** + * + */ + IVUS, + /** + * + */ + KER, + /** + * + */ + KO, + /** + * + */ + LEN, + /** + * + */ + LS, + /** + * + */ + MG, + /** + * + */ + MR, + /** + * + */ + NM, + /** + * + */ + OAM, + /** + * + */ + OCT, + /** + * + */ + OP, + /** + * + */ + OPM, + /** + * + */ + OPT, + /** + * + */ + OPV, + /** + * + */ + OT, + /** + * + */ + PR, + /** + * + */ + PT, + /** + * + */ + PX, + /** + * + */ + REG, + /** + * + */ + RF, + /** + * + */ + RG, + /** + * + */ + RTDOSE, + /** + * + */ + RTIMAGE, + /** + * + */ + RTPLAN, + /** + * + */ + RTRECORD, + /** + * + */ + RTSTRUCT, + /** + * + */ + SEG, + /** + * + */ + SM, + /** + * + */ + SMR, + /** + * + */ + SR, + /** + * + */ + SRF, + /** + * + */ + TG, + /** + * + */ + US, + /** + * + */ + VA, + /** + * + */ + XA, + /** + * + */ + XC, + /** + * added to help the parsers + */ + NULL; + + 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)) + return AR; + if ("AU".equals(codeString)) + return AU; + if ("BDUS".equals(codeString)) + return BDUS; + if ("BI".equals(codeString)) + return BI; + if ("BMD".equals(codeString)) + return BMD; + if ("CR".equals(codeString)) + return CR; + if ("CT".equals(codeString)) + return CT; + if ("DG".equals(codeString)) + return DG; + if ("DX".equals(codeString)) + return DX; + if ("ECG".equals(codeString)) + return ECG; + if ("EPS".equals(codeString)) + return EPS; + if ("ES".equals(codeString)) + return ES; + if ("GM".equals(codeString)) + return GM; + if ("HC".equals(codeString)) + return HC; + if ("HD".equals(codeString)) + return HD; + if ("IO".equals(codeString)) + return IO; + if ("IVOCT".equals(codeString)) + return IVOCT; + if ("IVUS".equals(codeString)) + return IVUS; + if ("KER".equals(codeString)) + return KER; + if ("KO".equals(codeString)) + return KO; + if ("LEN".equals(codeString)) + return LEN; + if ("LS".equals(codeString)) + return LS; + if ("MG".equals(codeString)) + return MG; + if ("MR".equals(codeString)) + return MR; + if ("NM".equals(codeString)) + return NM; + if ("OAM".equals(codeString)) + return OAM; + if ("OCT".equals(codeString)) + return OCT; + if ("OP".equals(codeString)) + return OP; + if ("OPM".equals(codeString)) + return OPM; + if ("OPT".equals(codeString)) + return OPT; + if ("OPV".equals(codeString)) + return OPV; + if ("OT".equals(codeString)) + return OT; + if ("PR".equals(codeString)) + return PR; + if ("PT".equals(codeString)) + return PT; + if ("PX".equals(codeString)) + return PX; + if ("REG".equals(codeString)) + return REG; + if ("RF".equals(codeString)) + return RF; + if ("RG".equals(codeString)) + return RG; + if ("RTDOSE".equals(codeString)) + return RTDOSE; + if ("RTIMAGE".equals(codeString)) + return RTIMAGE; + if ("RTPLAN".equals(codeString)) + return RTPLAN; + if ("RTRECORD".equals(codeString)) + return RTRECORD; + if ("RTSTRUCT".equals(codeString)) + return RTSTRUCT; + if ("SEG".equals(codeString)) + return SEG; + if ("SM".equals(codeString)) + return SM; + if ("SMR".equals(codeString)) + return SMR; + if ("SR".equals(codeString)) + return SR; + if ("SRF".equals(codeString)) + return SRF; + if ("TG".equals(codeString)) + return TG; + if ("US".equals(codeString)) + return US; + if ("VA".equals(codeString)) + return VA; + if ("XA".equals(codeString)) + return XA; + if ("XC".equals(codeString)) + return XC; + throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case AR: return "AR"; + case AU: return "AU"; + case BDUS: return "BDUS"; + case BI: return "BI"; + case BMD: return "BMD"; + case CR: return "CR"; + case CT: return "CT"; + case DG: return "DG"; + case DX: return "DX"; + case ECG: return "ECG"; + case EPS: return "EPS"; + case ES: return "ES"; + case GM: return "GM"; + case HC: return "HC"; + case HD: return "HD"; + case IO: return "IO"; + case IVOCT: return "IVOCT"; + case IVUS: return "IVUS"; + case KER: return "KER"; + case KO: return "KO"; + case LEN: return "LEN"; + case LS: return "LS"; + case MG: return "MG"; + case MR: return "MR"; + case NM: return "NM"; + case OAM: return "OAM"; + case OCT: return "OCT"; + case OP: return "OP"; + case OPM: return "OPM"; + case OPT: return "OPT"; + case OPV: return "OPV"; + case OT: return "OT"; + case PR: return "PR"; + case PT: return "PT"; + case PX: return "PX"; + case REG: return "REG"; + case RF: return "RF"; + case RG: return "RG"; + case RTDOSE: return "RTDOSE"; + case RTIMAGE: return "RTIMAGE"; + case RTPLAN: return "RTPLAN"; + case RTRECORD: return "RTRECORD"; + case RTSTRUCT: return "RTSTRUCT"; + case SEG: return "SEG"; + case SM: return "SM"; + case SMR: return "SMR"; + case SR: return "SR"; + case SRF: return "SRF"; + case TG: return "TG"; + case US: return "US"; + case VA: return "VA"; + case XA: return "XA"; + case XC: return "XC"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case AR: return "http://nema.org/dicom/dcid"; + case AU: return "http://nema.org/dicom/dcid"; + case BDUS: return "http://nema.org/dicom/dcid"; + case BI: return "http://nema.org/dicom/dcid"; + case BMD: return "http://nema.org/dicom/dcid"; + case CR: return "http://nema.org/dicom/dcid"; + case CT: return "http://nema.org/dicom/dcid"; + case DG: return "http://nema.org/dicom/dcid"; + case DX: return "http://nema.org/dicom/dcid"; + case ECG: return "http://nema.org/dicom/dcid"; + case EPS: return "http://nema.org/dicom/dcid"; + case ES: return "http://nema.org/dicom/dcid"; + case GM: return "http://nema.org/dicom/dcid"; + case HC: return "http://nema.org/dicom/dcid"; + case HD: return "http://nema.org/dicom/dcid"; + case IO: return "http://nema.org/dicom/dcid"; + case IVOCT: return "http://nema.org/dicom/dcid"; + case IVUS: return "http://nema.org/dicom/dcid"; + case KER: return "http://nema.org/dicom/dcid"; + case KO: return "http://nema.org/dicom/dcid"; + case LEN: return "http://nema.org/dicom/dcid"; + case LS: return "http://nema.org/dicom/dcid"; + case MG: return "http://nema.org/dicom/dcid"; + case MR: return "http://nema.org/dicom/dcid"; + case NM: return "http://nema.org/dicom/dcid"; + case OAM: return "http://nema.org/dicom/dcid"; + case OCT: return "http://nema.org/dicom/dcid"; + case OP: return "http://nema.org/dicom/dcid"; + case OPM: return "http://nema.org/dicom/dcid"; + case OPT: return "http://nema.org/dicom/dcid"; + case OPV: return "http://nema.org/dicom/dcid"; + case OT: return "http://nema.org/dicom/dcid"; + case PR: return "http://nema.org/dicom/dcid"; + case PT: return "http://nema.org/dicom/dcid"; + case PX: return "http://nema.org/dicom/dcid"; + case REG: return "http://nema.org/dicom/dcid"; + case RF: return "http://nema.org/dicom/dcid"; + case RG: return "http://nema.org/dicom/dcid"; + case RTDOSE: return "http://nema.org/dicom/dcid"; + case RTIMAGE: return "http://nema.org/dicom/dcid"; + case RTPLAN: return "http://nema.org/dicom/dcid"; + case RTRECORD: return "http://nema.org/dicom/dcid"; + case RTSTRUCT: return "http://nema.org/dicom/dcid"; + case SEG: return "http://nema.org/dicom/dcid"; + case SM: return "http://nema.org/dicom/dcid"; + case SMR: return "http://nema.org/dicom/dcid"; + case SR: return "http://nema.org/dicom/dcid"; + case SRF: return "http://nema.org/dicom/dcid"; + case TG: return "http://nema.org/dicom/dcid"; + case US: return "http://nema.org/dicom/dcid"; + case VA: return "http://nema.org/dicom/dcid"; + case XA: return "http://nema.org/dicom/dcid"; + case XC: return "http://nema.org/dicom/dcid"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case AR: return ""; + case AU: return ""; + case BDUS: return ""; + case BI: return ""; + case BMD: return ""; + case CR: return ""; + case CT: return ""; + case DG: return ""; + case DX: return ""; + case ECG: return ""; + case EPS: return ""; + case ES: return ""; + case GM: return ""; + case HC: return ""; + case HD: return ""; + case IO: return ""; + case IVOCT: return ""; + case IVUS: return ""; + case KER: return ""; + case KO: return ""; + case LEN: return ""; + case LS: return ""; + case MG: return ""; + case MR: return ""; + case NM: return ""; + case OAM: return ""; + case OCT: return ""; + case OP: return ""; + case OPM: return ""; + case OPT: return ""; + case OPV: return ""; + case OT: return ""; + case PR: return ""; + case PT: return ""; + case PX: return ""; + case REG: return ""; + case RF: return ""; + case RG: return ""; + case RTDOSE: return ""; + case RTIMAGE: return ""; + case RTPLAN: return ""; + case RTRECORD: return ""; + case RTSTRUCT: return ""; + case SEG: return ""; + case SM: return ""; + case SMR: return ""; + case SR: return ""; + case SRF: return ""; + case TG: return ""; + case US: return ""; + case VA: return ""; + case XA: return ""; + case XC: return ""; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case AR: return "AR"; + case AU: return "AU"; + case BDUS: return "BDUS"; + case BI: return "BI"; + case BMD: return "BMD"; + case CR: return "CR"; + case CT: return "CT"; + case DG: return "DG"; + case DX: return "DX"; + case ECG: return "ECG"; + case EPS: return "EPS"; + case ES: return "ES"; + case GM: return "GM"; + case HC: return "HC"; + case HD: return "HD"; + case IO: return "IO"; + case IVOCT: return "IVOCT"; + case IVUS: return "IVUS"; + case KER: return "KER"; + case KO: return "KO"; + case LEN: return "LEN"; + case LS: return "LS"; + case MG: return "MG"; + case MR: return "MR"; + case NM: return "NM"; + case OAM: return "OAM"; + case OCT: return "OCT"; + case OP: return "OP"; + case OPM: return "OPM"; + case OPT: return "OPT"; + case OPV: return "OPV"; + case OT: return "OT"; + case PR: return "PR"; + case PT: return "PT"; + case PX: return "PX"; + case REG: return "REG"; + case RF: return "RF"; + case RG: return "RG"; + case RTDOSE: return "RTDOSE"; + case RTIMAGE: return "RTIMAGE"; + case RTPLAN: return "RTPLAN"; + case RTRECORD: return "RTRECORD"; + case RTSTRUCT: return "RTSTRUCT"; + case SEG: return "SEG"; + case SM: return "SM"; + case SMR: return "SMR"; + case SR: return "SR"; + case SRF: return "SRF"; + case TG: return "TG"; + case US: return "US"; + case VA: return "VA"; + case XA: return "XA"; + case XC: return "XC"; + default: return "?"; + } + } + } + + public static class ModalityEnumFactory implements EnumFactory { + public Modality fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("AR".equals(codeString)) + return Modality.AR; + if ("AU".equals(codeString)) + return Modality.AU; + if ("BDUS".equals(codeString)) + return Modality.BDUS; + if ("BI".equals(codeString)) + return Modality.BI; + if ("BMD".equals(codeString)) + return Modality.BMD; + if ("CR".equals(codeString)) + return Modality.CR; + if ("CT".equals(codeString)) + return Modality.CT; + if ("DG".equals(codeString)) + return Modality.DG; + if ("DX".equals(codeString)) + return Modality.DX; + if ("ECG".equals(codeString)) + return Modality.ECG; + if ("EPS".equals(codeString)) + return Modality.EPS; + if ("ES".equals(codeString)) + return Modality.ES; + if ("GM".equals(codeString)) + return Modality.GM; + if ("HC".equals(codeString)) + return Modality.HC; + if ("HD".equals(codeString)) + return Modality.HD; + if ("IO".equals(codeString)) + return Modality.IO; + if ("IVOCT".equals(codeString)) + return Modality.IVOCT; + if ("IVUS".equals(codeString)) + return Modality.IVUS; + if ("KER".equals(codeString)) + return Modality.KER; + if ("KO".equals(codeString)) + return Modality.KO; + if ("LEN".equals(codeString)) + return Modality.LEN; + if ("LS".equals(codeString)) + return Modality.LS; + if ("MG".equals(codeString)) + return Modality.MG; + if ("MR".equals(codeString)) + return Modality.MR; + if ("NM".equals(codeString)) + return Modality.NM; + if ("OAM".equals(codeString)) + return Modality.OAM; + if ("OCT".equals(codeString)) + return Modality.OCT; + if ("OP".equals(codeString)) + return Modality.OP; + if ("OPM".equals(codeString)) + return Modality.OPM; + if ("OPT".equals(codeString)) + return Modality.OPT; + if ("OPV".equals(codeString)) + return Modality.OPV; + if ("OT".equals(codeString)) + return Modality.OT; + if ("PR".equals(codeString)) + return Modality.PR; + if ("PT".equals(codeString)) + return Modality.PT; + if ("PX".equals(codeString)) + return Modality.PX; + if ("REG".equals(codeString)) + return Modality.REG; + if ("RF".equals(codeString)) + return Modality.RF; + if ("RG".equals(codeString)) + return Modality.RG; + if ("RTDOSE".equals(codeString)) + return Modality.RTDOSE; + if ("RTIMAGE".equals(codeString)) + return Modality.RTIMAGE; + if ("RTPLAN".equals(codeString)) + return Modality.RTPLAN; + if ("RTRECORD".equals(codeString)) + return Modality.RTRECORD; + if ("RTSTRUCT".equals(codeString)) + return Modality.RTSTRUCT; + if ("SEG".equals(codeString)) + return Modality.SEG; + if ("SM".equals(codeString)) + return Modality.SM; + if ("SMR".equals(codeString)) + return Modality.SMR; + if ("SR".equals(codeString)) + return Modality.SR; + if ("SRF".equals(codeString)) + return Modality.SRF; + if ("TG".equals(codeString)) + return Modality.TG; + if ("US".equals(codeString)) + return Modality.US; + if ("VA".equals(codeString)) + return Modality.VA; + if ("XA".equals(codeString)) + return Modality.XA; + if ("XC".equals(codeString)) + return Modality.XC; + throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); + } + public String toCode(Modality code) throws IllegalArgumentException { + if (code == Modality.AR) + return "AR"; + if (code == Modality.AU) + return "AU"; + if (code == Modality.BDUS) + return "BDUS"; + if (code == Modality.BI) + return "BI"; + if (code == Modality.BMD) + return "BMD"; + if (code == Modality.CR) + return "CR"; + if (code == Modality.CT) + return "CT"; + if (code == Modality.DG) + return "DG"; + if (code == Modality.DX) + return "DX"; + if (code == Modality.ECG) + return "ECG"; + if (code == Modality.EPS) + return "EPS"; + if (code == Modality.ES) + return "ES"; + if (code == Modality.GM) + return "GM"; + if (code == Modality.HC) + return "HC"; + if (code == Modality.HD) + return "HD"; + if (code == Modality.IO) + return "IO"; + if (code == Modality.IVOCT) + return "IVOCT"; + if (code == Modality.IVUS) + return "IVUS"; + if (code == Modality.KER) + return "KER"; + if (code == Modality.KO) + return "KO"; + if (code == Modality.LEN) + return "LEN"; + if (code == Modality.LS) + return "LS"; + if (code == Modality.MG) + return "MG"; + if (code == Modality.MR) + return "MR"; + if (code == Modality.NM) + return "NM"; + if (code == Modality.OAM) + return "OAM"; + if (code == Modality.OCT) + return "OCT"; + if (code == Modality.OP) + return "OP"; + if (code == Modality.OPM) + return "OPM"; + if (code == Modality.OPT) + return "OPT"; + if (code == Modality.OPV) + return "OPV"; + if (code == Modality.OT) + return "OT"; + if (code == Modality.PR) + return "PR"; + if (code == Modality.PT) + return "PT"; + if (code == Modality.PX) + return "PX"; + if (code == Modality.REG) + return "REG"; + if (code == Modality.RF) + return "RF"; + if (code == Modality.RG) + return "RG"; + if (code == Modality.RTDOSE) + return "RTDOSE"; + if (code == Modality.RTIMAGE) + return "RTIMAGE"; + if (code == Modality.RTPLAN) + return "RTPLAN"; + if (code == Modality.RTRECORD) + return "RTRECORD"; + if (code == Modality.RTSTRUCT) + return "RTSTRUCT"; + if (code == Modality.SEG) + return "SEG"; + if (code == Modality.SM) + return "SM"; + if (code == Modality.SMR) + return "SMR"; + if (code == Modality.SR) + return "SR"; + if (code == Modality.SRF) + return "SRF"; + if (code == Modality.TG) + return "TG"; + if (code == Modality.US) + return "US"; + if (code == Modality.VA) + return "VA"; + if (code == Modality.XA) + return "XA"; + if (code == Modality.XC) + return "XC"; + return "?"; + } + } + + @Block() + public static class ImagingStudySeriesComponent extends BackboneElement { + /** + * The Numeric identifier of this series in the study. + */ + @Child(name="number", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Numeric identifier of this series (0020,0011)", formalDefinition="The Numeric identifier of this series in the study." ) + protected IntegerType number; + + /** + * The modality of this series sequence. + */ + @Child(name="modality", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The modality of the instances in the series (0008,0060)", formalDefinition="The modality of this series sequence." ) + protected Enumeration modality; + + /** + * Formal identifier for this series. + */ + @Child(name="uid", type={OidType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Formal identifier for this series (0020,000E)", formalDefinition="Formal identifier for this series." ) + protected OidType uid; + + /** + * A description of the series. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="A description of the series (0008,103E)", formalDefinition="A description of the series." ) + protected StringType description; + + /** + * Sequence that contains attributes from the. + */ + @Child(name="numberOfInstances", type={IntegerType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Number of Series Related Instances (0020,1209)", formalDefinition="Sequence that contains attributes from the." ) + protected IntegerType numberOfInstances; + + /** + * Availability of series (online, offline or nearline). + */ + @Child(name="availability", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of series (online, offline or nearline)." ) + protected Enumeration availability; + + /** + * WADO-RS URI where Series is available. + */ + @Child(name="url", type={UriType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Retrieve URI (0008,1115 > 0008,1190)", formalDefinition="WADO-RS URI where Series is available." ) + protected UriType url; + + /** + * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed. + */ + @Child(name="bodySite", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Body part examined (Map from 0018,0015)", formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed." ) + protected Coding bodySite; + + /** + * The date when the series was started. + */ + @Child(name="dateTime", type={DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="When the series started", formalDefinition="The date when the series was started." ) + protected DateTimeType dateTime; + + /** + * A single image taken from a patient. + */ + @Child(name="instance", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A single instance taken from a patient (image or other)", formalDefinition="A single image taken from a patient." ) + protected List instance; + + private static final long serialVersionUID = -1442035574L; + + public ImagingStudySeriesComponent() { + super(); + } + + public ImagingStudySeriesComponent(Enumeration modality, OidType uid, IntegerType numberOfInstances) { + super(); + this.modality = modality; + this.uid = uid; + this.numberOfInstances = numberOfInstances; + } + + /** + * @return {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public IntegerType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new IntegerType(); + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public ImagingStudySeriesComponent setNumberElement(IntegerType value) { + this.number = value; + return this; + } + + /** + * @return The Numeric identifier of this series in the study. + */ + public int getNumber() { + return this.number == null ? null : this.number.getValue(); + } + + /** + * @param value The Numeric identifier of this series in the study. + */ + public ImagingStudySeriesComponent setNumber(int value) { + if (value == -1) + this.number = null; + else { + if (this.number == null) + this.number = new IntegerType(); + this.number.setValue(value); + } + return this; + } + + /** + * @return {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value + */ + public Enumeration getModalityElement() { + if (this.modality == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality"); + else if (Configuration.doAutoCreate()) + this.modality = new Enumeration(); + return this.modality; + } + + public boolean hasModalityElement() { + return this.modality != null && !this.modality.isEmpty(); + } + + public boolean hasModality() { + return this.modality != null && !this.modality.isEmpty(); + } + + /** + * @param value {@link #modality} (The modality of this series sequence.). This is the underlying object with id, value and extensions. The accessor "getModality" gives direct access to the value + */ + public ImagingStudySeriesComponent setModalityElement(Enumeration value) { + this.modality = value; + return this; + } + + /** + * @return The modality of this series sequence. + */ + public Modality getModality() { + return this.modality == null ? null : this.modality.getValue(); + } + + /** + * @param value The modality of this series sequence. + */ + public ImagingStudySeriesComponent setModality(Modality value) { + if (this.modality == null) + this.modality = new Enumeration(Modality.ENUM_FACTORY); + this.modality.setValue(value); + return this; + } + + /** + * @return {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudySeriesComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for this series. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for this series. + */ + public ImagingStudySeriesComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of the series.). 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 ImagingStudySeriesComponent.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} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingStudySeriesComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the series. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the series. + */ + public ImagingStudySeriesComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #numberOfInstances} (Sequence that contains attributes from the.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public IntegerType getNumberOfInstancesElement() { + if (this.numberOfInstances == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances"); + else if (Configuration.doAutoCreate()) + this.numberOfInstances = new IntegerType(); + return this.numberOfInstances; + } + + public boolean hasNumberOfInstancesElement() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + public boolean hasNumberOfInstances() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + /** + * @param value {@link #numberOfInstances} (Sequence that contains attributes from the.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public ImagingStudySeriesComponent setNumberOfInstancesElement(IntegerType value) { + this.numberOfInstances = value; + return this; + } + + /** + * @return Sequence that contains attributes from the. + */ + public int getNumberOfInstances() { + return this.numberOfInstances == null ? null : this.numberOfInstances.getValue(); + } + + /** + * @param value Sequence that contains attributes from the. + */ + public ImagingStudySeriesComponent setNumberOfInstances(int value) { + if (this.numberOfInstances == null) + this.numberOfInstances = new IntegerType(); + this.numberOfInstances.setValue(value); + return this; + } + + /** + * @return {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public Enumeration getAvailabilityElement() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Enumeration(); + return this.availability; + } + + public boolean hasAvailabilityElement() { + return this.availability != null && !this.availability.isEmpty(); + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public ImagingStudySeriesComponent setAvailabilityElement(Enumeration value) { + this.availability = value; + return this; + } + + /** + * @return Availability of series (online, offline or nearline). + */ + public InstanceAvailability getAvailability() { + return this.availability == null ? null : this.availability.getValue(); + } + + /** + * @param value Availability of series (online, offline or nearline). + */ + public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { + if (value == null) + this.availability = null; + else { + if (this.availability == null) + this.availability = new Enumeration(InstanceAvailability.ENUM_FACTORY); + this.availability.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (WADO-RS URI where Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URI where Series is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudySeriesComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URI where Series is available. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URI where Series is available. + */ + public ImagingStudySeriesComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.) + */ + public ImagingStudySeriesComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #dateTime} (The date when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date when the series was started.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public ImagingStudySeriesComponent setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date when the series was started. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date when the series was started. + */ + public ImagingStudySeriesComponent setDateTime(Date value) { + if (value == null) + this.dateTime = null; + else { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (A single image taken from a patient.) + */ + public List getInstance() { + if (this.instance == null) + this.instance = new ArrayList(); + return this.instance; + } + + public boolean hasInstance() { + if (this.instance == null) + return false; + for (ImagingStudySeriesInstanceComponent item : this.instance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #instance} (A single image taken from a patient.) + */ + // syntactic sugar + public ImagingStudySeriesInstanceComponent addInstance() { //3 + ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent(); + if (this.instance == null) + this.instance = new ArrayList(); + this.instance.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "integer", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("modality", "code", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality)); + childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("numberOfInstances", "integer", "Sequence that contains attributes from the.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); + childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("url", "uri", "WADO-RS URI where Series is available.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("bodySite", "Coding", "Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("dateTime", "dateTime", "The date when the series was started.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("instance", "", "A single image taken from a patient.", 0, java.lang.Integer.MAX_VALUE, instance)); + } + + public ImagingStudySeriesComponent copy() { + ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.modality = modality == null ? null : modality.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.description = description == null ? null : description.copy(); + dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); + dst.availability = availability == null ? null : availability.copy(); + dst.url = url == null ? null : url.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + if (instance != null) { + dst.instance = new ArrayList(); + for (ImagingStudySeriesInstanceComponent i : instance) + dst.instance.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (modality == null || modality.isEmpty()) + && (uid == null || uid.isEmpty()) && (description == null || description.isEmpty()) && (numberOfInstances == null || numberOfInstances.isEmpty()) + && (availability == null || availability.isEmpty()) && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty()) + && (dateTime == null || dateTime.isEmpty()) && (instance == null || instance.isEmpty()); + } + + } + + @Block() + public static class ImagingStudySeriesInstanceComponent extends BackboneElement { + /** + * The number of this image in the series. + */ + @Child(name="number", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="The number of this instance in the series (0020,0013)", formalDefinition="The number of this image in the series." ) + protected IntegerType number; + + /** + * Formal identifier for this image. + */ + @Child(name="uid", type={OidType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Formal identifier for this instance (0008,0018)", formalDefinition="Formal identifier for this image." ) + protected OidType uid; + + /** + * DICOM Image type. + */ + @Child(name="sopclass", type={OidType.class}, order=3, min=1, max=1) + @Description(shortDefinition="DICOM class type (0008,0016)", formalDefinition="DICOM Image type." ) + protected OidType sopclass; + + /** + * The type of the instance. + */ + @Child(name="type", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Type of instance (image etc) (0004,1430)", formalDefinition="The type of the instance." ) + protected StringType type; + + /** + * The description of the instance. + */ + @Child(name="title", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)", formalDefinition="The description of the instance." ) + protected StringType title; + + /** + * WADO-RS url where image is available. + */ + @Child(name="url", type={UriType.class}, order=6, min=0, max=1) + @Description(shortDefinition="WADO-RS service where instance is available (0008,1199 > 0008,1190)", formalDefinition="WADO-RS url where image is available." ) + protected UriType url; + + /** + * A FHIR resource with content for this instance. + */ + @Child(name="attachment", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Content for this instance", formalDefinition="A FHIR resource with content for this instance." ) + protected Reference attachment; + + /** + * The actual object that is the target of the reference (A FHIR resource with content for this instance.) + */ + protected Resource attachmentTarget; + + private static final long serialVersionUID = -2008450480L; + + public ImagingStudySeriesInstanceComponent() { + super(); + } + + public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopclass) { + super(); + this.uid = uid; + this.sopclass = sopclass; + } + + /** + * @return {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public IntegerType getNumberElement() { + if (this.number == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number"); + else if (Configuration.doAutoCreate()) + this.number = new IntegerType(); + return this.number; + } + + public boolean hasNumberElement() { + return this.number != null && !this.number.isEmpty(); + } + + public boolean hasNumber() { + return this.number != null && !this.number.isEmpty(); + } + + /** + * @param value {@link #number} (The number of this image in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setNumberElement(IntegerType value) { + this.number = value; + return this; + } + + /** + * @return The number of this image in the series. + */ + public int getNumber() { + return this.number == null ? null : this.number.getValue(); + } + + /** + * @param value The number of this image in the series. + */ + public ImagingStudySeriesInstanceComponent setNumber(int value) { + if (value == -1) + this.number = null; + else { + if (this.number == null) + this.number = new IntegerType(); + this.number.setValue(value); + } + return this; + } + + /** + * @return {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for this image.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for this image. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for this image. + */ + public ImagingStudySeriesInstanceComponent setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value + */ + public OidType getSopclassElement() { + if (this.sopclass == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopclass"); + else if (Configuration.doAutoCreate()) + this.sopclass = new OidType(); + return this.sopclass; + } + + public boolean hasSopclassElement() { + return this.sopclass != null && !this.sopclass.isEmpty(); + } + + public boolean hasSopclass() { + return this.sopclass != null && !this.sopclass.isEmpty(); + } + + /** + * @param value {@link #sopclass} (DICOM Image type.). This is the underlying object with id, value and extensions. The accessor "getSopclass" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setSopclassElement(OidType value) { + this.sopclass = value; + return this; + } + + /** + * @return DICOM Image type. + */ + public String getSopclass() { + return this.sopclass == null ? null : this.sopclass.getValue(); + } + + /** + * @param value DICOM Image type. + */ + public ImagingStudySeriesInstanceComponent setSopclass(String value) { + if (this.sopclass == null) + this.sopclass = new OidType(); + this.sopclass.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of the instance.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); + 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 of the instance.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return The type of the instance. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of the instance. + */ + public ImagingStudySeriesInstanceComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The description of the instance. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The description of the instance. + */ + public ImagingStudySeriesInstanceComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (WADO-RS url where image is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS url where image is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudySeriesInstanceComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS url where image is available. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS url where image is available. + */ + public ImagingStudySeriesInstanceComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #attachment} (A FHIR resource with content for this instance.) + */ + public Reference getAttachment() { + if (this.attachment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.attachment"); + else if (Configuration.doAutoCreate()) + this.attachment = new Reference(); + return this.attachment; + } + + public boolean hasAttachment() { + return this.attachment != null && !this.attachment.isEmpty(); + } + + /** + * @param value {@link #attachment} (A FHIR resource with content for this instance.) + */ + public ImagingStudySeriesInstanceComponent setAttachment(Reference value) { + this.attachment = value; + return this; + } + + /** + * @return {@link #attachment} 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 FHIR resource with content for this instance.) + */ + public Resource getAttachmentTarget() { + return this.attachmentTarget; + } + + /** + * @param value {@link #attachment} 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 FHIR resource with content for this instance.) + */ + public ImagingStudySeriesInstanceComponent setAttachmentTarget(Resource value) { + this.attachmentTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("number", "integer", "The number of this image in the series.", 0, java.lang.Integer.MAX_VALUE, number)); + childrenList.add(new Property("uid", "oid", "Formal identifier for this image.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("sopclass", "oid", "DICOM Image type.", 0, java.lang.Integer.MAX_VALUE, sopclass)); + childrenList.add(new Property("type", "string", "The type of the instance.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("url", "uri", "WADO-RS url where image is available.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("attachment", "Reference(Any)", "A FHIR resource with content for this instance.", 0, java.lang.Integer.MAX_VALUE, attachment)); + } + + public ImagingStudySeriesInstanceComponent copy() { + ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent(); + copyValues(dst); + dst.number = number == null ? null : number.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.sopclass = sopclass == null ? null : sopclass.copy(); + dst.type = type == null ? null : type.copy(); + dst.title = title == null ? null : title.copy(); + dst.url = url == null ? null : url.copy(); + dst.attachment = attachment == null ? null : attachment.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (number == null || number.isEmpty()) && (uid == null || uid.isEmpty()) + && (sopclass == null || sopclass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty()) + && (url == null || url.isEmpty()) && (attachment == null || attachment.isEmpty()); + } + + } + + /** + * Date and Time the study started. + */ + @Child(name="started", type={DateTimeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="When the study was started (0008,0020)+(0008,0030)", formalDefinition="Date and Time the study started." ) + protected DateTimeType started; + + /** + * The patient for whom the images are of. + */ + @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Who the images are of", formalDefinition="The patient for whom the images are of." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient for whom the images are of.) + */ + protected Patient patientTarget; + + /** + * Formal identifier for the study. + */ + @Child(name="uid", type={OidType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Formal identifier for the study (0020,000D)", formalDefinition="Formal identifier for the study." ) + protected OidType uid; + + /** + * Accession Number. + */ + @Child(name="accession", type={Identifier.class}, order=2, min=0, max=1) + @Description(shortDefinition="Accession Number (0008,0050)", formalDefinition="Accession Number." ) + protected Identifier accession; + + /** + * Other identifiers for the study. + */ + @Child(name="identifier", type={Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the study (0020,0010)", formalDefinition="Other identifiers for the study." ) + protected List identifier; + + /** + * A list of the diagnostic orders that resulted in this imaging study being performed. + */ + @Child(name="order", type={DiagnosticOrder.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Order(s) that caused this study to be performed", formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed." ) + protected List order; + /** + * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + protected List orderTarget; + + + /** + * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). + */ + @Child(name="modalityList", type={CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="All series.modality if actual acquisition modalities", formalDefinition="A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19)." ) + protected List> modalityList; + + /** + * The requesting/referring physician. + */ + @Child(name="referrer", type={Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." ) + protected Reference referrer; + + /** + * The actual object that is the target of the reference (The requesting/referring physician.) + */ + protected Practitioner referrerTarget; + + /** + * Availability of study (online, offline or nearline). + */ + @Child(name="availability", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." ) + protected Enumeration availability; + + /** + * WADO-RS URI where Study is available. + */ + @Child(name="url", type={UriType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Retrieve URI (0008,1190)", formalDefinition="WADO-RS URI where Study is available." ) + protected UriType url; + + /** + * Number of Series in Study. + */ + @Child(name="numberOfSeries", type={IntegerType.class}, order=9, min=1, max=1) + @Description(shortDefinition="Number of Study Related Series (0020,1206)", formalDefinition="Number of Series in Study." ) + protected IntegerType numberOfSeries; + + /** + * Number of SOP Instances in Study. + */ + @Child(name="numberOfInstances", type={IntegerType.class}, order=10, min=1, max=1) + @Description(shortDefinition="Number of Study Related Instances (0020,1208)", formalDefinition="Number of SOP Instances in Study." ) + protected IntegerType numberOfInstances; + + /** + * Diagnoses etc provided with request. + */ + @Child(name="clinicalInformation", type={StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Diagnoses etc with request (0040,1002)", formalDefinition="Diagnoses etc provided with request." ) + protected StringType clinicalInformation; + + /** + * Type of procedure performed. + */ + @Child(name="procedure", type={Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Type of procedure performed (0008,1032)", formalDefinition="Type of procedure performed." ) + protected List procedure; + + /** + * Who read study and interpreted the images. + */ + @Child(name="interpreter", type={Practitioner.class}, order=13, min=0, max=1) + @Description(shortDefinition="Who interpreted images (0008,1060)", formalDefinition="Who read study and interpreted the images." ) + protected Reference interpreter; + + /** + * The actual object that is the target of the reference (Who read study and interpreted the images.) + */ + protected Practitioner interpreterTarget; + + /** + * Institution-generated description or classification of the Study (component) performed. + */ + @Child(name="description", type={StringType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Institution-generated description (0008,1030)", formalDefinition="Institution-generated description or classification of the Study (component) performed." ) + protected StringType description; + + /** + * Each study has one or more series of image instances. + */ + @Child(name="series", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of image instances." ) + protected List series; + + private static final long serialVersionUID = 712301092L; + + public ImagingStudy() { + super(); + } + + public ImagingStudy(Reference patient, OidType uid, IntegerType numberOfSeries, IntegerType numberOfInstances) { + super(); + this.patient = patient; + this.uid = uid; + this.numberOfSeries = numberOfSeries; + this.numberOfInstances = numberOfInstances; + } + + /** + * @return {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public DateTimeType getStartedElement() { + if (this.started == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.started"); + else if (Configuration.doAutoCreate()) + this.started = new DateTimeType(); + return this.started; + } + + public boolean hasStartedElement() { + return this.started != null && !this.started.isEmpty(); + } + + public boolean hasStarted() { + return this.started != null && !this.started.isEmpty(); + } + + /** + * @param value {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value + */ + public ImagingStudy setStartedElement(DateTimeType value) { + this.started = value; + return this; + } + + /** + * @return Date and Time the study started. + */ + public Date getStarted() { + return this.started == null ? null : this.started.getValue(); + } + + /** + * @param value Date and Time the study started. + */ + public ImagingStudy setStarted(Date value) { + if (value == null) + this.started = null; + else { + if (this.started == null) + this.started = new DateTimeType(); + this.started.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (The patient for whom the images are of.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.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} (The patient for whom the images are of.) + */ + public ImagingStudy 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. (The patient for whom the images are of.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.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. (The patient for whom the images are of.) + */ + public ImagingStudy setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public OidType getUidElement() { + if (this.uid == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.uid"); + else if (Configuration.doAutoCreate()) + this.uid = new OidType(); + return this.uid; + } + + public boolean hasUidElement() { + return this.uid != null && !this.uid.isEmpty(); + } + + public boolean hasUid() { + return this.uid != null && !this.uid.isEmpty(); + } + + /** + * @param value {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value + */ + public ImagingStudy setUidElement(OidType value) { + this.uid = value; + return this; + } + + /** + * @return Formal identifier for the study. + */ + public String getUid() { + return this.uid == null ? null : this.uid.getValue(); + } + + /** + * @param value Formal identifier for the study. + */ + public ImagingStudy setUid(String value) { + if (this.uid == null) + this.uid = new OidType(); + this.uid.setValue(value); + return this; + } + + /** + * @return {@link #accession} (Accession Number.) + */ + public Identifier getAccession() { + if (this.accession == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.accession"); + else if (Configuration.doAutoCreate()) + this.accession = new Identifier(); + return this.accession; + } + + public boolean hasAccession() { + return this.accession != null && !this.accession.isEmpty(); + } + + /** + * @param value {@link #accession} (Accession Number.) + */ + public ImagingStudy setAccession(Identifier value) { + this.accession = value; + return this; + } + + /** + * @return {@link #identifier} (Other identifiers for the study.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Other identifiers for the study.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public List getOrder() { + if (this.order == null) + this.order = new ArrayList(); + return this.order; + } + + public boolean hasOrder() { + if (this.order == null) + return false; + for (Reference item : this.order) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + // syntactic sugar + public Reference addOrder() { //3 + Reference t = new Reference(); + if (this.order == null) + this.order = new ArrayList(); + this.order.add(t); + return t; + } + + /** + * @return {@link #order} (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. A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public List getOrderTarget() { + if (this.orderTarget == null) + this.orderTarget = new ArrayList(); + return this.orderTarget; + } + + // syntactic sugar + /** + * @return {@link #order} (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. A list of the diagnostic orders that resulted in this imaging study being performed.) + */ + public DiagnosticOrder addOrderTarget() { + DiagnosticOrder r = new DiagnosticOrder(); + if (this.orderTarget == null) + this.orderTarget = new ArrayList(); + this.orderTarget.add(r); + return r; + } + + /** + * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public List> getModalityList() { + if (this.modalityList == null) + this.modalityList = new ArrayList>(); + return this.modalityList; + } + + public boolean hasModalityList() { + if (this.modalityList == null) + return false; + for (Enumeration item : this.modalityList) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + // syntactic sugar + public Enumeration addModalityListElement() {//2 + Enumeration t = new Enumeration(); + if (this.modalityList == null) + this.modalityList = new ArrayList>(); + this.modalityList.add(t); + return t; + } + + /** + * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public ImagingStudy addModalityList(ImagingModality value) { //1 + Enumeration t = new Enumeration(); + t.setValue(value); + if (this.modalityList == null) + this.modalityList = new ArrayList>(); + this.modalityList.add(t); + return this; + } + + /** + * @param value {@link #modalityList} (A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).) + */ + public boolean hasModalityList(ImagingModality value) { + if (this.modalityList == null) + return false; + for (Enumeration v : this.modalityList) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #referrer} (The requesting/referring physician.) + */ + public Reference getReferrer() { + if (this.referrer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.referrer"); + else if (Configuration.doAutoCreate()) + this.referrer = new Reference(); + return this.referrer; + } + + public boolean hasReferrer() { + return this.referrer != null && !this.referrer.isEmpty(); + } + + /** + * @param value {@link #referrer} (The requesting/referring physician.) + */ + public ImagingStudy setReferrer(Reference value) { + this.referrer = value; + return this; + } + + /** + * @return {@link #referrer} 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 requesting/referring physician.) + */ + public Practitioner getReferrerTarget() { + if (this.referrerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.referrer"); + else if (Configuration.doAutoCreate()) + this.referrerTarget = new Practitioner(); + return this.referrerTarget; + } + + /** + * @param value {@link #referrer} 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 requesting/referring physician.) + */ + public ImagingStudy setReferrerTarget(Practitioner value) { + this.referrerTarget = value; + return this; + } + + /** + * @return {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public Enumeration getAvailabilityElement() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Enumeration(); + return this.availability; + } + + public boolean hasAvailabilityElement() { + return this.availability != null && !this.availability.isEmpty(); + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value + */ + public ImagingStudy setAvailabilityElement(Enumeration value) { + this.availability = value; + return this; + } + + /** + * @return Availability of study (online, offline or nearline). + */ + public InstanceAvailability getAvailability() { + return this.availability == null ? null : this.availability.getValue(); + } + + /** + * @param value Availability of study (online, offline or nearline). + */ + public ImagingStudy setAvailability(InstanceAvailability value) { + if (value == null) + this.availability = null; + else { + if (this.availability == null) + this.availability = new Enumeration(InstanceAvailability.ENUM_FACTORY); + this.availability.setValue(value); + } + return this; + } + + /** + * @return {@link #url} (WADO-RS URI where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (WADO-RS URI where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public ImagingStudy setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return WADO-RS URI where Study is available. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value WADO-RS URI where Study is available. + */ + public ImagingStudy setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value + */ + public IntegerType getNumberOfSeriesElement() { + if (this.numberOfSeries == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries"); + else if (Configuration.doAutoCreate()) + this.numberOfSeries = new IntegerType(); + return this.numberOfSeries; + } + + public boolean hasNumberOfSeriesElement() { + return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); + } + + public boolean hasNumberOfSeries() { + return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); + } + + /** + * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value + */ + public ImagingStudy setNumberOfSeriesElement(IntegerType value) { + this.numberOfSeries = value; + return this; + } + + /** + * @return Number of Series in Study. + */ + public int getNumberOfSeries() { + return this.numberOfSeries == null ? null : this.numberOfSeries.getValue(); + } + + /** + * @param value Number of Series in Study. + */ + public ImagingStudy setNumberOfSeries(int value) { + if (this.numberOfSeries == null) + this.numberOfSeries = new IntegerType(); + this.numberOfSeries.setValue(value); + return this; + } + + /** + * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public IntegerType getNumberOfInstancesElement() { + if (this.numberOfInstances == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances"); + else if (Configuration.doAutoCreate()) + this.numberOfInstances = new IntegerType(); + return this.numberOfInstances; + } + + public boolean hasNumberOfInstancesElement() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + public boolean hasNumberOfInstances() { + return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); + } + + /** + * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value + */ + public ImagingStudy setNumberOfInstancesElement(IntegerType value) { + this.numberOfInstances = value; + return this; + } + + /** + * @return Number of SOP Instances in Study. + */ + public int getNumberOfInstances() { + return this.numberOfInstances == null ? null : this.numberOfInstances.getValue(); + } + + /** + * @param value Number of SOP Instances in Study. + */ + public ImagingStudy setNumberOfInstances(int value) { + if (this.numberOfInstances == null) + this.numberOfInstances = new IntegerType(); + this.numberOfInstances.setValue(value); + return this; + } + + /** + * @return {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value + */ + public StringType getClinicalInformationElement() { + if (this.clinicalInformation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.clinicalInformation"); + else if (Configuration.doAutoCreate()) + this.clinicalInformation = new StringType(); + return this.clinicalInformation; + } + + public boolean hasClinicalInformationElement() { + return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); + } + + public boolean hasClinicalInformation() { + return this.clinicalInformation != null && !this.clinicalInformation.isEmpty(); + } + + /** + * @param value {@link #clinicalInformation} (Diagnoses etc provided with request.). This is the underlying object with id, value and extensions. The accessor "getClinicalInformation" gives direct access to the value + */ + public ImagingStudy setClinicalInformationElement(StringType value) { + this.clinicalInformation = value; + return this; + } + + /** + * @return Diagnoses etc provided with request. + */ + public String getClinicalInformation() { + return this.clinicalInformation == null ? null : this.clinicalInformation.getValue(); + } + + /** + * @param value Diagnoses etc provided with request. + */ + public ImagingStudy setClinicalInformation(String value) { + if (Utilities.noString(value)) + this.clinicalInformation = null; + else { + if (this.clinicalInformation == null) + this.clinicalInformation = new StringType(); + this.clinicalInformation.setValue(value); + } + return this; + } + + /** + * @return {@link #procedure} (Type of procedure performed.) + */ + public List getProcedure() { + if (this.procedure == null) + this.procedure = new ArrayList(); + return this.procedure; + } + + public boolean hasProcedure() { + if (this.procedure == null) + return false; + for (Coding item : this.procedure) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #procedure} (Type of procedure performed.) + */ + // syntactic sugar + public Coding addProcedure() { //3 + Coding t = new Coding(); + if (this.procedure == null) + this.procedure = new ArrayList(); + this.procedure.add(t); + return t; + } + + /** + * @return {@link #interpreter} (Who read study and interpreted the images.) + */ + public Reference getInterpreter() { + if (this.interpreter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.interpreter"); + else if (Configuration.doAutoCreate()) + this.interpreter = new Reference(); + return this.interpreter; + } + + public boolean hasInterpreter() { + return this.interpreter != null && !this.interpreter.isEmpty(); + } + + /** + * @param value {@link #interpreter} (Who read study and interpreted the images.) + */ + public ImagingStudy setInterpreter(Reference value) { + this.interpreter = value; + return this; + } + + /** + * @return {@link #interpreter} 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. (Who read study and interpreted the images.) + */ + public Practitioner getInterpreterTarget() { + if (this.interpreterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImagingStudy.interpreter"); + else if (Configuration.doAutoCreate()) + this.interpreterTarget = new Practitioner(); + return this.interpreterTarget; + } + + /** + * @param value {@link #interpreter} 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. (Who read study and interpreted the images.) + */ + public ImagingStudy setInterpreterTarget(Practitioner value) { + this.interpreterTarget = value; + return this; + } + + /** + * @return {@link #description} (Institution-generated description or classification of the Study (component) performed.). 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 ImagingStudy.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} (Institution-generated description or classification of the Study (component) performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImagingStudy setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Institution-generated description or classification of the Study (component) performed. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Institution-generated description or classification of the Study (component) performed. + */ + public ImagingStudy setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #series} (Each study has one or more series of image instances.) + */ + public List getSeries() { + if (this.series == null) + this.series = new ArrayList(); + return this.series; + } + + public boolean hasSeries() { + if (this.series == null) + return false; + for (ImagingStudySeriesComponent item : this.series) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #series} (Each study has one or more series of image instances.) + */ + // syntactic sugar + public ImagingStudySeriesComponent addSeries() { //3 + ImagingStudySeriesComponent t = new ImagingStudySeriesComponent(); + if (this.series == null) + this.series = new ArrayList(); + this.series.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("started", "dateTime", "Date and Time the study started.", 0, java.lang.Integer.MAX_VALUE, started)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient for whom the images are of.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid)); + childrenList.add(new Property("accession", "Identifier", "Accession Number.", 0, java.lang.Integer.MAX_VALUE, accession)); + childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order)); + childrenList.add(new Property("modalityList", "code", "A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).", 0, java.lang.Integer.MAX_VALUE, modalityList)); + childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer)); + childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("url", "uri", "WADO-RS URI where Study is available.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("numberOfSeries", "integer", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries)); + childrenList.add(new Property("numberOfInstances", "integer", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); + childrenList.add(new Property("clinicalInformation", "string", "Diagnoses etc provided with request.", 0, java.lang.Integer.MAX_VALUE, clinicalInformation)); + childrenList.add(new Property("procedure", "Coding", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read study and interpreted the images.", 0, java.lang.Integer.MAX_VALUE, interpreter)); + childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study (component) performed.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("series", "", "Each study has one or more series of image instances.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + public ImagingStudy copy() { + ImagingStudy dst = new ImagingStudy(); + copyValues(dst); + dst.started = started == null ? null : started.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.uid = uid == null ? null : uid.copy(); + dst.accession = accession == null ? null : accession.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (order != null) { + dst.order = new ArrayList(); + for (Reference i : order) + dst.order.add(i.copy()); + }; + if (modalityList != null) { + dst.modalityList = new ArrayList>(); + for (Enumeration i : modalityList) + dst.modalityList.add(i.copy()); + }; + dst.referrer = referrer == null ? null : referrer.copy(); + dst.availability = availability == null ? null : availability.copy(); + dst.url = url == null ? null : url.copy(); + dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy(); + dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); + dst.clinicalInformation = clinicalInformation == null ? null : clinicalInformation.copy(); + if (procedure != null) { + dst.procedure = new ArrayList(); + for (Coding i : procedure) + dst.procedure.add(i.copy()); + }; + dst.interpreter = interpreter == null ? null : interpreter.copy(); + dst.description = description == null ? null : description.copy(); + if (series != null) { + dst.series = new ArrayList(); + for (ImagingStudySeriesComponent i : series) + dst.series.add(i.copy()); + }; + return dst; + } + + protected ImagingStudy typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (started == null || started.isEmpty()) && (patient == null || patient.isEmpty()) + && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (order == null || order.isEmpty()) && (modalityList == null || modalityList.isEmpty()) + && (referrer == null || referrer.isEmpty()) && (availability == null || availability.isEmpty()) + && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty()) + && (numberOfInstances == null || numberOfInstances.isEmpty()) && (clinicalInformation == null || clinicalInformation.isEmpty()) + && (procedure == null || procedure.isEmpty()) && (interpreter == null || interpreter.isEmpty()) + && (description == null || description.isEmpty()) && (series == null || series.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImagingStudy; + } + + @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="Formal identifier for this instance (0008,0018)", type="token" ) + public static final String SP_UID = "uid"; + @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The series id for the image", type="token" ) + public static final String SP_SERIES = "series"; + @SearchParamDefinition(name="patient", path="ImagingStudy.patient", description="Who the study is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="Body part examined (Map from 0018,0015)", type="token" ) + public static final String SP_BODYSITE = "bodysite"; + @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession id for the image", type="token" ) + public static final String SP_ACCESSION = "accession"; + @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study id for the image", type="token" ) + public static final String SP_STUDY = "study"; + @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the image", type="token" ) + public static final String SP_MODALITY = "modality"; + @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" ) + public static final String SP_STARTED = "started"; + @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopclass", description="DICOM class type (0008,0016)", type="token" ) + public static final String SP_DICOMCLASS = "dicom-class"; + @SearchParamDefinition(name="size", path="", description="The size of the image in MB - may include > or < in the value", type="number" ) + public static final String SP_SIZE = "size"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java index 9a71864f341..61a488bb7be 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java @@ -20,1721 +20,1721 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Immunization event information. - */ -@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/Profile/Immunization") -public class Immunization extends DomainResource { - - @Block() - public static class ImmunizationExplanationComponent extends BackboneElement { - /** - * Reasons why a vaccine was administered. - */ - @Child(name="reason", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why a vaccine was administered." ) - protected List reason; - - /** - * Refusal or exemption reasons. - */ - @Child(name="refusalReason", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Why immunization did not occur", formalDefinition="Refusal or exemption reasons." ) - protected List refusalReason; - - private static final long serialVersionUID = 1023767180L; - - public ImmunizationExplanationComponent() { - super(); - } - - /** - * @return {@link #reason} (Reasons why a vaccine was administered.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Reasons why a vaccine was administered.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - /** - * @return {@link #refusalReason} (Refusal or exemption reasons.) - */ - public List getRefusalReason() { - if (this.refusalReason == null) - this.refusalReason = new ArrayList(); - return this.refusalReason; - } - - public boolean hasRefusalReason() { - if (this.refusalReason == null) - return false; - for (CodeableConcept item : this.refusalReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #refusalReason} (Refusal or exemption reasons.) - */ - // syntactic sugar - public CodeableConcept addRefusalReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.refusalReason == null) - this.refusalReason = new ArrayList(); - this.refusalReason.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("reason", "CodeableConcept", "Reasons why a vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("refusalReason", "CodeableConcept", "Refusal or exemption reasons.", 0, java.lang.Integer.MAX_VALUE, refusalReason)); - } - - public ImmunizationExplanationComponent copy() { - ImmunizationExplanationComponent dst = new ImmunizationExplanationComponent(); - copyValues(dst); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (refusalReason != null) { - dst.refusalReason = new ArrayList(); - for (CodeableConcept i : refusalReason) - dst.refusalReason.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (reason == null || reason.isEmpty()) && (refusalReason == null || refusalReason.isEmpty()) - ; - } - - } - - @Block() - public static class ImmunizationReactionComponent extends BackboneElement { - /** - * Date of reaction to the immunization. - */ - @Child(name="date", type={DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When did reaction start?", formalDefinition="Date of reaction to the immunization." ) - protected DateTimeType date; - - /** - * Details of the reaction. - */ - @Child(name="detail", type={Observation.class}, order=2, min=0, max=1) - @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." ) - protected Reference detail; - - /** - * The actual object that is the target of the reference (Details of the reaction.) - */ - protected Observation detailTarget; - - /** - * Self-reported indicator. - */ - @Child(name="reported", type={BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Was reaction self-reported?", formalDefinition="Self-reported indicator." ) - protected BooleanType reported; - - private static final long serialVersionUID = -1297668556L; - - public ImmunizationReactionComponent() { - super(); - } - - /** - * @return {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImmunizationReactionComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date of reaction to the immunization. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date of reaction to the immunization. - */ - public ImmunizationReactionComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #detail} (Details of the reaction.) - */ - public Reference getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new Reference(); - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (Details of the reaction.) - */ - public ImmunizationReactionComponent setDetail(Reference value) { - this.detail = value; - return this; - } - - /** - * @return {@link #detail} 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. (Details of the reaction.) - */ - public Observation getDetailTarget() { - if (this.detailTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detailTarget = new Observation(); - return this.detailTarget; - } - - /** - * @param value {@link #detail} 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. (Details of the reaction.) - */ - public ImmunizationReactionComponent setDetailTarget(Observation value) { - this.detailTarget = value; - return this; - } - - /** - * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public BooleanType getReportedElement() { - if (this.reported == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported"); - else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); - return this.reported; - } - - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); - } - - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); - } - - /** - * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public ImmunizationReactionComponent setReportedElement(BooleanType value) { - this.reported = value; - return this; - } - - /** - * @return Self-reported indicator. - */ - public boolean getReported() { - return this.reported == null ? false : this.reported.getValue(); - } - - /** - * @param value Self-reported indicator. - */ - public ImmunizationReactionComponent setReported(boolean value) { - if (value == false) - this.reported = null; - else { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("reported", "boolean", "Self-reported indicator.", 0, java.lang.Integer.MAX_VALUE, reported)); - } - - public ImmunizationReactionComponent copy() { - ImmunizationReactionComponent dst = new ImmunizationReactionComponent(); - copyValues(dst); - dst.date = date == null ? null : date.copy(); - dst.detail = detail == null ? null : detail.copy(); - dst.reported = reported == null ? null : reported.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (date == null || date.isEmpty()) && (detail == null || detail.isEmpty()) - && (reported == null || reported.isEmpty()); - } - - } - - @Block() - public static class ImmunizationVaccinationProtocolComponent extends BackboneElement { - /** - * Nominal position in a series. - */ - @Child(name="doseSequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="What dose number within series?", formalDefinition="Nominal position in a series." ) - protected IntegerType doseSequence; - - /** - * Contains the description about the protocol under which the vaccine was administered. - */ - @Child(name="description", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Details of vaccine protocol", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) - protected StringType description; - - /** - * Indicates the authority who published the protocol? E.g. ACIP. - */ - @Child(name="authority", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) - */ - protected Organization authorityTarget; - - /** - * One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - @Child(name="series", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) - protected StringType series; - - /** - * The recommended number of doses to achieve immunity. - */ - @Child(name="seriesDoses", type={IntegerType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." ) - protected IntegerType seriesDoses; - - /** - * The targeted disease. - */ - @Child(name="doseTarget", type={CodeableConcept.class}, order=6, min=1, max=1) - @Description(shortDefinition="Disease immunized against", formalDefinition="The targeted disease." ) - protected CodeableConcept doseTarget; - - /** - * Indicates if the immunization event should "count" against the protocol. - */ - @Child(name="doseStatus", type={CodeableConcept.class}, order=7, min=1, max=1) - @Description(shortDefinition="Does dose count towards immunity?", formalDefinition="Indicates if the immunization event should 'count' against the protocol." ) - protected CodeableConcept doseStatus; - - /** - * Provides an explanation as to why a immunization event should or should not count against the protocol. - */ - @Child(name="doseStatusReason", type={CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Why does does count/not count?", formalDefinition="Provides an explanation as to why a immunization event should or should not count against the protocol." ) - protected CodeableConcept doseStatusReason; - - private static final long serialVersionUID = 747305824L; - - public ImmunizationVaccinationProtocolComponent() { - super(); - } - - public ImmunizationVaccinationProtocolComponent(IntegerType doseSequence, CodeableConcept doseTarget, CodeableConcept doseStatus) { - super(); - this.doseSequence = doseSequence; - this.doseTarget = doseTarget; - this.doseStatus = doseStatus; - } - - /** - * @return {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public IntegerType getDoseSequenceElement() { - if (this.doseSequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseSequence"); - else if (Configuration.doAutoCreate()) - this.doseSequence = new IntegerType(); - return this.doseSequence; - } - - public boolean hasDoseSequenceElement() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - public boolean hasDoseSequence() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - /** - * @param value {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setDoseSequenceElement(IntegerType value) { - this.doseSequence = value; - return this; - } - - /** - * @return Nominal position in a series. - */ - public int getDoseSequence() { - return this.doseSequence == null ? null : this.doseSequence.getValue(); - } - - /** - * @param value Nominal position in a series. - */ - public ImmunizationVaccinationProtocolComponent setDoseSequence(int value) { - if (this.doseSequence == null) - this.doseSequence = new IntegerType(); - this.doseSequence.setValue(value); - return this; - } - - /** - * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). 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 ImmunizationVaccinationProtocolComponent.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} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Contains the description about the protocol under which the vaccine was administered. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Contains the description about the protocol under which the vaccine was administered. - */ - public ImmunizationVaccinationProtocolComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationVaccinationProtocolComponent setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Organization getAuthorityTarget() { - if (this.authorityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authorityTarget = new Organization(); - return this.authorityTarget; - } - - /** - * @param value {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationVaccinationProtocolComponent setAuthorityTarget(Organization value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public StringType getSeriesElement() { - if (this.series == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.series"); - else if (Configuration.doAutoCreate()) - this.series = new StringType(); - return this.series; - } - - public boolean hasSeriesElement() { - return this.series != null && !this.series.isEmpty(); - } - - public boolean hasSeries() { - return this.series != null && !this.series.isEmpty(); - } - - /** - * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setSeriesElement(StringType value) { - this.series = value; - return this; - } - - /** - * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public String getSeries() { - return this.series == null ? null : this.series.getValue(); - } - - /** - * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public ImmunizationVaccinationProtocolComponent setSeries(String value) { - if (Utilities.noString(value)) - this.series = null; - else { - if (this.series == null) - this.series = new StringType(); - this.series.setValue(value); - } - return this; - } - - /** - * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value - */ - public IntegerType getSeriesDosesElement() { - if (this.seriesDoses == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.seriesDoses"); - else if (Configuration.doAutoCreate()) - this.seriesDoses = new IntegerType(); - return this.seriesDoses; - } - - public boolean hasSeriesDosesElement() { - return this.seriesDoses != null && !this.seriesDoses.isEmpty(); - } - - public boolean hasSeriesDoses() { - return this.seriesDoses != null && !this.seriesDoses.isEmpty(); - } - - /** - * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setSeriesDosesElement(IntegerType value) { - this.seriesDoses = value; - return this; - } - - /** - * @return The recommended number of doses to achieve immunity. - */ - public int getSeriesDoses() { - return this.seriesDoses == null ? null : this.seriesDoses.getValue(); - } - - /** - * @param value The recommended number of doses to achieve immunity. - */ - public ImmunizationVaccinationProtocolComponent setSeriesDoses(int value) { - if (value == -1) - this.seriesDoses = null; - else { - if (this.seriesDoses == null) - this.seriesDoses = new IntegerType(); - this.seriesDoses.setValue(value); - } - return this; - } - - /** - * @return {@link #doseTarget} (The targeted disease.) - */ - public CodeableConcept getDoseTarget() { - if (this.doseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseTarget"); - else if (Configuration.doAutoCreate()) - this.doseTarget = new CodeableConcept(); - return this.doseTarget; - } - - public boolean hasDoseTarget() { - return this.doseTarget != null && !this.doseTarget.isEmpty(); - } - - /** - * @param value {@link #doseTarget} (The targeted disease.) - */ - public ImmunizationVaccinationProtocolComponent setDoseTarget(CodeableConcept value) { - this.doseTarget = value; - return this; - } - - /** - * @return {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) - */ - public CodeableConcept getDoseStatus() { - if (this.doseStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatus"); - else if (Configuration.doAutoCreate()) - this.doseStatus = new CodeableConcept(); - return this.doseStatus; - } - - public boolean hasDoseStatus() { - return this.doseStatus != null && !this.doseStatus.isEmpty(); - } - - /** - * @param value {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) - */ - public ImmunizationVaccinationProtocolComponent setDoseStatus(CodeableConcept value) { - this.doseStatus = value; - return this; - } - - /** - * @return {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) - */ - public CodeableConcept getDoseStatusReason() { - if (this.doseStatusReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatusReason"); - else if (Configuration.doAutoCreate()) - this.doseStatusReason = new CodeableConcept(); - return this.doseStatusReason; - } - - public boolean hasDoseStatusReason() { - return this.doseStatusReason != null && !this.doseStatusReason.isEmpty(); - } - - /** - * @param value {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) - */ - public ImmunizationVaccinationProtocolComponent setDoseStatusReason(CodeableConcept value) { - this.doseStatusReason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("doseSequence", "integer", "Nominal position in a series.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); - childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); - childrenList.add(new Property("seriesDoses", "integer", "The recommended number of doses to achieve immunity.", 0, java.lang.Integer.MAX_VALUE, seriesDoses)); - childrenList.add(new Property("doseTarget", "CodeableConcept", "The targeted disease.", 0, java.lang.Integer.MAX_VALUE, doseTarget)); - childrenList.add(new Property("doseStatus", "CodeableConcept", "Indicates if the immunization event should 'count' against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatus)); - childrenList.add(new Property("doseStatusReason", "CodeableConcept", "Provides an explanation as to why a immunization event should or should not count against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatusReason)); - } - - public ImmunizationVaccinationProtocolComponent copy() { - ImmunizationVaccinationProtocolComponent dst = new ImmunizationVaccinationProtocolComponent(); - copyValues(dst); - dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); - dst.description = description == null ? null : description.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.series = series == null ? null : series.copy(); - dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy(); - dst.doseTarget = doseTarget == null ? null : doseTarget.copy(); - dst.doseStatus = doseStatus == null ? null : doseStatus.copy(); - dst.doseStatusReason = doseStatusReason == null ? null : doseStatusReason.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) - && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()) && (seriesDoses == null || seriesDoses.isEmpty()) - && (doseTarget == null || doseTarget.isEmpty()) && (doseStatus == null || doseStatus.isEmpty()) - && (doseStatusReason == null || doseStatusReason.isEmpty()); - } - - } - - /** - * A unique identifier assigned to this adverse reaction record. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this adverse reaction record." ) - protected List identifier; - - /** - * Date vaccine administered or was to be administered. - */ - @Child(name="date", type={DateTimeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Vaccination administration date", formalDefinition="Date vaccine administered or was to be administered." ) - protected DateTimeType date; - - /** - * Vaccine that was administered or was to be administered. - */ - @Child(name="vaccineType", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." ) - protected CodeableConcept vaccineType; - - /** - * The patient to whom the vaccine was to be administered. - */ - @Child(name="subject", type={Patient.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who was immunized?", formalDefinition="The patient to whom the vaccine was to be administered." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient to whom the vaccine was to be administered.) - */ - protected Patient subjectTarget; - - /** - * Indicates if the vaccination was refused. - */ - @Child(name="refusedIndicator", type={BooleanType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Was immunization refused?", formalDefinition="Indicates if the vaccination was refused." ) - protected BooleanType refusedIndicator; - - /** - * True if this administration was reported rather than directly administered. - */ - @Child(name="reported", type={BooleanType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Is this a self-reported record?", formalDefinition="True if this administration was reported rather than directly administered." ) - protected BooleanType reported; - - /** - * Clinician who administered the vaccine. - */ - @Child(name="performer", type={Practitioner.class}, order=5, min=0, max=1) - @Description(shortDefinition="Who administered vaccine?", formalDefinition="Clinician who administered the vaccine." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (Clinician who administered the vaccine.) - */ - protected Practitioner performerTarget; - - /** - * Clinician who ordered the vaccination. - */ - @Child(name="requester", type={Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Who ordered vaccination?", formalDefinition="Clinician who ordered the vaccination." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (Clinician who ordered the vaccination.) - */ - protected Practitioner requesterTarget; - - /** - * Name of vaccine manufacturer. - */ - @Child(name="manufacturer", type={Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) - protected Reference manufacturer; - - /** - * The actual object that is the target of the reference (Name of vaccine manufacturer.) - */ - protected Organization manufacturerTarget; - - /** - * The service delivery location where the vaccine administration occurred. - */ - @Child(name="location", type={Location.class}, order=8, min=0, max=1) - @Description(shortDefinition="Where did vaccination occur?", formalDefinition="The service delivery location where the vaccine administration occurred." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.) - */ - protected Location locationTarget; - - /** - * Lot number of the vaccine product. - */ - @Child(name="lotNumber", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) - protected StringType lotNumber; - - /** - * Date vaccine batch expires. - */ - @Child(name="expirationDate", type={DateType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) - protected DateType expirationDate; - - /** - * Body site where vaccine was administered. - */ - @Child(name="site", type={CodeableConcept.class}, order=11, min=0, max=1) - @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) - protected CodeableConcept site; - - /** - * The path by which the vaccine product is taken into the body. - */ - @Child(name="route", type={CodeableConcept.class}, order=12, min=0, max=1) - @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) - protected CodeableConcept route; - - /** - * The quantity of vaccine product that was administered. - */ - @Child(name="doseQuantity", type={Quantity.class}, order=13, min=0, max=1) - @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) - protected Quantity doseQuantity; - - /** - * Reasons why a vaccine was administered or refused. - */ - @Child(name="explanation", type={}, order=14, min=0, max=1) - @Description(shortDefinition="Administration / refusal reasons", formalDefinition="Reasons why a vaccine was administered or refused." ) - protected ImmunizationExplanationComponent explanation; - - /** - * Categorical data indicating that an adverse event is associated in time to an immunization. - */ - @Child(name="reaction", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) - protected List reaction; - - /** - * Contains information about the protocol(s) under which the vaccine was administered. - */ - @Child(name="vaccinationProtocol", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) - protected List vaccinationProtocol; - - private static final long serialVersionUID = -1398570384L; - - public Immunization() { - super(); - } - - public Immunization(DateTimeType date, CodeableConcept vaccineType, Reference subject, BooleanType refusedIndicator, BooleanType reported) { - super(); - this.date = date; - this.vaccineType = vaccineType; - this.subject = subject; - this.refusedIndicator = refusedIndicator; - this.reported = reported; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this adverse reaction record.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (A unique identifier assigned to this adverse reaction record.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Immunization setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date vaccine administered or was to be administered. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date vaccine administered or was to be administered. - */ - public Immunization setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #vaccineType} (Vaccine that was administered or was to be administered.) - */ - public CodeableConcept getVaccineType() { - if (this.vaccineType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.vaccineType"); - else if (Configuration.doAutoCreate()) - this.vaccineType = new CodeableConcept(); - return this.vaccineType; - } - - public boolean hasVaccineType() { - return this.vaccineType != null && !this.vaccineType.isEmpty(); - } - - /** - * @param value {@link #vaccineType} (Vaccine that was administered or was to be administered.) - */ - public Immunization setVaccineType(CodeableConcept value) { - this.vaccineType = value; - return this; - } - - /** - * @return {@link #subject} (The patient to whom the vaccine was to be administered.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.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 to whom the vaccine was to be administered.) - */ - public Immunization 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 to whom the vaccine was to be administered.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.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 to whom the vaccine was to be administered.) - */ - public Immunization setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #refusedIndicator} (Indicates if the vaccination was refused.). This is the underlying object with id, value and extensions. The accessor "getRefusedIndicator" gives direct access to the value - */ - public BooleanType getRefusedIndicatorElement() { - if (this.refusedIndicator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.refusedIndicator"); - else if (Configuration.doAutoCreate()) - this.refusedIndicator = new BooleanType(); - return this.refusedIndicator; - } - - public boolean hasRefusedIndicatorElement() { - return this.refusedIndicator != null && !this.refusedIndicator.isEmpty(); - } - - public boolean hasRefusedIndicator() { - return this.refusedIndicator != null && !this.refusedIndicator.isEmpty(); - } - - /** - * @param value {@link #refusedIndicator} (Indicates if the vaccination was refused.). This is the underlying object with id, value and extensions. The accessor "getRefusedIndicator" gives direct access to the value - */ - public Immunization setRefusedIndicatorElement(BooleanType value) { - this.refusedIndicator = value; - return this; - } - - /** - * @return Indicates if the vaccination was refused. - */ - public boolean getRefusedIndicator() { - return this.refusedIndicator == null ? false : this.refusedIndicator.getValue(); - } - - /** - * @param value Indicates if the vaccination was refused. - */ - public Immunization setRefusedIndicator(boolean value) { - if (this.refusedIndicator == null) - this.refusedIndicator = new BooleanType(); - this.refusedIndicator.setValue(value); - return this; - } - - /** - * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public BooleanType getReportedElement() { - if (this.reported == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.reported"); - else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); - return this.reported; - } - - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); - } - - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); - } - - /** - * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public Immunization setReportedElement(BooleanType value) { - this.reported = value; - return this; - } - - /** - * @return True if this administration was reported rather than directly administered. - */ - public boolean getReported() { - return this.reported == null ? false : this.reported.getValue(); - } - - /** - * @param value True if this administration was reported rather than directly administered. - */ - public Immunization setReported(boolean value) { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); - return this; - } - - /** - * @return {@link #performer} (Clinician who administered the vaccine.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (Clinician who administered the vaccine.) - */ - public Immunization setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} 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. (Clinician who administered the vaccine.) - */ - public Practitioner getPerformerTarget() { - if (this.performerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.performer"); - else if (Configuration.doAutoCreate()) - this.performerTarget = new Practitioner(); - return this.performerTarget; - } - - /** - * @param value {@link #performer} 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. (Clinician who administered the vaccine.) - */ - public Immunization setPerformerTarget(Practitioner value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #requester} (Clinician who ordered the vaccination.) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (Clinician who ordered the vaccination.) - */ - public Immunization setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} 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. (Clinician who ordered the vaccination.) - */ - public Practitioner getRequesterTarget() { - if (this.requesterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.requester"); - else if (Configuration.doAutoCreate()) - this.requesterTarget = new Practitioner(); - return this.requesterTarget; - } - - /** - * @param value {@link #requester} 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. (Clinician who ordered the vaccination.) - */ - public Immunization setRequesterTarget(Practitioner value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #manufacturer} (Name of vaccine manufacturer.) - */ - public Reference getManufacturer() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new Reference(); - return this.manufacturer; - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (Name of vaccine manufacturer.) - */ - public Immunization setManufacturer(Reference value) { - this.manufacturer = value; - return this; - } - - /** - * @return {@link #manufacturer} 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. (Name of vaccine manufacturer.) - */ - public Organization getManufacturerTarget() { - if (this.manufacturerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturerTarget = new Organization(); - return this.manufacturerTarget; - } - - /** - * @param value {@link #manufacturer} 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. (Name of vaccine manufacturer.) - */ - public Immunization setManufacturerTarget(Organization value) { - this.manufacturerTarget = value; - return this; - } - - /** - * @return {@link #location} (The service delivery location where the vaccine administration occurred.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The service delivery location where the vaccine administration occurred.) - */ - public Immunization setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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 service delivery location where the vaccine administration occurred.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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 service delivery location where the vaccine administration occurred.) - */ - public Immunization setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public Immunization setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return Lot number of the vaccine product. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value Lot number of the vaccine product. - */ - public Immunization setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public DateType getExpirationDateElement() { - if (this.expirationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.expirationDate"); - else if (Configuration.doAutoCreate()) - this.expirationDate = new DateType(); - return this.expirationDate; - } - - public boolean hasExpirationDateElement() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - public boolean hasExpirationDate() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - /** - * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public Immunization setExpirationDateElement(DateType value) { - this.expirationDate = value; - return this; - } - - /** - * @return Date vaccine batch expires. - */ - public Date getExpirationDate() { - return this.expirationDate == null ? null : this.expirationDate.getValue(); - } - - /** - * @param value Date vaccine batch expires. - */ - public Immunization setExpirationDate(Date value) { - if (value == null) - this.expirationDate = null; - else { - if (this.expirationDate == null) - this.expirationDate = new DateType(); - this.expirationDate.setValue(value); - } - return this; - } - - /** - * @return {@link #site} (Body site where vaccine was administered.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Body site where vaccine was administered.) - */ - public Immunization setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (The path by which the vaccine product is taken into the body.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (The path by which the vaccine product is taken into the body.) - */ - public Immunization setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.) - */ - public Quantity getDoseQuantity() { - if (this.doseQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.doseQuantity"); - else if (Configuration.doAutoCreate()) - this.doseQuantity = new Quantity(); - return this.doseQuantity; - } - - public boolean hasDoseQuantity() { - return this.doseQuantity != null && !this.doseQuantity.isEmpty(); - } - - /** - * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.) - */ - public Immunization setDoseQuantity(Quantity value) { - this.doseQuantity = value; - return this; - } - - /** - * @return {@link #explanation} (Reasons why a vaccine was administered or refused.) - */ - public ImmunizationExplanationComponent getExplanation() { - if (this.explanation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.explanation"); - else if (Configuration.doAutoCreate()) - this.explanation = new ImmunizationExplanationComponent(); - return this.explanation; - } - - public boolean hasExplanation() { - return this.explanation != null && !this.explanation.isEmpty(); - } - - /** - * @param value {@link #explanation} (Reasons why a vaccine was administered or refused.) - */ - public Immunization setExplanation(ImmunizationExplanationComponent value) { - this.explanation = value; - return this; - } - - /** - * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) - */ - public List getReaction() { - if (this.reaction == null) - this.reaction = new ArrayList(); - return this.reaction; - } - - public boolean hasReaction() { - if (this.reaction == null) - return false; - for (ImmunizationReactionComponent item : this.reaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) - */ - // syntactic sugar - public ImmunizationReactionComponent addReaction() { //3 - ImmunizationReactionComponent t = new ImmunizationReactionComponent(); - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return t; - } - - /** - * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) - */ - public List getVaccinationProtocol() { - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - return this.vaccinationProtocol; - } - - public boolean hasVaccinationProtocol() { - if (this.vaccinationProtocol == null) - return false; - for (ImmunizationVaccinationProtocolComponent item : this.vaccinationProtocol) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) - */ - // syntactic sugar - public ImmunizationVaccinationProtocolComponent addVaccinationProtocol() { //3 - ImmunizationVaccinationProtocolComponent t = new ImmunizationVaccinationProtocolComponent(); - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - this.vaccinationProtocol.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this adverse reaction record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "Date vaccine administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient to whom the vaccine was to be administered.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("refusedIndicator", "boolean", "Indicates if the vaccination was refused.", 0, java.lang.Integer.MAX_VALUE, refusedIndicator)); - childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); - childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("lotNumber", "string", "Lot number of the vaccine product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); - childrenList.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("doseQuantity", "Quantity", "The quantity of vaccine product that was administered.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); - childrenList.add(new Property("explanation", "", "Reasons why a vaccine was administered or refused.", 0, java.lang.Integer.MAX_VALUE, explanation)); - childrenList.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction)); - childrenList.add(new Property("vaccinationProtocol", "", "Contains information about the protocol(s) under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, vaccinationProtocol)); - } - - public Immunization copy() { - Immunization dst = new Immunization(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.refusedIndicator = refusedIndicator == null ? null : refusedIndicator.copy(); - dst.reported = reported == null ? null : reported.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.requester = requester == null ? null : requester.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.location = location == null ? null : location.copy(); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); - dst.explanation = explanation == null ? null : explanation.copy(); - if (reaction != null) { - dst.reaction = new ArrayList(); - for (ImmunizationReactionComponent i : reaction) - dst.reaction.add(i.copy()); - }; - if (vaccinationProtocol != null) { - dst.vaccinationProtocol = new ArrayList(); - for (ImmunizationVaccinationProtocolComponent i : vaccinationProtocol) - dst.vaccinationProtocol.add(i.copy()); - }; - return dst; - } - - protected Immunization typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (vaccineType == null || vaccineType.isEmpty()) && (subject == null || subject.isEmpty()) - && (refusedIndicator == null || refusedIndicator.isEmpty()) && (reported == null || reported.isEmpty()) - && (performer == null || performer.isEmpty()) && (requester == null || requester.isEmpty()) - && (manufacturer == null || manufacturer.isEmpty()) && (location == null || location.isEmpty()) - && (lotNumber == null || lotNumber.isEmpty()) && (expirationDate == null || expirationDate.isEmpty()) - && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (doseQuantity == null || doseQuantity.isEmpty()) - && (explanation == null || explanation.isEmpty()) && (reaction == null || reaction.isEmpty()) - && (vaccinationProtocol == null || vaccinationProtocol.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Immunization; - } - - @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) - public static final String SP_REACTION = "reaction"; - @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" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="Why immunization occurred", type="token" ) - public static final String SP_REASON = "reason"; - @SearchParamDefinition(name="subject", path="Immunization.subject", description="The subject of the vaccination event / refusal", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When did reaction start?", type="date" ) - public static final String SP_REACTIONDATE = "reaction-date"; - @SearchParamDefinition(name="date", path="Immunization.date", description="Vaccination Administration / Refusal Date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="patient", path="Immunization.subject", description="The patient for the vaccination event / refusal", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" ) - public static final String SP_LOTNUMBER = "lot-number"; - @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - @SearchParamDefinition(name="performer", path="Immunization.performer", description="The practitioner who administered the vaccination", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="refusal-reason", path="Immunization.explanation.refusalReason", description="Explanation of refusal / exemption", type="token" ) - public static final String SP_REFUSALREASON = "refusal-reason"; - @SearchParamDefinition(name="refused", path="Immunization.refusedIndicator", description="Was immunization refused?", type="token" ) - public static final String SP_REFUSED = "refused"; - @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * Immunization event information. + */ +@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/Profile/Immunization") +public class Immunization extends DomainResource { + + @Block() + public static class ImmunizationExplanationComponent extends BackboneElement { + /** + * Reasons why a vaccine was administered. + */ + @Child(name="reason", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why a vaccine was administered." ) + protected List reason; + + /** + * Refusal or exemption reasons. + */ + @Child(name="refusalReason", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Why immunization did not occur", formalDefinition="Refusal or exemption reasons." ) + protected List refusalReason; + + private static final long serialVersionUID = 1023767180L; + + public ImmunizationExplanationComponent() { + super(); + } + + /** + * @return {@link #reason} (Reasons why a vaccine was administered.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Reasons why a vaccine was administered.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + /** + * @return {@link #refusalReason} (Refusal or exemption reasons.) + */ + public List getRefusalReason() { + if (this.refusalReason == null) + this.refusalReason = new ArrayList(); + return this.refusalReason; + } + + public boolean hasRefusalReason() { + if (this.refusalReason == null) + return false; + for (CodeableConcept item : this.refusalReason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #refusalReason} (Refusal or exemption reasons.) + */ + // syntactic sugar + public CodeableConcept addRefusalReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.refusalReason == null) + this.refusalReason = new ArrayList(); + this.refusalReason.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("reason", "CodeableConcept", "Reasons why a vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("refusalReason", "CodeableConcept", "Refusal or exemption reasons.", 0, java.lang.Integer.MAX_VALUE, refusalReason)); + } + + public ImmunizationExplanationComponent copy() { + ImmunizationExplanationComponent dst = new ImmunizationExplanationComponent(); + copyValues(dst); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (refusalReason != null) { + dst.refusalReason = new ArrayList(); + for (CodeableConcept i : refusalReason) + dst.refusalReason.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (reason == null || reason.isEmpty()) && (refusalReason == null || refusalReason.isEmpty()) + ; + } + + } + + @Block() + public static class ImmunizationReactionComponent extends BackboneElement { + /** + * Date of reaction to the immunization. + */ + @Child(name="date", type={DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When did reaction start?", formalDefinition="Date of reaction to the immunization." ) + protected DateTimeType date; + + /** + * Details of the reaction. + */ + @Child(name="detail", type={Observation.class}, order=2, min=0, max=1) + @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." ) + protected Reference detail; + + /** + * The actual object that is the target of the reference (Details of the reaction.) + */ + protected Observation detailTarget; + + /** + * Self-reported indicator. + */ + @Child(name="reported", type={BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Was reaction self-reported?", formalDefinition="Self-reported indicator." ) + protected BooleanType reported; + + private static final long serialVersionUID = -1297668556L; + + public ImmunizationReactionComponent() { + super(); + } + + /** + * @return {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImmunizationReactionComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date of reaction to the immunization. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date of reaction to the immunization. + */ + public ImmunizationReactionComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (Details of the reaction.) + */ + public Reference getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new Reference(); + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (Details of the reaction.) + */ + public ImmunizationReactionComponent setDetail(Reference value) { + this.detail = value; + return this; + } + + /** + * @return {@link #detail} 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. (Details of the reaction.) + */ + public Observation getDetailTarget() { + if (this.detailTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); + else if (Configuration.doAutoCreate()) + this.detailTarget = new Observation(); + return this.detailTarget; + } + + /** + * @param value {@link #detail} 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. (Details of the reaction.) + */ + public ImmunizationReactionComponent setDetailTarget(Observation value) { + this.detailTarget = value; + return this; + } + + /** + * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public BooleanType getReportedElement() { + if (this.reported == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported"); + else if (Configuration.doAutoCreate()) + this.reported = new BooleanType(); + return this.reported; + } + + public boolean hasReportedElement() { + return this.reported != null && !this.reported.isEmpty(); + } + + public boolean hasReported() { + return this.reported != null && !this.reported.isEmpty(); + } + + /** + * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public ImmunizationReactionComponent setReportedElement(BooleanType value) { + this.reported = value; + return this; + } + + /** + * @return Self-reported indicator. + */ + public boolean getReported() { + return this.reported == null ? false : this.reported.getValue(); + } + + /** + * @param value Self-reported indicator. + */ + public ImmunizationReactionComponent setReported(boolean value) { + if (value == false) + this.reported = null; + else { + if (this.reported == null) + this.reported = new BooleanType(); + this.reported.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("reported", "boolean", "Self-reported indicator.", 0, java.lang.Integer.MAX_VALUE, reported)); + } + + public ImmunizationReactionComponent copy() { + ImmunizationReactionComponent dst = new ImmunizationReactionComponent(); + copyValues(dst); + dst.date = date == null ? null : date.copy(); + dst.detail = detail == null ? null : detail.copy(); + dst.reported = reported == null ? null : reported.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (date == null || date.isEmpty()) && (detail == null || detail.isEmpty()) + && (reported == null || reported.isEmpty()); + } + + } + + @Block() + public static class ImmunizationVaccinationProtocolComponent extends BackboneElement { + /** + * Nominal position in a series. + */ + @Child(name="doseSequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="What dose number within series?", formalDefinition="Nominal position in a series." ) + protected IntegerType doseSequence; + + /** + * Contains the description about the protocol under which the vaccine was administered. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Details of vaccine protocol", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) + protected StringType description; + + /** + * Indicates the authority who published the protocol? E.g. ACIP. + */ + @Child(name="authority", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) + */ + protected Organization authorityTarget; + + /** + * One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + @Child(name="series", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) + protected StringType series; + + /** + * The recommended number of doses to achieve immunity. + */ + @Child(name="seriesDoses", type={IntegerType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." ) + protected IntegerType seriesDoses; + + /** + * The targeted disease. + */ + @Child(name="doseTarget", type={CodeableConcept.class}, order=6, min=1, max=1) + @Description(shortDefinition="Disease immunized against", formalDefinition="The targeted disease." ) + protected CodeableConcept doseTarget; + + /** + * Indicates if the immunization event should "count" against the protocol. + */ + @Child(name="doseStatus", type={CodeableConcept.class}, order=7, min=1, max=1) + @Description(shortDefinition="Does dose count towards immunity?", formalDefinition="Indicates if the immunization event should 'count' against the protocol." ) + protected CodeableConcept doseStatus; + + /** + * Provides an explanation as to why a immunization event should or should not count against the protocol. + */ + @Child(name="doseStatusReason", type={CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Why does does count/not count?", formalDefinition="Provides an explanation as to why a immunization event should or should not count against the protocol." ) + protected CodeableConcept doseStatusReason; + + private static final long serialVersionUID = 747305824L; + + public ImmunizationVaccinationProtocolComponent() { + super(); + } + + public ImmunizationVaccinationProtocolComponent(IntegerType doseSequence, CodeableConcept doseTarget, CodeableConcept doseStatus) { + super(); + this.doseSequence = doseSequence; + this.doseTarget = doseTarget; + this.doseStatus = doseStatus; + } + + /** + * @return {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public IntegerType getDoseSequenceElement() { + if (this.doseSequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseSequence"); + else if (Configuration.doAutoCreate()) + this.doseSequence = new IntegerType(); + return this.doseSequence; + } + + public boolean hasDoseSequenceElement() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + public boolean hasDoseSequence() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + /** + * @param value {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setDoseSequenceElement(IntegerType value) { + this.doseSequence = value; + return this; + } + + /** + * @return Nominal position in a series. + */ + public int getDoseSequence() { + return this.doseSequence == null ? null : this.doseSequence.getValue(); + } + + /** + * @param value Nominal position in a series. + */ + public ImmunizationVaccinationProtocolComponent setDoseSequence(int value) { + if (this.doseSequence == null) + this.doseSequence = new IntegerType(); + this.doseSequence.setValue(value); + return this; + } + + /** + * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). 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 ImmunizationVaccinationProtocolComponent.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} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Contains the description about the protocol under which the vaccine was administered. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Contains the description about the protocol under which the vaccine was administered. + */ + public ImmunizationVaccinationProtocolComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationVaccinationProtocolComponent setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Organization getAuthorityTarget() { + if (this.authorityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authorityTarget = new Organization(); + return this.authorityTarget; + } + + /** + * @param value {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationVaccinationProtocolComponent setAuthorityTarget(Organization value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public StringType getSeriesElement() { + if (this.series == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.series"); + else if (Configuration.doAutoCreate()) + this.series = new StringType(); + return this.series; + } + + public boolean hasSeriesElement() { + return this.series != null && !this.series.isEmpty(); + } + + public boolean hasSeries() { + return this.series != null && !this.series.isEmpty(); + } + + /** + * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setSeriesElement(StringType value) { + this.series = value; + return this; + } + + /** + * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public String getSeries() { + return this.series == null ? null : this.series.getValue(); + } + + /** + * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public ImmunizationVaccinationProtocolComponent setSeries(String value) { + if (Utilities.noString(value)) + this.series = null; + else { + if (this.series == null) + this.series = new StringType(); + this.series.setValue(value); + } + return this; + } + + /** + * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value + */ + public IntegerType getSeriesDosesElement() { + if (this.seriesDoses == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.seriesDoses"); + else if (Configuration.doAutoCreate()) + this.seriesDoses = new IntegerType(); + return this.seriesDoses; + } + + public boolean hasSeriesDosesElement() { + return this.seriesDoses != null && !this.seriesDoses.isEmpty(); + } + + public boolean hasSeriesDoses() { + return this.seriesDoses != null && !this.seriesDoses.isEmpty(); + } + + /** + * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value + */ + public ImmunizationVaccinationProtocolComponent setSeriesDosesElement(IntegerType value) { + this.seriesDoses = value; + return this; + } + + /** + * @return The recommended number of doses to achieve immunity. + */ + public int getSeriesDoses() { + return this.seriesDoses == null ? null : this.seriesDoses.getValue(); + } + + /** + * @param value The recommended number of doses to achieve immunity. + */ + public ImmunizationVaccinationProtocolComponent setSeriesDoses(int value) { + if (value == -1) + this.seriesDoses = null; + else { + if (this.seriesDoses == null) + this.seriesDoses = new IntegerType(); + this.seriesDoses.setValue(value); + } + return this; + } + + /** + * @return {@link #doseTarget} (The targeted disease.) + */ + public CodeableConcept getDoseTarget() { + if (this.doseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseTarget"); + else if (Configuration.doAutoCreate()) + this.doseTarget = new CodeableConcept(); + return this.doseTarget; + } + + public boolean hasDoseTarget() { + return this.doseTarget != null && !this.doseTarget.isEmpty(); + } + + /** + * @param value {@link #doseTarget} (The targeted disease.) + */ + public ImmunizationVaccinationProtocolComponent setDoseTarget(CodeableConcept value) { + this.doseTarget = value; + return this; + } + + /** + * @return {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) + */ + public CodeableConcept getDoseStatus() { + if (this.doseStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatus"); + else if (Configuration.doAutoCreate()) + this.doseStatus = new CodeableConcept(); + return this.doseStatus; + } + + public boolean hasDoseStatus() { + return this.doseStatus != null && !this.doseStatus.isEmpty(); + } + + /** + * @param value {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) + */ + public ImmunizationVaccinationProtocolComponent setDoseStatus(CodeableConcept value) { + this.doseStatus = value; + return this; + } + + /** + * @return {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) + */ + public CodeableConcept getDoseStatusReason() { + if (this.doseStatusReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatusReason"); + else if (Configuration.doAutoCreate()) + this.doseStatusReason = new CodeableConcept(); + return this.doseStatusReason; + } + + public boolean hasDoseStatusReason() { + return this.doseStatusReason != null && !this.doseStatusReason.isEmpty(); + } + + /** + * @param value {@link #doseStatusReason} (Provides an explanation as to why a immunization event should or should not count against the protocol.) + */ + public ImmunizationVaccinationProtocolComponent setDoseStatusReason(CodeableConcept value) { + this.doseStatusReason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("doseSequence", "integer", "Nominal position in a series.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); + childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); + childrenList.add(new Property("seriesDoses", "integer", "The recommended number of doses to achieve immunity.", 0, java.lang.Integer.MAX_VALUE, seriesDoses)); + childrenList.add(new Property("doseTarget", "CodeableConcept", "The targeted disease.", 0, java.lang.Integer.MAX_VALUE, doseTarget)); + childrenList.add(new Property("doseStatus", "CodeableConcept", "Indicates if the immunization event should 'count' against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatus)); + childrenList.add(new Property("doseStatusReason", "CodeableConcept", "Provides an explanation as to why a immunization event should or should not count against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatusReason)); + } + + public ImmunizationVaccinationProtocolComponent copy() { + ImmunizationVaccinationProtocolComponent dst = new ImmunizationVaccinationProtocolComponent(); + copyValues(dst); + dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); + dst.description = description == null ? null : description.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.series = series == null ? null : series.copy(); + dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy(); + dst.doseTarget = doseTarget == null ? null : doseTarget.copy(); + dst.doseStatus = doseStatus == null ? null : doseStatus.copy(); + dst.doseStatusReason = doseStatusReason == null ? null : doseStatusReason.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) + && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()) && (seriesDoses == null || seriesDoses.isEmpty()) + && (doseTarget == null || doseTarget.isEmpty()) && (doseStatus == null || doseStatus.isEmpty()) + && (doseStatusReason == null || doseStatusReason.isEmpty()); + } + + } + + /** + * A unique identifier assigned to this adverse reaction record. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this adverse reaction record." ) + protected List identifier; + + /** + * Date vaccine administered or was to be administered. + */ + @Child(name="date", type={DateTimeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Vaccination administration date", formalDefinition="Date vaccine administered or was to be administered." ) + protected DateTimeType date; + + /** + * Vaccine that was administered or was to be administered. + */ + @Child(name="vaccineType", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." ) + protected CodeableConcept vaccineType; + + /** + * The patient to whom the vaccine was to be administered. + */ + @Child(name="subject", type={Patient.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who was immunized?", formalDefinition="The patient to whom the vaccine was to be administered." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient to whom the vaccine was to be administered.) + */ + protected Patient subjectTarget; + + /** + * Indicates if the vaccination was refused. + */ + @Child(name="refusedIndicator", type={BooleanType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Was immunization refused?", formalDefinition="Indicates if the vaccination was refused." ) + protected BooleanType refusedIndicator; + + /** + * True if this administration was reported rather than directly administered. + */ + @Child(name="reported", type={BooleanType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Is this a self-reported record?", formalDefinition="True if this administration was reported rather than directly administered." ) + protected BooleanType reported; + + /** + * Clinician who administered the vaccine. + */ + @Child(name="performer", type={Practitioner.class}, order=5, min=0, max=1) + @Description(shortDefinition="Who administered vaccine?", formalDefinition="Clinician who administered the vaccine." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (Clinician who administered the vaccine.) + */ + protected Practitioner performerTarget; + + /** + * Clinician who ordered the vaccination. + */ + @Child(name="requester", type={Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Who ordered vaccination?", formalDefinition="Clinician who ordered the vaccination." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (Clinician who ordered the vaccination.) + */ + protected Practitioner requesterTarget; + + /** + * Name of vaccine manufacturer. + */ + @Child(name="manufacturer", type={Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) + protected Reference manufacturer; + + /** + * The actual object that is the target of the reference (Name of vaccine manufacturer.) + */ + protected Organization manufacturerTarget; + + /** + * The service delivery location where the vaccine administration occurred. + */ + @Child(name="location", type={Location.class}, order=8, min=0, max=1) + @Description(shortDefinition="Where did vaccination occur?", formalDefinition="The service delivery location where the vaccine administration occurred." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.) + */ + protected Location locationTarget; + + /** + * Lot number of the vaccine product. + */ + @Child(name="lotNumber", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) + protected StringType lotNumber; + + /** + * Date vaccine batch expires. + */ + @Child(name="expirationDate", type={DateType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) + protected DateType expirationDate; + + /** + * Body site where vaccine was administered. + */ + @Child(name="site", type={CodeableConcept.class}, order=11, min=0, max=1) + @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) + protected CodeableConcept site; + + /** + * The path by which the vaccine product is taken into the body. + */ + @Child(name="route", type={CodeableConcept.class}, order=12, min=0, max=1) + @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) + protected CodeableConcept route; + + /** + * The quantity of vaccine product that was administered. + */ + @Child(name="doseQuantity", type={Quantity.class}, order=13, min=0, max=1) + @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) + protected Quantity doseQuantity; + + /** + * Reasons why a vaccine was administered or refused. + */ + @Child(name="explanation", type={}, order=14, min=0, max=1) + @Description(shortDefinition="Administration / refusal reasons", formalDefinition="Reasons why a vaccine was administered or refused." ) + protected ImmunizationExplanationComponent explanation; + + /** + * Categorical data indicating that an adverse event is associated in time to an immunization. + */ + @Child(name="reaction", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) + protected List reaction; + + /** + * Contains information about the protocol(s) under which the vaccine was administered. + */ + @Child(name="vaccinationProtocol", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) + protected List vaccinationProtocol; + + private static final long serialVersionUID = -1398570384L; + + public Immunization() { + super(); + } + + public Immunization(DateTimeType date, CodeableConcept vaccineType, Reference subject, BooleanType refusedIndicator, BooleanType reported) { + super(); + this.date = date; + this.vaccineType = vaccineType; + this.subject = subject; + this.refusedIndicator = refusedIndicator; + this.reported = reported; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this adverse reaction record.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (A unique identifier assigned to this adverse reaction record.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Immunization setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return Date vaccine administered or was to be administered. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value Date vaccine administered or was to be administered. + */ + public Immunization setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #vaccineType} (Vaccine that was administered or was to be administered.) + */ + public CodeableConcept getVaccineType() { + if (this.vaccineType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.vaccineType"); + else if (Configuration.doAutoCreate()) + this.vaccineType = new CodeableConcept(); + return this.vaccineType; + } + + public boolean hasVaccineType() { + return this.vaccineType != null && !this.vaccineType.isEmpty(); + } + + /** + * @param value {@link #vaccineType} (Vaccine that was administered or was to be administered.) + */ + public Immunization setVaccineType(CodeableConcept value) { + this.vaccineType = value; + return this; + } + + /** + * @return {@link #subject} (The patient to whom the vaccine was to be administered.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.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 to whom the vaccine was to be administered.) + */ + public Immunization 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 to whom the vaccine was to be administered.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.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 to whom the vaccine was to be administered.) + */ + public Immunization setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #refusedIndicator} (Indicates if the vaccination was refused.). This is the underlying object with id, value and extensions. The accessor "getRefusedIndicator" gives direct access to the value + */ + public BooleanType getRefusedIndicatorElement() { + if (this.refusedIndicator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.refusedIndicator"); + else if (Configuration.doAutoCreate()) + this.refusedIndicator = new BooleanType(); + return this.refusedIndicator; + } + + public boolean hasRefusedIndicatorElement() { + return this.refusedIndicator != null && !this.refusedIndicator.isEmpty(); + } + + public boolean hasRefusedIndicator() { + return this.refusedIndicator != null && !this.refusedIndicator.isEmpty(); + } + + /** + * @param value {@link #refusedIndicator} (Indicates if the vaccination was refused.). This is the underlying object with id, value and extensions. The accessor "getRefusedIndicator" gives direct access to the value + */ + public Immunization setRefusedIndicatorElement(BooleanType value) { + this.refusedIndicator = value; + return this; + } + + /** + * @return Indicates if the vaccination was refused. + */ + public boolean getRefusedIndicator() { + return this.refusedIndicator == null ? false : this.refusedIndicator.getValue(); + } + + /** + * @param value Indicates if the vaccination was refused. + */ + public Immunization setRefusedIndicator(boolean value) { + if (this.refusedIndicator == null) + this.refusedIndicator = new BooleanType(); + this.refusedIndicator.setValue(value); + return this; + } + + /** + * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public BooleanType getReportedElement() { + if (this.reported == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.reported"); + else if (Configuration.doAutoCreate()) + this.reported = new BooleanType(); + return this.reported; + } + + public boolean hasReportedElement() { + return this.reported != null && !this.reported.isEmpty(); + } + + public boolean hasReported() { + return this.reported != null && !this.reported.isEmpty(); + } + + /** + * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value + */ + public Immunization setReportedElement(BooleanType value) { + this.reported = value; + return this; + } + + /** + * @return True if this administration was reported rather than directly administered. + */ + public boolean getReported() { + return this.reported == null ? false : this.reported.getValue(); + } + + /** + * @param value True if this administration was reported rather than directly administered. + */ + public Immunization setReported(boolean value) { + if (this.reported == null) + this.reported = new BooleanType(); + this.reported.setValue(value); + return this; + } + + /** + * @return {@link #performer} (Clinician who administered the vaccine.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (Clinician who administered the vaccine.) + */ + public Immunization setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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. (Clinician who administered the vaccine.) + */ + public Practitioner getPerformerTarget() { + if (this.performerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.performer"); + else if (Configuration.doAutoCreate()) + this.performerTarget = new Practitioner(); + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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. (Clinician who administered the vaccine.) + */ + public Immunization setPerformerTarget(Practitioner value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #requester} (Clinician who ordered the vaccination.) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (Clinician who ordered the vaccination.) + */ + public Immunization setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} 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. (Clinician who ordered the vaccination.) + */ + public Practitioner getRequesterTarget() { + if (this.requesterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.requester"); + else if (Configuration.doAutoCreate()) + this.requesterTarget = new Practitioner(); + return this.requesterTarget; + } + + /** + * @param value {@link #requester} 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. (Clinician who ordered the vaccination.) + */ + public Immunization setRequesterTarget(Practitioner value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #manufacturer} (Name of vaccine manufacturer.) + */ + public Reference getManufacturer() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new Reference(); + return this.manufacturer; + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (Name of vaccine manufacturer.) + */ + public Immunization setManufacturer(Reference value) { + this.manufacturer = value; + return this; + } + + /** + * @return {@link #manufacturer} 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. (Name of vaccine manufacturer.) + */ + public Organization getManufacturerTarget() { + if (this.manufacturerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturerTarget = new Organization(); + return this.manufacturerTarget; + } + + /** + * @param value {@link #manufacturer} 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. (Name of vaccine manufacturer.) + */ + public Immunization setManufacturerTarget(Organization value) { + this.manufacturerTarget = value; + return this; + } + + /** + * @return {@link #location} (The service delivery location where the vaccine administration occurred.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (The service delivery location where the vaccine administration occurred.) + */ + public Immunization setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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 service delivery location where the vaccine administration occurred.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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 service delivery location where the vaccine administration occurred.) + */ + public Immunization setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public StringType getLotNumberElement() { + if (this.lotNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.lotNumber"); + else if (Configuration.doAutoCreate()) + this.lotNumber = new StringType(); + return this.lotNumber; + } + + public boolean hasLotNumberElement() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + public boolean hasLotNumber() { + return this.lotNumber != null && !this.lotNumber.isEmpty(); + } + + /** + * @param value {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value + */ + public Immunization setLotNumberElement(StringType value) { + this.lotNumber = value; + return this; + } + + /** + * @return Lot number of the vaccine product. + */ + public String getLotNumber() { + return this.lotNumber == null ? null : this.lotNumber.getValue(); + } + + /** + * @param value Lot number of the vaccine product. + */ + public Immunization setLotNumber(String value) { + if (Utilities.noString(value)) + this.lotNumber = null; + else { + if (this.lotNumber == null) + this.lotNumber = new StringType(); + this.lotNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public DateType getExpirationDateElement() { + if (this.expirationDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.expirationDate"); + else if (Configuration.doAutoCreate()) + this.expirationDate = new DateType(); + return this.expirationDate; + } + + public boolean hasExpirationDateElement() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + public boolean hasExpirationDate() { + return this.expirationDate != null && !this.expirationDate.isEmpty(); + } + + /** + * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value + */ + public Immunization setExpirationDateElement(DateType value) { + this.expirationDate = value; + return this; + } + + /** + * @return Date vaccine batch expires. + */ + public Date getExpirationDate() { + return this.expirationDate == null ? null : this.expirationDate.getValue(); + } + + /** + * @param value Date vaccine batch expires. + */ + public Immunization setExpirationDate(Date value) { + if (value == null) + this.expirationDate = null; + else { + if (this.expirationDate == null) + this.expirationDate = new DateType(); + this.expirationDate.setValue(value); + } + return this; + } + + /** + * @return {@link #site} (Body site where vaccine was administered.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Body site where vaccine was administered.) + */ + public Immunization setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (The path by which the vaccine product is taken into the body.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (The path by which the vaccine product is taken into the body.) + */ + public Immunization setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** + * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.) + */ + public Quantity getDoseQuantity() { + if (this.doseQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.doseQuantity"); + else if (Configuration.doAutoCreate()) + this.doseQuantity = new Quantity(); + return this.doseQuantity; + } + + public boolean hasDoseQuantity() { + return this.doseQuantity != null && !this.doseQuantity.isEmpty(); + } + + /** + * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.) + */ + public Immunization setDoseQuantity(Quantity value) { + this.doseQuantity = value; + return this; + } + + /** + * @return {@link #explanation} (Reasons why a vaccine was administered or refused.) + */ + public ImmunizationExplanationComponent getExplanation() { + if (this.explanation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Immunization.explanation"); + else if (Configuration.doAutoCreate()) + this.explanation = new ImmunizationExplanationComponent(); + return this.explanation; + } + + public boolean hasExplanation() { + return this.explanation != null && !this.explanation.isEmpty(); + } + + /** + * @param value {@link #explanation} (Reasons why a vaccine was administered or refused.) + */ + public Immunization setExplanation(ImmunizationExplanationComponent value) { + this.explanation = value; + return this; + } + + /** + * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) + */ + public List getReaction() { + if (this.reaction == null) + this.reaction = new ArrayList(); + return this.reaction; + } + + public boolean hasReaction() { + if (this.reaction == null) + return false; + for (ImmunizationReactionComponent item : this.reaction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) + */ + // syntactic sugar + public ImmunizationReactionComponent addReaction() { //3 + ImmunizationReactionComponent t = new ImmunizationReactionComponent(); + if (this.reaction == null) + this.reaction = new ArrayList(); + this.reaction.add(t); + return t; + } + + /** + * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) + */ + public List getVaccinationProtocol() { + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + return this.vaccinationProtocol; + } + + public boolean hasVaccinationProtocol() { + if (this.vaccinationProtocol == null) + return false; + for (ImmunizationVaccinationProtocolComponent item : this.vaccinationProtocol) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) + */ + // syntactic sugar + public ImmunizationVaccinationProtocolComponent addVaccinationProtocol() { //3 + ImmunizationVaccinationProtocolComponent t = new ImmunizationVaccinationProtocolComponent(); + if (this.vaccinationProtocol == null) + this.vaccinationProtocol = new ArrayList(); + this.vaccinationProtocol.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this adverse reaction record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "Date vaccine administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient to whom the vaccine was to be administered.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("refusedIndicator", "boolean", "Indicates if the vaccination was refused.", 0, java.lang.Integer.MAX_VALUE, refusedIndicator)); + childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); + childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("lotNumber", "string", "Lot number of the vaccine product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); + childrenList.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); + childrenList.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("doseQuantity", "Quantity", "The quantity of vaccine product that was administered.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); + childrenList.add(new Property("explanation", "", "Reasons why a vaccine was administered or refused.", 0, java.lang.Integer.MAX_VALUE, explanation)); + childrenList.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction)); + childrenList.add(new Property("vaccinationProtocol", "", "Contains information about the protocol(s) under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, vaccinationProtocol)); + } + + public Immunization copy() { + Immunization dst = new Immunization(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.refusedIndicator = refusedIndicator == null ? null : refusedIndicator.copy(); + dst.reported = reported == null ? null : reported.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.requester = requester == null ? null : requester.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.location = location == null ? null : location.copy(); + dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); + dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); + dst.explanation = explanation == null ? null : explanation.copy(); + if (reaction != null) { + dst.reaction = new ArrayList(); + for (ImmunizationReactionComponent i : reaction) + dst.reaction.add(i.copy()); + }; + if (vaccinationProtocol != null) { + dst.vaccinationProtocol = new ArrayList(); + for (ImmunizationVaccinationProtocolComponent i : vaccinationProtocol) + dst.vaccinationProtocol.add(i.copy()); + }; + return dst; + } + + protected Immunization typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (vaccineType == null || vaccineType.isEmpty()) && (subject == null || subject.isEmpty()) + && (refusedIndicator == null || refusedIndicator.isEmpty()) && (reported == null || reported.isEmpty()) + && (performer == null || performer.isEmpty()) && (requester == null || requester.isEmpty()) + && (manufacturer == null || manufacturer.isEmpty()) && (location == null || location.isEmpty()) + && (lotNumber == null || lotNumber.isEmpty()) && (expirationDate == null || expirationDate.isEmpty()) + && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (doseQuantity == null || doseQuantity.isEmpty()) + && (explanation == null || explanation.isEmpty()) && (reaction == null || reaction.isEmpty()) + && (vaccinationProtocol == null || vaccinationProtocol.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Immunization; + } + + @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) + public static final String SP_REACTION = "reaction"; + @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" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="Why immunization occurred", type="token" ) + public static final String SP_REASON = "reason"; + @SearchParamDefinition(name="subject", path="Immunization.subject", description="The subject of the vaccination event / refusal", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When did reaction start?", type="date" ) + public static final String SP_REACTIONDATE = "reaction-date"; + @SearchParamDefinition(name="date", path="Immunization.date", description="Vaccination Administration / Refusal Date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="patient", path="Immunization.subject", description="The patient for the vaccination event / refusal", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" ) + public static final String SP_LOTNUMBER = "lot-number"; + @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference" ) + public static final String SP_MANUFACTURER = "manufacturer"; + @SearchParamDefinition(name="performer", path="Immunization.performer", description="The practitioner who administered the vaccination", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="refusal-reason", path="Immunization.explanation.refusalReason", description="Explanation of refusal / exemption", type="token" ) + public static final String SP_REFUSALREASON = "refusal-reason"; + @SearchParamDefinition(name="refused", path="Immunization.refusedIndicator", description="Was immunization refused?", type="token" ) + public static final String SP_REFUSED = "refused"; + @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java index a90490c2755..4b6c4d8bfdd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java @@ -20,1041 +20,1041 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A patient's point-of-time immunization status and recommendation with optional supporting justification. - */ -@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/Profile/ImmunizationRecommendation") -public class ImmunizationRecommendation extends DomainResource { - - @Block() - public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement { - /** - * The date the immunization recommendation was created. - */ - @Child(name="date", type={DateTimeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Date recommendation created", formalDefinition="The date the immunization recommendation was created." ) - protected DateTimeType date; - - /** - * Vaccine that pertains to the recommendation. - */ - @Child(name="vaccineType", type={CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Vaccine recommendation applies to", formalDefinition="Vaccine that pertains to the recommendation." ) - protected CodeableConcept vaccineType; - - /** - * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - @Child(name="doseNumber", type={IntegerType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Recommended dose number", formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." ) - protected IntegerType doseNumber; - - /** - * Vaccine administration status. - */ - @Child(name="forecastStatus", type={CodeableConcept.class}, order=4, min=1, max=1) - @Description(shortDefinition="Vaccine administration status", formalDefinition="Vaccine administration status." ) - protected CodeableConcept forecastStatus; - - /** - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - */ - @Child(name="dateCriterion", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc." ) - protected List dateCriterion; - - /** - * Contains information about the protocol under which the vaccine was administered. - */ - @Child(name="protocol", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Protocol used by recommendation", formalDefinition="Contains information about the protocol under which the vaccine was administered." ) - protected ImmunizationRecommendationRecommendationProtocolComponent protocol; - - /** - * Immunization event history that supports the status and recommendation. - */ - @Child(name="supportingImmunization", type={Immunization.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history that supports the status and recommendation." ) - protected List supportingImmunization; - /** - * The actual objects that are the target of the reference (Immunization event history that supports the status and recommendation.) - */ - protected List supportingImmunizationTarget; - - - /** - * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. - */ - @Child(name="supportingPatientInformation", type={Observation.class, AllergyIntolerance.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Patient observations supporting recommendation", formalDefinition="Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information." ) - protected List supportingPatientInformation; - /** - * The actual objects that are the target of the reference (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - protected List supportingPatientInformationTarget; - - - private static final long serialVersionUID = -1477214875L; - - public ImmunizationRecommendationRecommendationComponent() { - super(); - } - - public ImmunizationRecommendationRecommendationComponent(DateTimeType date, CodeableConcept vaccineType, CodeableConcept forecastStatus) { - super(); - this.date = date; - this.vaccineType = vaccineType; - this.forecastStatus = forecastStatus; - } - - /** - * @return {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date the immunization recommendation was created. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date the immunization recommendation was created. - */ - public ImmunizationRecommendationRecommendationComponent setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #vaccineType} (Vaccine that pertains to the recommendation.) - */ - public CodeableConcept getVaccineType() { - if (this.vaccineType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.vaccineType"); - else if (Configuration.doAutoCreate()) - this.vaccineType = new CodeableConcept(); - return this.vaccineType; - } - - public boolean hasVaccineType() { - return this.vaccineType != null && !this.vaccineType.isEmpty(); - } - - /** - * @param value {@link #vaccineType} (Vaccine that pertains to the recommendation.) - */ - public ImmunizationRecommendationRecommendationComponent setVaccineType(CodeableConcept value) { - this.vaccineType = value; - return this; - } - - /** - * @return {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value - */ - public IntegerType getDoseNumberElement() { - if (this.doseNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.doseNumber"); - else if (Configuration.doAutoCreate()) - this.doseNumber = new IntegerType(); - return this.doseNumber; - } - - public boolean hasDoseNumberElement() { - return this.doseNumber != null && !this.doseNumber.isEmpty(); - } - - public boolean hasDoseNumber() { - return this.doseNumber != null && !this.doseNumber.isEmpty(); - } - - /** - * @param value {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationComponent setDoseNumberElement(IntegerType value) { - this.doseNumber = value; - return this; - } - - /** - * @return This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - public int getDoseNumber() { - return this.doseNumber == null ? null : this.doseNumber.getValue(); - } - - /** - * @param value This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - public ImmunizationRecommendationRecommendationComponent setDoseNumber(int value) { - if (value == -1) - this.doseNumber = null; - else { - if (this.doseNumber == null) - this.doseNumber = new IntegerType(); - this.doseNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #forecastStatus} (Vaccine administration status.) - */ - public CodeableConcept getForecastStatus() { - if (this.forecastStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus"); - else if (Configuration.doAutoCreate()) - this.forecastStatus = new CodeableConcept(); - return this.forecastStatus; - } - - public boolean hasForecastStatus() { - return this.forecastStatus != null && !this.forecastStatus.isEmpty(); - } - - /** - * @param value {@link #forecastStatus} (Vaccine administration status.) - */ - public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { - this.forecastStatus = value; - return this; - } - - /** - * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) - */ - public List getDateCriterion() { - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - return this.dateCriterion; - } - - public boolean hasDateCriterion() { - if (this.dateCriterion == null) - return false; - for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) - */ - // syntactic sugar - public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3 - ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent(); - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - this.dateCriterion.add(t); - return t; - } - - /** - * @return {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent getProtocol() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); - return this.protocol; - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) - */ - public ImmunizationRecommendationRecommendationComponent setProtocol(ImmunizationRecommendationRecommendationProtocolComponent value) { - this.protocol = value; - return this; - } - - /** - * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) - */ - public List getSupportingImmunization() { - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - return this.supportingImmunization; - } - - public boolean hasSupportingImmunization() { - if (this.supportingImmunization == null) - return false; - for (Reference item : this.supportingImmunization) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) - */ - // syntactic sugar - public Reference addSupportingImmunization() { //3 - Reference t = new Reference(); - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - this.supportingImmunization.add(t); - return t; - } - - /** - * @return {@link #supportingImmunization} (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. Immunization event history that supports the status and recommendation.) - */ - public List getSupportingImmunizationTarget() { - if (this.supportingImmunizationTarget == null) - this.supportingImmunizationTarget = new ArrayList(); - return this.supportingImmunizationTarget; - } - - // syntactic sugar - /** - * @return {@link #supportingImmunization} (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. Immunization event history that supports the status and recommendation.) - */ - public Immunization addSupportingImmunizationTarget() { - Immunization r = new Immunization(); - if (this.supportingImmunizationTarget == null) - this.supportingImmunizationTarget = new ArrayList(); - this.supportingImmunizationTarget.add(r); - return r; - } - - /** - * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - public List getSupportingPatientInformation() { - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - return this.supportingPatientInformation; - } - - public boolean hasSupportingPatientInformation() { - if (this.supportingPatientInformation == null) - return false; - for (Reference item : this.supportingPatientInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - // syntactic sugar - public Reference addSupportingPatientInformation() { //3 - Reference t = new Reference(); - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - this.supportingPatientInformation.add(t); - return t; - } - - /** - * @return {@link #supportingPatientInformation} (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. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - public List getSupportingPatientInformationTarget() { - if (this.supportingPatientInformationTarget == null) - this.supportingPatientInformationTarget = new ArrayList(); - return this.supportingPatientInformationTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("date", "dateTime", "The date the immunization recommendation was created.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that pertains to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); - childrenList.add(new Property("doseNumber", "integer", "This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).", 0, java.lang.Integer.MAX_VALUE, doseNumber)); - childrenList.add(new Property("forecastStatus", "CodeableConcept", "Vaccine administration status.", 0, java.lang.Integer.MAX_VALUE, forecastStatus)); - childrenList.add(new Property("dateCriterion", "", "Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion)); - childrenList.add(new Property("protocol", "", "Contains information about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("supportingImmunization", "Reference(Immunization)", "Immunization event history that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization)); - childrenList.add(new Property("supportingPatientInformation", "Reference(Observation|AllergyIntolerance)", "Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation)); - } - - public ImmunizationRecommendationRecommendationComponent copy() { - ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent(); - copyValues(dst); - dst.date = date == null ? null : date.copy(); - dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); - dst.doseNumber = doseNumber == null ? null : doseNumber.copy(); - dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy(); - if (dateCriterion != null) { - dst.dateCriterion = new ArrayList(); - for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion) - dst.dateCriterion.add(i.copy()); - }; - dst.protocol = protocol == null ? null : protocol.copy(); - if (supportingImmunization != null) { - dst.supportingImmunization = new ArrayList(); - for (Reference i : supportingImmunization) - dst.supportingImmunization.add(i.copy()); - }; - if (supportingPatientInformation != null) { - dst.supportingPatientInformation = new ArrayList(); - for (Reference i : supportingPatientInformation) - dst.supportingPatientInformation.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (date == null || date.isEmpty()) && (vaccineType == null || vaccineType.isEmpty()) - && (doseNumber == null || doseNumber.isEmpty()) && (forecastStatus == null || forecastStatus.isEmpty()) - && (dateCriterion == null || dateCriterion.isEmpty()) && (protocol == null || protocol.isEmpty()) - && (supportingImmunization == null || supportingImmunization.isEmpty()) && (supportingPatientInformation == null || supportingPatientInformation.isEmpty()) - ; - } - - } - - @Block() - public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement { - /** - * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation - e.g. earliest date to give, latest date to give, etc." ) - protected CodeableConcept code; - - /** - * Date recommendation. - */ - @Child(name="value", type={DateTimeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Recommended date", formalDefinition="Date recommendation." ) - protected DateTimeType value; - - private static final long serialVersionUID = 1036994566L; - - public ImmunizationRecommendationRecommendationDateCriterionComponent() { - super(); - } - - public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, DateTimeType value) { - super(); - this.code = code; - this.value = value; - } - - /** - * @return {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DateTimeType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DateTimeType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { - this.value = value; - return this; - } - - /** - * @return Date recommendation. - */ - public Date getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value Date recommendation. - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { - if (this.value == null) - this.value = new DateTimeType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value", "dateTime", "Date recommendation.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ImmunizationRecommendationRecommendationDateCriterionComponent copy() { - ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - @Block() - public static class ImmunizationRecommendationRecommendationProtocolComponent extends BackboneElement { - /** - * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - @Child(name="doseSequence", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Number of dose within sequence", formalDefinition="Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol." ) - protected IntegerType doseSequence; - - /** - * Contains the description about the protocol under which the vaccine was administered. - */ - @Child(name="description", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) - protected StringType description; - - /** - * Indicates the authority who published the protocol? E.g. ACIP. - */ - @Child(name="authority", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) - */ - protected Organization authorityTarget; - - /** - * One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - @Child(name="series", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) - protected StringType series; - - private static final long serialVersionUID = -512702014L; - - public ImmunizationRecommendationRecommendationProtocolComponent() { - super(); - } - - /** - * @return {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public IntegerType getDoseSequenceElement() { - if (this.doseSequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.doseSequence"); - else if (Configuration.doAutoCreate()) - this.doseSequence = new IntegerType(); - return this.doseSequence; - } - - public boolean hasDoseSequenceElement() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - public boolean hasDoseSequence() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - /** - * @param value {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequenceElement(IntegerType value) { - this.doseSequence = value; - return this; - } - - /** - * @return Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - public int getDoseSequence() { - return this.doseSequence == null ? null : this.doseSequence.getValue(); - } - - /** - * @param value Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequence(int value) { - if (value == -1) - this.doseSequence = null; - else { - if (this.doseSequence == null) - this.doseSequence = new IntegerType(); - this.doseSequence.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). 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 ImmunizationRecommendationRecommendationProtocolComponent.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} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Contains the description about the protocol under which the vaccine was administered. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Contains the description about the protocol under which the vaccine was administered. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public Organization getAuthorityTarget() { - if (this.authorityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authorityTarget = new Organization(); - return this.authorityTarget; - } - - /** - * @param value {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent setAuthorityTarget(Organization value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public StringType getSeriesElement() { - if (this.series == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.series"); - else if (Configuration.doAutoCreate()) - this.series = new StringType(); - return this.series; - } - - public boolean hasSeriesElement() { - return this.series != null && !this.series.isEmpty(); - } - - public boolean hasSeries() { - return this.series != null && !this.series.isEmpty(); - } - - /** - * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setSeriesElement(StringType value) { - this.series = value; - return this; - } - - /** - * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public String getSeries() { - return this.series == null ? null : this.series.getValue(); - } - - /** - * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setSeries(String value) { - if (Utilities.noString(value)) - this.series = null; - else { - if (this.series == null) - this.series = new StringType(); - this.series.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("doseSequence", "integer", "Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); - childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - public ImmunizationRecommendationRecommendationProtocolComponent copy() { - ImmunizationRecommendationRecommendationProtocolComponent dst = new ImmunizationRecommendationRecommendationProtocolComponent(); - copyValues(dst); - dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); - dst.description = description == null ? null : description.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.series = series == null ? null : series.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) - && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()); - } - - } - - /** - * A unique identifier assigned to this particular recommendation record. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." ) - protected List identifier; - - /** - * The patient who is the subject of the profile. - */ - @Child(name="subject", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Who this profile is for", formalDefinition="The patient who is the subject of the profile." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who is the subject of the profile.) - */ - protected Patient subjectTarget; - - /** - * Vaccine administration recommendations. - */ - @Child(name="recommendation", type={}, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." ) - protected List recommendation; - - private static final long serialVersionUID = -1614145779L; - - public ImmunizationRecommendation() { - super(); - } - - public ImmunizationRecommendation(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (A unique identifier assigned to this particular recommendation record.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #subject} (The patient who is the subject of the profile.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendation.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 subject of the profile.) - */ - public ImmunizationRecommendation 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 subject of the profile.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendation.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 subject of the profile.) - */ - public ImmunizationRecommendation setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #recommendation} (Vaccine administration recommendations.) - */ - public List getRecommendation() { - if (this.recommendation == null) - this.recommendation = new ArrayList(); - return this.recommendation; - } - - public boolean hasRecommendation() { - if (this.recommendation == null) - return false; - for (ImmunizationRecommendationRecommendationComponent item : this.recommendation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recommendation} (Vaccine administration recommendations.) - */ - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3 - ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent(); - if (this.recommendation == null) - this.recommendation = new ArrayList(); - this.recommendation.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the subject of the profile.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation)); - } - - public ImmunizationRecommendation copy() { - ImmunizationRecommendation dst = new ImmunizationRecommendation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - if (recommendation != null) { - dst.recommendation = new ArrayList(); - for (ImmunizationRecommendationRecommendationComponent i : recommendation) - dst.recommendation.add(i.copy()); - }; - return dst; - } - - protected ImmunizationRecommendation typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (recommendation == null || recommendation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImmunizationRecommendation; - } - - @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference" ) - public static final String SP_INFORMATION = "information"; - @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="Number of dose within sequence", type="token" ) - public static final String SP_DOSESEQUENCE = "dose-sequence"; - @SearchParamDefinition(name="patient", path="ImmunizationRecommendation.subject", description="Who this profile is for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference" ) - public static final String SP_SUPPORT = "support"; - @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineType", description="Vaccine recommendation applies to", type="token" ) - public static final String SP_VACCINETYPE = "vaccine-type"; - @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine administration status", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="Recommended dose number", type="number" ) - public static final String SP_DOSENUMBER = "dose-number"; - @SearchParamDefinition(name="subject", path="ImmunizationRecommendation.subject", description="Who this profile is for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="date", path="ImmunizationRecommendation.recommendation.date", description="Date recommendation created", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * A patient's point-of-time immunization status and recommendation with optional supporting justification. + */ +@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/Profile/ImmunizationRecommendation") +public class ImmunizationRecommendation extends DomainResource { + + @Block() + public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement { + /** + * The date the immunization recommendation was created. + */ + @Child(name="date", type={DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Date recommendation created", formalDefinition="The date the immunization recommendation was created." ) + protected DateTimeType date; + + /** + * Vaccine that pertains to the recommendation. + */ + @Child(name="vaccineType", type={CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Vaccine recommendation applies to", formalDefinition="Vaccine that pertains to the recommendation." ) + protected CodeableConcept vaccineType; + + /** + * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + @Child(name="doseNumber", type={IntegerType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Recommended dose number", formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." ) + protected IntegerType doseNumber; + + /** + * Vaccine administration status. + */ + @Child(name="forecastStatus", type={CodeableConcept.class}, order=4, min=1, max=1) + @Description(shortDefinition="Vaccine administration status", formalDefinition="Vaccine administration status." ) + protected CodeableConcept forecastStatus; + + /** + * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. + */ + @Child(name="dateCriterion", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc." ) + protected List dateCriterion; + + /** + * Contains information about the protocol under which the vaccine was administered. + */ + @Child(name="protocol", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Protocol used by recommendation", formalDefinition="Contains information about the protocol under which the vaccine was administered." ) + protected ImmunizationRecommendationRecommendationProtocolComponent protocol; + + /** + * Immunization event history that supports the status and recommendation. + */ + @Child(name="supportingImmunization", type={Immunization.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history that supports the status and recommendation." ) + protected List supportingImmunization; + /** + * The actual objects that are the target of the reference (Immunization event history that supports the status and recommendation.) + */ + protected List supportingImmunizationTarget; + + + /** + * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. + */ + @Child(name="supportingPatientInformation", type={Observation.class, AllergyIntolerance.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Patient observations supporting recommendation", formalDefinition="Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information." ) + protected List supportingPatientInformation; + /** + * The actual objects that are the target of the reference (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + protected List supportingPatientInformationTarget; + + + private static final long serialVersionUID = -1477214875L; + + public ImmunizationRecommendationRecommendationComponent() { + super(); + } + + public ImmunizationRecommendationRecommendationComponent(DateTimeType date, CodeableConcept vaccineType, CodeableConcept forecastStatus) { + super(); + this.date = date; + this.vaccineType = vaccineType; + this.forecastStatus = forecastStatus; + } + + /** + * @return {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date the immunization recommendation was created. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date the immunization recommendation was created. + */ + public ImmunizationRecommendationRecommendationComponent setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #vaccineType} (Vaccine that pertains to the recommendation.) + */ + public CodeableConcept getVaccineType() { + if (this.vaccineType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.vaccineType"); + else if (Configuration.doAutoCreate()) + this.vaccineType = new CodeableConcept(); + return this.vaccineType; + } + + public boolean hasVaccineType() { + return this.vaccineType != null && !this.vaccineType.isEmpty(); + } + + /** + * @param value {@link #vaccineType} (Vaccine that pertains to the recommendation.) + */ + public ImmunizationRecommendationRecommendationComponent setVaccineType(CodeableConcept value) { + this.vaccineType = value; + return this; + } + + /** + * @return {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value + */ + public IntegerType getDoseNumberElement() { + if (this.doseNumber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.doseNumber"); + else if (Configuration.doAutoCreate()) + this.doseNumber = new IntegerType(); + return this.doseNumber; + } + + public boolean hasDoseNumberElement() { + return this.doseNumber != null && !this.doseNumber.isEmpty(); + } + + public boolean hasDoseNumber() { + return this.doseNumber != null && !this.doseNumber.isEmpty(); + } + + /** + * @param value {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationComponent setDoseNumberElement(IntegerType value) { + this.doseNumber = value; + return this; + } + + /** + * @return This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + public int getDoseNumber() { + return this.doseNumber == null ? null : this.doseNumber.getValue(); + } + + /** + * @param value This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + */ + public ImmunizationRecommendationRecommendationComponent setDoseNumber(int value) { + if (value == -1) + this.doseNumber = null; + else { + if (this.doseNumber == null) + this.doseNumber = new IntegerType(); + this.doseNumber.setValue(value); + } + return this; + } + + /** + * @return {@link #forecastStatus} (Vaccine administration status.) + */ + public CodeableConcept getForecastStatus() { + if (this.forecastStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus"); + else if (Configuration.doAutoCreate()) + this.forecastStatus = new CodeableConcept(); + return this.forecastStatus; + } + + public boolean hasForecastStatus() { + return this.forecastStatus != null && !this.forecastStatus.isEmpty(); + } + + /** + * @param value {@link #forecastStatus} (Vaccine administration status.) + */ + public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { + this.forecastStatus = value; + return this; + } + + /** + * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) + */ + public List getDateCriterion() { + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + return this.dateCriterion; + } + + public boolean hasDateCriterion() { + if (this.dateCriterion == null) + return false; + for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dateCriterion} (Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.) + */ + // syntactic sugar + public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3 + ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent(); + if (this.dateCriterion == null) + this.dateCriterion = new ArrayList(); + this.dateCriterion.add(t); + return t; + } + + /** + * @return {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent getProtocol() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); + return this.protocol; + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) + */ + public ImmunizationRecommendationRecommendationComponent setProtocol(ImmunizationRecommendationRecommendationProtocolComponent value) { + this.protocol = value; + return this; + } + + /** + * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) + */ + public List getSupportingImmunization() { + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + return this.supportingImmunization; + } + + public boolean hasSupportingImmunization() { + if (this.supportingImmunization == null) + return false; + for (Reference item : this.supportingImmunization) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) + */ + // syntactic sugar + public Reference addSupportingImmunization() { //3 + Reference t = new Reference(); + if (this.supportingImmunization == null) + this.supportingImmunization = new ArrayList(); + this.supportingImmunization.add(t); + return t; + } + + /** + * @return {@link #supportingImmunization} (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. Immunization event history that supports the status and recommendation.) + */ + public List getSupportingImmunizationTarget() { + if (this.supportingImmunizationTarget == null) + this.supportingImmunizationTarget = new ArrayList(); + return this.supportingImmunizationTarget; + } + + // syntactic sugar + /** + * @return {@link #supportingImmunization} (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. Immunization event history that supports the status and recommendation.) + */ + public Immunization addSupportingImmunizationTarget() { + Immunization r = new Immunization(); + if (this.supportingImmunizationTarget == null) + this.supportingImmunizationTarget = new ArrayList(); + this.supportingImmunizationTarget.add(r); + return r; + } + + /** + * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + public List getSupportingPatientInformation() { + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + return this.supportingPatientInformation; + } + + public boolean hasSupportingPatientInformation() { + if (this.supportingPatientInformation == null) + return false; + for (Reference item : this.supportingPatientInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + // syntactic sugar + public Reference addSupportingPatientInformation() { //3 + Reference t = new Reference(); + if (this.supportingPatientInformation == null) + this.supportingPatientInformation = new ArrayList(); + this.supportingPatientInformation.add(t); + return t; + } + + /** + * @return {@link #supportingPatientInformation} (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. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) + */ + public List getSupportingPatientInformationTarget() { + if (this.supportingPatientInformationTarget == null) + this.supportingPatientInformationTarget = new ArrayList(); + return this.supportingPatientInformationTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("date", "dateTime", "The date the immunization recommendation was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("vaccineType", "CodeableConcept", "Vaccine that pertains to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineType)); + childrenList.add(new Property("doseNumber", "integer", "This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).", 0, java.lang.Integer.MAX_VALUE, doseNumber)); + childrenList.add(new Property("forecastStatus", "CodeableConcept", "Vaccine administration status.", 0, java.lang.Integer.MAX_VALUE, forecastStatus)); + childrenList.add(new Property("dateCriterion", "", "Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion)); + childrenList.add(new Property("protocol", "", "Contains information about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("supportingImmunization", "Reference(Immunization)", "Immunization event history that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization)); + childrenList.add(new Property("supportingPatientInformation", "Reference(Observation|AllergyIntolerance)", "Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation)); + } + + public ImmunizationRecommendationRecommendationComponent copy() { + ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent(); + copyValues(dst); + dst.date = date == null ? null : date.copy(); + dst.vaccineType = vaccineType == null ? null : vaccineType.copy(); + dst.doseNumber = doseNumber == null ? null : doseNumber.copy(); + dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy(); + if (dateCriterion != null) { + dst.dateCriterion = new ArrayList(); + for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion) + dst.dateCriterion.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + if (supportingImmunization != null) { + dst.supportingImmunization = new ArrayList(); + for (Reference i : supportingImmunization) + dst.supportingImmunization.add(i.copy()); + }; + if (supportingPatientInformation != null) { + dst.supportingPatientInformation = new ArrayList(); + for (Reference i : supportingPatientInformation) + dst.supportingPatientInformation.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (date == null || date.isEmpty()) && (vaccineType == null || vaccineType.isEmpty()) + && (doseNumber == null || doseNumber.isEmpty()) && (forecastStatus == null || forecastStatus.isEmpty()) + && (dateCriterion == null || dateCriterion.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (supportingImmunization == null || supportingImmunization.isEmpty()) && (supportingPatientInformation == null || supportingPatientInformation.isEmpty()) + ; + } + + } + + @Block() + public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement { + /** + * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation - e.g. earliest date to give, latest date to give, etc." ) + protected CodeableConcept code; + + /** + * Date recommendation. + */ + @Child(name="value", type={DateTimeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Recommended date", formalDefinition="Date recommendation." ) + protected DateTimeType value; + + private static final long serialVersionUID = 1036994566L; + + public ImmunizationRecommendationRecommendationDateCriterionComponent() { + super(); + } + + public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, DateTimeType value) { + super(); + this.code = code; + this.value = value; + } + + /** + * @return {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.) + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DateTimeType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new DateTimeType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Date recommendation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { + this.value = value; + return this; + } + + /** + * @return Date recommendation. + */ + public Date getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value Date recommendation. + */ + public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { + if (this.value == null) + this.value = new DateTimeType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Date classification of recommendation - e.g. earliest date to give, latest date to give, etc.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("value", "dateTime", "Date recommendation.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ImmunizationRecommendationRecommendationDateCriterionComponent copy() { + ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + @Block() + public static class ImmunizationRecommendationRecommendationProtocolComponent extends BackboneElement { + /** + * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + @Child(name="doseSequence", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Number of dose within sequence", formalDefinition="Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol." ) + protected IntegerType doseSequence; + + /** + * Contains the description about the protocol under which the vaccine was administered. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) + protected StringType description; + + /** + * Indicates the authority who published the protocol? E.g. ACIP. + */ + @Child(name="authority", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol? E.g. ACIP." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (Indicates the authority who published the protocol? E.g. ACIP.) + */ + protected Organization authorityTarget; + + /** + * One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + @Child(name="series", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) + protected StringType series; + + private static final long serialVersionUID = -512702014L; + + public ImmunizationRecommendationRecommendationProtocolComponent() { + super(); + } + + /** + * @return {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public IntegerType getDoseSequenceElement() { + if (this.doseSequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.doseSequence"); + else if (Configuration.doAutoCreate()) + this.doseSequence = new IntegerType(); + return this.doseSequence; + } + + public boolean hasDoseSequenceElement() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + public boolean hasDoseSequence() { + return this.doseSequence != null && !this.doseSequence.isEmpty(); + } + + /** + * @param value {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequenceElement(IntegerType value) { + this.doseSequence = value; + return this; + } + + /** + * @return Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + public int getDoseSequence() { + return this.doseSequence == null ? null : this.doseSequence.getValue(); + } + + /** + * @param value Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequence(int value) { + if (value == -1) + this.doseSequence = null; + else { + if (this.doseSequence == null) + this.doseSequence = new IntegerType(); + this.doseSequence.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). 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 ImmunizationRecommendationRecommendationProtocolComponent.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} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Contains the description about the protocol under which the vaccine was administered. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Contains the description about the protocol under which the vaccine was administered. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public Organization getAuthorityTarget() { + if (this.authorityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); + else if (Configuration.doAutoCreate()) + this.authorityTarget = new Organization(); + return this.authorityTarget; + } + + /** + * @param value {@link #authority} 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. (Indicates the authority who published the protocol? E.g. ACIP.) + */ + public ImmunizationRecommendationRecommendationProtocolComponent setAuthorityTarget(Organization value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public StringType getSeriesElement() { + if (this.series == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.series"); + else if (Configuration.doAutoCreate()) + this.series = new StringType(); + return this.series; + } + + public boolean hasSeriesElement() { + return this.series != null && !this.series.isEmpty(); + } + + public boolean hasSeries() { + return this.series != null && !this.series.isEmpty(); + } + + /** + * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value + */ + public ImmunizationRecommendationRecommendationProtocolComponent setSeriesElement(StringType value) { + this.series = value; + return this; + } + + /** + * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public String getSeries() { + return this.series == null ? null : this.series.getValue(); + } + + /** + * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. + */ + public ImmunizationRecommendationRecommendationProtocolComponent setSeries(String value) { + if (Utilities.noString(value)) + this.series = null; + else { + if (this.series == null) + this.series = new StringType(); + this.series.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("doseSequence", "integer", "Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); + childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol? E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); + } + + public ImmunizationRecommendationRecommendationProtocolComponent copy() { + ImmunizationRecommendationRecommendationProtocolComponent dst = new ImmunizationRecommendationRecommendationProtocolComponent(); + copyValues(dst); + dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); + dst.description = description == null ? null : description.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.series = series == null ? null : series.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) + && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()); + } + + } + + /** + * A unique identifier assigned to this particular recommendation record. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." ) + protected List identifier; + + /** + * The patient who is the subject of the profile. + */ + @Child(name="subject", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Who this profile is for", formalDefinition="The patient who is the subject of the profile." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who is the subject of the profile.) + */ + protected Patient subjectTarget; + + /** + * Vaccine administration recommendations. + */ + @Child(name="recommendation", type={}, order=1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." ) + protected List recommendation; + + private static final long serialVersionUID = -1614145779L; + + public ImmunizationRecommendation() { + super(); + } + + public ImmunizationRecommendation(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (A unique identifier assigned to this particular recommendation record.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #subject} (The patient who is the subject of the profile.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendation.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 subject of the profile.) + */ + public ImmunizationRecommendation 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 subject of the profile.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ImmunizationRecommendation.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 subject of the profile.) + */ + public ImmunizationRecommendation setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #recommendation} (Vaccine administration recommendations.) + */ + public List getRecommendation() { + if (this.recommendation == null) + this.recommendation = new ArrayList(); + return this.recommendation; + } + + public boolean hasRecommendation() { + if (this.recommendation == null) + return false; + for (ImmunizationRecommendationRecommendationComponent item : this.recommendation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recommendation} (Vaccine administration recommendations.) + */ + // syntactic sugar + public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3 + ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent(); + if (this.recommendation == null) + this.recommendation = new ArrayList(); + this.recommendation.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the subject of the profile.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation)); + } + + public ImmunizationRecommendation copy() { + ImmunizationRecommendation dst = new ImmunizationRecommendation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + if (recommendation != null) { + dst.recommendation = new ArrayList(); + for (ImmunizationRecommendationRecommendationComponent i : recommendation) + dst.recommendation.add(i.copy()); + }; + return dst; + } + + protected ImmunizationRecommendation typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (recommendation == null || recommendation.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ImmunizationRecommendation; + } + + @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference" ) + public static final String SP_INFORMATION = "information"; + @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="Number of dose within sequence", type="token" ) + public static final String SP_DOSESEQUENCE = "dose-sequence"; + @SearchParamDefinition(name="patient", path="ImmunizationRecommendation.subject", description="Who this profile is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference" ) + public static final String SP_SUPPORT = "support"; + @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineType", description="Vaccine recommendation applies to", type="token" ) + public static final String SP_VACCINETYPE = "vaccine-type"; + @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine administration status", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="Recommended dose number", type="number" ) + public static final String SP_DOSENUMBER = "dose-number"; + @SearchParamDefinition(name="subject", path="ImmunizationRecommendation.subject", description="Who this profile is for", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="date", path="ImmunizationRecommendation.recommendation.date", description="Date recommendation created", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java index 3c991a1e4b0..1206cd157a4 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java @@ -1,34 +1,34 @@ -/* -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. - -*/ -/** - * - */ +/* +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. + +*/ +/** + * + */ package org.hl7.fhir.instance.model; /* @@ -51,188 +51,188 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; -import java.util.zip.DataFormatException; - -/** - * Represents a FHIR instant datatype. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ -public class InstantType extends BaseDateTimeType { - - private static final long serialVersionUID = 1L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI; - - /** - * Constructor which creates an InstantDt with no timne value. Note - * that unlike the default constructor for the Java {@link Date} or - * {@link Calendar} objects, this constructor does not initialize the object - * with the current time. - * - * @see #withCurrentTime() to create a new object that has been initialized - * with the current time. - */ - public InstantType() { - super(); - } - - /** - * Create a new DateTimeDt - */ - public InstantType(Calendar theCalendar) { - super(theCalendar.getTime(), DEFAULT_PRECISION, theCalendar.getTimeZone()); - } - - /** - * Create a new instance using the given date, precision level, and time zone - * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the specified precision is not allowed for this type - */ - public InstantType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { - super(theDate, thePrecision, theTimezone); - } - - - /** - * Create a new DateTimeDt using an existing value. Use this constructor with caution, - * as it may create more precision than warranted (since for example it is possible to pass in - * a DateTime with only a year, and this constructor will convert to an InstantDt with - * milliseconds precision). - */ - public InstantType(BaseDateTimeType theDateTime) { - // Do not call super(foo) here, we don't want to trigger a DataFormatException - setValue(theDateTime.getValue()); - setPrecision(DEFAULT_PRECISION); - setTimeZone(theDateTime.getTimeZone()); - } - - /** - * Create a new DateTimeDt with the given date/time and {@link TemporalPrecisionEnum#MILLI} precision - */ - public InstantType(Date theDate) { - super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); - } - - /** - * Constructor which accepts a date value and a precision value. Valid - * precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ - public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { - setValue(theDate); - setPrecision(thePrecision); - setTimeZone(TimeZone.getDefault()); - } - - /** - * Create a new InstantDt from a string value - * - * @param theString - * The string representation of the string. Must be in a valid - * format according to the FHIR specification - * @throws ca.uhn.fhir.parser.DataFormatException If the value is invalid - */ - public InstantType(String theString) { - super(theString); - } - - /** - * Invokes {@link Date#after(Date)} on the contained Date against the given - * date - * - * @throws NullPointerException - * If the {@link #getValue() contained Date} is null - */ - public boolean after(Date theDate) { - return getValue().after(theDate); - } - - /** - * Invokes {@link Date#before(Date)} on the contained Date against the given - * date - * - * @throws NullPointerException - * If the {@link #getValue() contained Date} is null - */ - public boolean before(Date theDate) { - return getValue().before(theDate); - } - - /** - * Sets the value of this instant to the current time (from the system - * clock) and the local/default timezone (as retrieved using - * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from - * the underlying OS. - */ - public void setToCurrentTimeInLocalTimeZone() { - setValue(new Date()); - setTimeZone(TimeZone.getDefault()); - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case SECOND: - case MILLI: - return true; - default: - return false; - } - } - - /** - * Factory method which creates a new InstantDt with millisecond precision and initializes it with the - * current time and the system local timezone. - */ - public static InstantType withCurrentTime() { - return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - - @Override - 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; - } - -} + +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.zip.DataFormatException; + +/** + * Represents a FHIR instant datatype. Valid precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ +public class InstantType extends BaseDateTimeType { + + private static final long serialVersionUID = 1L; + + /** + * The default precision for this type + */ + public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI; + + /** + * Constructor which creates an InstantDt with no timne value. Note + * that unlike the default constructor for the Java {@link Date} or + * {@link Calendar} objects, this constructor does not initialize the object + * with the current time. + * + * @see #withCurrentTime() to create a new object that has been initialized + * with the current time. + */ + public InstantType() { + super(); + } + + /** + * Create a new DateTimeDt + */ + public InstantType(Calendar theCalendar) { + super(theCalendar.getTime(), DEFAULT_PRECISION, theCalendar.getTimeZone()); + } + + /** + * Create a new instance using the given date, precision level, and time zone + * + * @throws ca.uhn.fhir.parser.DataFormatException + * If the specified precision is not allowed for this type + */ + public InstantType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { + super(theDate, thePrecision, theTimezone); + } + + + /** + * Create a new DateTimeDt using an existing value. Use this constructor with caution, + * as it may create more precision than warranted (since for example it is possible to pass in + * a DateTime with only a year, and this constructor will convert to an InstantDt with + * milliseconds precision). + */ + public InstantType(BaseDateTimeType theDateTime) { + // Do not call super(foo) here, we don't want to trigger a DataFormatException + setValue(theDateTime.getValue()); + setPrecision(DEFAULT_PRECISION); + setTimeZone(theDateTime.getTimeZone()); + } + + /** + * Create a new DateTimeDt with the given date/time and {@link TemporalPrecisionEnum#MILLI} precision + */ + public InstantType(Date theDate) { + super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); + } + + /** + * Constructor which accepts a date value and a precision value. Valid + * precisions values for this type are: + *
    + *
  • {@link TemporalPrecisionEnum#SECOND} + *
  • {@link TemporalPrecisionEnum#MILLI} + *
+ */ + public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { + setValue(theDate); + setPrecision(thePrecision); + setTimeZone(TimeZone.getDefault()); + } + + /** + * Create a new InstantDt from a string value + * + * @param theString + * The string representation of the string. Must be in a valid + * format according to the FHIR specification + * @throws ca.uhn.fhir.parser.DataFormatException If the value is invalid + */ + public InstantType(String theString) { + super(theString); + } + + /** + * Invokes {@link Date#after(Date)} on the contained Date against the given + * date + * + * @throws NullPointerException + * If the {@link #getValue() contained Date} is null + */ + public boolean after(Date theDate) { + return getValue().after(theDate); + } + + /** + * Invokes {@link Date#before(Date)} on the contained Date against the given + * date + * + * @throws NullPointerException + * If the {@link #getValue() contained Date} is null + */ + public boolean before(Date theDate) { + return getValue().before(theDate); + } + + /** + * Sets the value of this instant to the current time (from the system + * clock) and the local/default timezone (as retrieved using + * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from + * the underlying OS. + */ + public void setToCurrentTimeInLocalTimeZone() { + setValue(new Date()); + setTimeZone(TimeZone.getDefault()); + } + + @Override + boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { + switch (thePrecision) { + case SECOND: + case MILLI: + return true; + default: + return false; + } + } + + /** + * Factory method which creates a new InstantDt with millisecond precision and initializes it with the + * current time and the system local timezone. + */ + public static InstantType withCurrentTime() { + return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); + } + + /** + * Returns the default precision for this datatype + * + * @see #DEFAULT_PRECISION + */ + @Override + protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { + return DEFAULT_PRECISION; + } + + + @Override + 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; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java index 77685dee2db..54974c80738 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java @@ -20,3788 +20,3788 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="InstitutionalClaim", profile="http://hl7.org/fhir/Profile/InstitutionalClaim") -public class InstitutionalClaim extends DomainResource { - - public enum UseLink implements FhirEnum { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case PROPOSED: return ""; - case EXPLORATORY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class UseLinkEnumFactory implements EnumFactory { - public UseLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return UseLink.COMPLETE; - if ("proposed".equals(codeString)) - return UseLink.PROPOSED; - if ("exploratory".equals(codeString)) - return UseLink.EXPLORATORY; - if ("other".equals(codeString)) - return UseLink.OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - public String toCode(UseLink code) throws IllegalArgumentException { - if (code == UseLink.COMPLETE) - return "complete"; - if (code == UseLink.PROPOSED) - return "proposed"; - if (code == UseLink.EXPLORATORY) - return "exploratory"; - if (code == UseLink.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class PayeeComponent extends BackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="person", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement { - /** - * Sequence of diagnosis. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) - protected IntegerType sequence; - - /** - * The diagnosis. - */ - @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -935927954L; - - public DiagnosisComponent() { - super(); - } - - public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement { - /** - * A service line item. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected IntegerType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agrement which describes the terms and conditions. - */ - @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preauthref; - - /** - * The Coverages adjudication details. - */ - @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - private static final long serialVersionUID = 450222500L; - - public CoverageComponent() { - super(); - } - - public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public boolean getFocal() { - return this.focal == null ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agrement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agrement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreauthref() { - if (this.preauthref == null) - this.preauthref = new ArrayList(); - return this.preauthref; - } - - public boolean hasPreauthref() { - if (this.preauthref == null) - return false; - for (StringType item : this.preauthref) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreauthrefElement() {//2 - StringType t = new StringType(); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return t; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreauthref(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return this; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreauthref(String value) { - if (this.preauthref == null) - return false; - for (StringType v : this.preauthref) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} 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 Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} 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 Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - 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)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preauthref != null) { - dst.preauthref = new ArrayList(); - for (StringType i : preauthref) - dst.preauthref.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - 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 diagnosisLinkId; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied. - */ - @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 Institutional 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=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=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=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=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=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=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=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=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=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 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=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 modifier; - - /** - * Second tier of goods and services. - */ - @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 detail; - - private static final long serialVersionUID = -1140048455L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 ItemsComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - 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(); - 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(); - 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 Institutional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public DateType getServiceDateElement() { - if (this.serviceDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); - else if (Configuration.doAutoCreate()) - this.serviceDate = new DateType(); - return this.serviceDate; - } - - public boolean hasServiceDateElement() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - public boolean hasServiceDate() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - /** - * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public ItemsComponent setServiceDateElement(DateType value) { - this.serviceDate = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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(Date value) { - if (value == null) - this.serviceDate = null; - else { - if (this.serviceDate == null) - this.serviceDate = new DateType(); - this.serviceDate.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public ItemsComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubsite() { - if (this.subsite == null) - this.subsite = new ArrayList(); - return this.subsite; - } - - public boolean hasSubsite() { - if (this.subsite == null) - return false; - for (Coding item : this.subsite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubsite() { //3 - Coding t = new Coding(); - if (this.subsite == null) - this.subsite = new ArrayList(); - this.subsite.add(t); - return t; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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 Institutional 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)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - 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(); - 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(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subsite != null) { - dst.subsite = new ArrayList(); - for (Coding i : subsite) - dst.subsite.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) - && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class DetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied. - */ - @Child(name="service", type={Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Total additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Third tier of goods and services. - */ - @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -342502025L; - - public DetailComponent() { - super(); - } - - public DetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public DetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="service", type={Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) - 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Net additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - private static final long serialVersionUID = 122809194L; - - public SubDetailComponent() { - super(); - } - - public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addtional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public SubDetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()); - } - - } - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) - */ - protected Organization targetTarget; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Organization organizationTarget; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - protected Practitioner entererTarget; - - /** - * Facility where the services were provided. - */ - @Child(name="facility", type={Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Reference facility; - - /** - * The actual object that is the target of the reference (Facility where the services were provided.) - */ - protected Location facilityTarget; - - /** - * Theparty to be reimbused for the services. - */ - @Child(name="payee", type={}, order=11, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - protected ReferralRequest referralTarget; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * List of patient conditions for which care is sought. - */ - @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) - protected List condition; - - /** - * Patient Resource. - */ - @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient patientTarget; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name="school", type={StringType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * Date of an accident which these services are addessing. - */ - @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) - @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) - protected DateType accident; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) - @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * First tier of goods and services. - */ - @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) - @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 additionalMaterials; - - private static final long serialVersionUID = 1113876752L; - - public InstitutionalClaim() { - super(); - } - - public InstitutionalClaim(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public InstitutionalClaim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public InstitutionalClaim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 InstitutionalClaim setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 InstitutionalClaim setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public InstitutionalClaim setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public InstitutionalClaim setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public InstitutionalClaim setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public InstitutionalClaim setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public InstitutionalClaim setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 bill, claim pre-determination, pre-authorization.) - */ - public InstitutionalClaim setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public InstitutionalClaim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public UseLink getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public InstitutionalClaim setUse(UseLink value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(UseLink.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public InstitutionalClaim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public InstitutionalClaim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public InstitutionalClaim setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); - return this.entererTarget; - } - - /** - * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public InstitutionalClaim setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacility() { - if (this.facility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public InstitutionalClaim setFacility(Reference value) { - this.facility = value; - return this; - } - - /** - * @return {@link #facility} 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. (Facility where the services were provided.) - */ - public Location getFacilityTarget() { - if (this.facilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); - return this.facilityTarget; - } - - /** - * @param value {@link #facility} 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. (Facility where the services were provided.) - */ - public InstitutionalClaim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - - /** - * @return {@link #payee} (Theparty to be reimbused for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (Theparty to be reimbused for the services.) - */ - public InstitutionalClaim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public InstitutionalClaim setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); - return this.referralTarget; - } - - /** - * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public InstitutionalClaim setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Coding item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - // syntactic sugar - public Coding addCondition() { //3 - Coding t = new Coding(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.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} (Patient Resource.) - */ - public InstitutionalClaim 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. (Patient Resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.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. (Patient Resource.) - */ - public InstitutionalClaim setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public InstitutionalClaim setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public InstitutionalClaim setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public DateType getAccidentElement() { - if (this.accident == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.accident"); - else if (Configuration.doAutoCreate()) - this.accident = new DateType(); - return this.accident; - } - - public boolean hasAccidentElement() { - return this.accident != null && !this.accident.isEmpty(); - } - - public boolean hasAccident() { - return this.accident != null && !this.accident.isEmpty(); - } - - /** - * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public InstitutionalClaim setAccidentElement(DateType value) { - this.accident = value; - return this; - } - - /** - * @return Date of an accident which these services are addessing. - */ - public Date getAccident() { - return this.accident == null ? null : this.accident.getValue(); - } - - /** - * @param value Date of an accident which these services are addessing. - */ - public InstitutionalClaim setAccident(Date value) { - if (value == null) - this.accident = null; - else { - if (this.accident == null) - this.accident = new DateType(); - this.accident.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstitutionalClaim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public InstitutionalClaim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterials() { - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - return this.additionalMaterials; - } - - public boolean hasAdditionalMaterials() { - if (this.additionalMaterials == null) - return false; - for (Coding item : this.additionalMaterials) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterials() { //3 - Coding t = new Coding(); - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); - } - - public InstitutionalClaim copy() { - InstitutionalClaim dst = new InstitutionalClaim(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Coding i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.accident = accident == null ? null : accident.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additionalMaterials != null) { - dst.additionalMaterials = new ArrayList(); - for (Coding i : additionalMaterials) - dst.additionalMaterials.add(i.copy()); - }; - return dst; - } - - protected InstitutionalClaim typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) - && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.InstitutionalClaim; - } - - @SearchParamDefinition(name="patient", path="InstitutionalClaim.patient", description="Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="priority", path="InstitutionalClaim.priority", description="Processing priority requested", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="use", path="InstitutionalClaim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - @SearchParamDefinition(name="identifier", path="InstitutionalClaim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="InstitutionalClaim", profile="http://hl7.org/fhir/Profile/InstitutionalClaim") +public class InstitutionalClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} 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 Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} 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 Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + 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)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + 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 diagnosisLinkId; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied. + */ + @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 Institutional 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=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=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=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=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=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=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=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=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=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 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=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 modifier; + + /** + * Second tier of goods and services. + */ + @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 detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + 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(); + 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(); + 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 Institutional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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 Institutional 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)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + 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(); + 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(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Total additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Net additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @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 additionalMaterials; + + private static final long serialVersionUID = 1113876752L; + + public InstitutionalClaim() { + super(); + } + + public InstitutionalClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public InstitutionalClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public InstitutionalClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 InstitutionalClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 InstitutionalClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public InstitutionalClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public InstitutionalClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public InstitutionalClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public InstitutionalClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public InstitutionalClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public InstitutionalClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public InstitutionalClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public InstitutionalClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public InstitutionalClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} 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. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} 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. (Facility where the services were provided.) + */ + public InstitutionalClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public InstitutionalClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public InstitutionalClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public InstitutionalClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.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} (Patient Resource.) + */ + public InstitutionalClaim 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. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.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. (Patient Resource.) + */ + public InstitutionalClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public InstitutionalClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public InstitutionalClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public InstitutionalClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public InstitutionalClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public InstitutionalClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public InstitutionalClaim copy() { + InstitutionalClaim dst = new InstitutionalClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected InstitutionalClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.InstitutionalClaim; + } + + @SearchParamDefinition(name="patient", path="InstitutionalClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="InstitutionalClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="InstitutionalClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="InstitutionalClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java index 49c91a6d73d..cea3fb3fe47 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java @@ -1,34 +1,34 @@ -/* -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. - - */ -/** - * - */ +/* +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. + + */ +/** + * + */ package org.hl7.fhir.instance.model; /* @@ -51,76 +51,76 @@ package org.hl7.fhir.instance.model; * #L% */ - -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "integer") -public class IntegerType extends PrimitiveType { - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public IntegerType() { - // nothing - } - - /** - * Constructor - */ - public IntegerType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public IntegerType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * 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 Integer parse(String theValue) { - try { - return Integer.parseInt(theValue); - } catch (NumberFormatException e) { - throw new IllegalArgumentException(e); - } - } - - @Override - protected String encode(Integer theValue) { - return Integer.toString(theValue); - } - - @Override - public IntegerType copy() { - return new IntegerType(getValue()); - } - -} + +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "integer" in FHIR: A signed 32-bit integer + */ +@DatatypeDef(name = "integer") +public class IntegerType extends PrimitiveType { + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public IntegerType() { + // nothing + } + + /** + * Constructor + */ + public IntegerType(int theInteger) { + setValue(theInteger); + } + + /** + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation + */ + public IntegerType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * 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 Integer parse(String theValue) { + try { + return Integer.parseInt(theValue); + } catch (NumberFormatException e) { + throw new IllegalArgumentException(e); + } + } + + @Override + protected String encode(Integer theValue) { + return Integer.toString(theValue); + } + + @Override + public IntegerType copy() { + return new IntegerType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java index 00808e40f62..d6589277fa3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java @@ -20,863 +20,863 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A set of information summarized from a list of other resources. - */ -@ResourceDef(name="List_", profile="http://hl7.org/fhir/Profile/List_") -public class List_ extends DomainResource { - - 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. - */ - WORKING, - /** - * This list was prepared as a snapshot. It should not be assumed to be current. - */ - SNAPSHOT, - /** - * The list is prepared as a statement of changes that have been made or recommended. - */ - CHANGES, - /** - * added to help the parsers - */ - NULL; - - 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)) - return WORKING; - if ("snapshot".equals(codeString)) - return SNAPSHOT; - if ("changes".equals(codeString)) - return CHANGES; - throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case WORKING: return "working"; - case SNAPSHOT: return "snapshot"; - case CHANGES: return "changes"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case WORKING: return ""; - case SNAPSHOT: return ""; - case CHANGES: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes."; - case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current."; - case CHANGES: return "The list is prepared as a statement of changes that have been made or recommended."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case WORKING: return "working"; - case SNAPSHOT: return "snapshot"; - case CHANGES: return "changes"; - default: return "?"; - } - } - } - - public static class ListModeEnumFactory implements EnumFactory { - public ListMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("working".equals(codeString)) - return ListMode.WORKING; - if ("snapshot".equals(codeString)) - return ListMode.SNAPSHOT; - if ("changes".equals(codeString)) - return ListMode.CHANGES; - throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); - } - public String toCode(ListMode code) throws IllegalArgumentException { - if (code == ListMode.WORKING) - return "working"; - if (code == ListMode.SNAPSHOT) - return "snapshot"; - if (code == ListMode.CHANGES) - return "changes"; - return "?"; - } - } - - @Block() - public static class ListEntryComponent extends BackboneElement { - /** - * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list. - */ - @Child(name="flag", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Workflow information about this item", formalDefinition="The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list." ) - protected List flag; - - /** - * True if this item is marked as deleted in the list. - */ - @Child(name="deleted", type={BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." ) - protected BooleanType deleted; - - /** - * When this item was added to the list. - */ - @Child(name="date", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." ) - protected DateTimeType date; - - /** - * A reference to the actual resource from which data was derived. - */ - @Child(name="item", type={}, order=4, min=1, max=1) - @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.) - */ - protected Resource itemTarget; - - private static final long serialVersionUID = -27973283L; - - public ListEntryComponent() { - super(); - } - - public ListEntryComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) - */ - public List getFlag() { - if (this.flag == null) - this.flag = new ArrayList(); - return this.flag; - } - - public boolean hasFlag() { - if (this.flag == null) - return false; - for (CodeableConcept item : this.flag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) - */ - // syntactic sugar - public CodeableConcept addFlag() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.flag == null) - this.flag = new ArrayList(); - this.flag.add(t); - return t; - } - - /** - * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value - */ - public BooleanType getDeletedElement() { - if (this.deleted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.deleted"); - else if (Configuration.doAutoCreate()) - this.deleted = new BooleanType(); - return this.deleted; - } - - public boolean hasDeletedElement() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - public boolean hasDeleted() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - /** - * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value - */ - public ListEntryComponent setDeletedElement(BooleanType value) { - this.deleted = value; - return this; - } - - /** - * @return True if this item is marked as deleted in the list. - */ - public boolean getDeleted() { - return this.deleted == null ? false : this.deleted.getValue(); - } - - /** - * @param value True if this item is marked as deleted in the list. - */ - public ListEntryComponent setDeleted(boolean value) { - if (value == false) - this.deleted = null; - else { - if (this.deleted == null) - this.deleted = new BooleanType(); - this.deleted.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ListEntryComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When this item was added to the list. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When this item was added to the list. - */ - public ListEntryComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #item} (A reference to the actual resource from which data was derived.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (A reference to the actual resource from which data was derived.) - */ - public ListEntryComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} 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 reference to the actual resource from which data was derived.) - */ - public Resource getItemTarget() { - return this.itemTarget; - } - - /** - * @param value {@link #item} 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 reference to the actual resource from which data was derived.) - */ - public ListEntryComponent setItemTarget(Resource value) { - this.itemTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.", 0, java.lang.Integer.MAX_VALUE, flag)); - childrenList.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, java.lang.Integer.MAX_VALUE, deleted)); - childrenList.add(new Property("date", "dateTime", "When this item was added to the list.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public ListEntryComponent copy() { - ListEntryComponent dst = new ListEntryComponent(); - copyValues(dst); - if (flag != null) { - dst.flag = new ArrayList(); - for (CodeableConcept i : flag) - dst.flag.add(i.copy()); - }; - dst.deleted = deleted == null ? null : deleted.copy(); - dst.date = date == null ? null : date.copy(); - dst.item = item == null ? null : item.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (flag == null || flag.isEmpty()) && (deleted == null || deleted.isEmpty()) - && (date == null || date.isEmpty()) && (item == null || item.isEmpty()); - } - - } - - /** - * Identifier for the List assigned for business purposes outside the context of FHIR. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." ) - protected List identifier; - - /** - * This code defines the purpose of the list - why it was created. - */ - @Child(name="code", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." ) - protected CodeableConcept code; - - /** - * The common subject (or patient) of the resources that are in the list, if there is one. - */ - @Child(name="subject", type={Patient.class, Group.class, Device.class, Location.class}, order=1, min=0, max=1) - @Description(shortDefinition="If all resources have the same subject", formalDefinition="The common subject (or patient) of the resources that are in the list, if there is one." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - protected Resource subjectTarget; - - /** - * The entity responsible for deciding what the contents of the list were. - */ - @Child(name="source", type={Practitioner.class, Patient.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who and/or what defined the list contents", formalDefinition="The entity responsible for deciding what the contents of the list were." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were.) - */ - protected Resource sourceTarget; - - /** - * The date that the list was prepared. - */ - @Child(name="date", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." ) - protected DateTimeType date; - - /** - * Whether items in the list have a meaningful order. - */ - @Child(name="ordered", type={BooleanType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Whether items in the list have a meaningful order", formalDefinition="Whether items in the list have a meaningful order." ) - protected BooleanType ordered; - - /** - * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. - */ - @Child(name="mode", type={CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="working | snapshot | changes", formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." ) - protected Enumeration mode; - - /** - * Entries in this list. - */ - @Child(name="entry", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." ) - protected List entry; - - /** - * If the list is empty, why the list is empty. - */ - @Child(name="emptyReason", type={CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." ) - protected CodeableConcept emptyReason; - - private static final long serialVersionUID = 1475323442L; - - public List_() { - super(); - } - - public List_(Enumeration mode) { - super(); - this.mode = mode; - } - - /** - * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier for the List assigned for business purposes outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #code} (This code defines the purpose of the list - why it was created.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (This code defines the purpose of the list - why it was created.) - */ - public List_ setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.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 common subject (or patient) of the resources that are in the list, if there is one.) - */ - public List_ 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 common subject (or patient) of the resources that are in the list, if there is one.) - */ - public Resource getSubjectTarget() { - 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 common subject (or patient) of the resources that are in the list, if there is one.) - */ - public List_ setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #source} (The entity responsible for deciding what the contents of the list were.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The entity responsible for deciding what the contents of the list were.) - */ - public List_ setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} 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 responsible for deciding what the contents of the list were.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} 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 responsible for deciding what the contents of the list were.) - */ - public List_ setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public List_ setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the list was prepared. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the list was prepared. - */ - public List_ setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #ordered} (Whether items in the list have a meaningful order.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public BooleanType getOrderedElement() { - if (this.ordered == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.ordered"); - else if (Configuration.doAutoCreate()) - this.ordered = new BooleanType(); - return this.ordered; - } - - public boolean hasOrderedElement() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - public boolean hasOrdered() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - /** - * @param value {@link #ordered} (Whether items in the list have a meaningful order.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public List_ setOrderedElement(BooleanType value) { - this.ordered = value; - return this; - } - - /** - * @return Whether items in the list have a meaningful order. - */ - public boolean getOrdered() { - return this.ordered == null ? false : this.ordered.getValue(); - } - - /** - * @param value Whether items in the list have a meaningful order. - */ - public List_ setOrdered(boolean value) { - if (value == false) - this.ordered = null; - else { - if (this.ordered == null) - this.ordered = new BooleanType(); - this.ordered.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public List_ setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. - */ - public ListMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. - */ - public List_ setMode(ListMode value) { - if (this.mode == null) - this.mode = new Enumeration(ListMode.ENUM_FACTORY); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #entry} (Entries in this list.) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (ListEntryComponent item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (Entries in this list.) - */ - // syntactic sugar - public ListEntryComponent addEntry() { //3 - ListEntryComponent t = new ListEntryComponent(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - /** - * @return {@link #emptyReason} (If the list is empty, why the list is empty.) - */ - public CodeableConcept getEmptyReason() { - if (this.emptyReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create List_.emptyReason"); - else if (Configuration.doAutoCreate()) - this.emptyReason = new CodeableConcept(); - return this.emptyReason; - } - - public boolean hasEmptyReason() { - return this.emptyReason != null && !this.emptyReason.isEmpty(); - } - - /** - * @param value {@link #emptyReason} (If the list is empty, why the list is empty.) - */ - public List_ setEmptyReason(CodeableConcept value) { - this.emptyReason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list, if there is one.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("source", "Reference(Practitioner|Patient|Device)", "The entity responsible for deciding what the contents of the list were.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("ordered", "boolean", "Whether items in the list have a meaningful order.", 0, java.lang.Integer.MAX_VALUE, ordered)); - childrenList.add(new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); - } - - public List_ copy() { - List_ dst = new List_(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.source = source == null ? null : source.copy(); - dst.date = date == null ? null : date.copy(); - dst.ordered = ordered == null ? null : ordered.copy(); - dst.mode = mode == null ? null : mode.copy(); - if (entry != null) { - dst.entry = new ArrayList(); - for (ListEntryComponent i : entry) - dst.entry.add(i.copy()); - }; - dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); - return dst; - } - - protected List_ typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (date == null || date.isEmpty()) - && (ordered == null || ordered.isEmpty()) && (mode == null || mode.isEmpty()) && (entry == null || entry.isEmpty()) - && (emptyReason == null || emptyReason.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.List; - } - - @SearchParamDefinition(name="patient", path="List.subject", description="If all resources have the same subject", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" ) - public static final String SP_ITEM = "item"; - @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" ) - public static final String SP_EMPTYREASON = "empty-reason"; - -} - + +/* + 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; +/** + * A set of information summarized from a list of other resources. + */ +@ResourceDef(name="List_", profile="http://hl7.org/fhir/Profile/List_") +public class List_ extends DomainResource { + + 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. + */ + WORKING, + /** + * This list was prepared as a snapshot. It should not be assumed to be current. + */ + SNAPSHOT, + /** + * The list is prepared as a statement of changes that have been made or recommended. + */ + CHANGES, + /** + * added to help the parsers + */ + NULL; + + 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)) + return WORKING; + if ("snapshot".equals(codeString)) + return SNAPSHOT; + if ("changes".equals(codeString)) + return CHANGES; + throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case WORKING: return "working"; + case SNAPSHOT: return "snapshot"; + case CHANGES: return "changes"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case WORKING: return ""; + case SNAPSHOT: return ""; + case CHANGES: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes."; + case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current."; + case CHANGES: return "The list is prepared as a statement of changes that have been made or recommended."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case WORKING: return "working"; + case SNAPSHOT: return "snapshot"; + case CHANGES: return "changes"; + default: return "?"; + } + } + } + + public static class ListModeEnumFactory implements EnumFactory { + public ListMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("working".equals(codeString)) + return ListMode.WORKING; + if ("snapshot".equals(codeString)) + return ListMode.SNAPSHOT; + if ("changes".equals(codeString)) + return ListMode.CHANGES; + throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); + } + public String toCode(ListMode code) throws IllegalArgumentException { + if (code == ListMode.WORKING) + return "working"; + if (code == ListMode.SNAPSHOT) + return "snapshot"; + if (code == ListMode.CHANGES) + return "changes"; + return "?"; + } + } + + @Block() + public static class ListEntryComponent extends BackboneElement { + /** + * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list. + */ + @Child(name="flag", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Workflow information about this item", formalDefinition="The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list." ) + protected List flag; + + /** + * True if this item is marked as deleted in the list. + */ + @Child(name="deleted", type={BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." ) + protected BooleanType deleted; + + /** + * When this item was added to the list. + */ + @Child(name="date", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." ) + protected DateTimeType date; + + /** + * A reference to the actual resource from which data was derived. + */ + @Child(name="item", type={}, order=4, min=1, max=1) + @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.) + */ + protected Resource itemTarget; + + private static final long serialVersionUID = -27973283L; + + public ListEntryComponent() { + super(); + } + + public ListEntryComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) + */ + public List getFlag() { + if (this.flag == null) + this.flag = new ArrayList(); + return this.flag; + } + + public boolean hasFlag() { + if (this.flag == null) + return false; + for (CodeableConcept item : this.flag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #flag} (The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.) + */ + // syntactic sugar + public CodeableConcept addFlag() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.flag == null) + this.flag = new ArrayList(); + this.flag.add(t); + return t; + } + + /** + * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value + */ + public BooleanType getDeletedElement() { + if (this.deleted == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.deleted"); + else if (Configuration.doAutoCreate()) + this.deleted = new BooleanType(); + return this.deleted; + } + + public boolean hasDeletedElement() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + public boolean hasDeleted() { + return this.deleted != null && !this.deleted.isEmpty(); + } + + /** + * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value + */ + public ListEntryComponent setDeletedElement(BooleanType value) { + this.deleted = value; + return this; + } + + /** + * @return True if this item is marked as deleted in the list. + */ + public boolean getDeleted() { + return this.deleted == null ? false : this.deleted.getValue(); + } + + /** + * @param value True if this item is marked as deleted in the list. + */ + public ListEntryComponent setDeleted(boolean value) { + if (value == false) + this.deleted = null; + else { + if (this.deleted == null) + this.deleted = new BooleanType(); + this.deleted.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ListEntryComponent setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When this item was added to the list. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When this item was added to the list. + */ + public ListEntryComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #item} (A reference to the actual resource from which data was derived.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ListEntryComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (A reference to the actual resource from which data was derived.) + */ + public ListEntryComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} 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 reference to the actual resource from which data was derived.) + */ + public Resource getItemTarget() { + return this.itemTarget; + } + + /** + * @param value {@link #item} 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 reference to the actual resource from which data was derived.) + */ + public ListEntryComponent setItemTarget(Resource value) { + this.itemTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list.", 0, java.lang.Integer.MAX_VALUE, flag)); + childrenList.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, java.lang.Integer.MAX_VALUE, deleted)); + childrenList.add(new Property("date", "dateTime", "When this item was added to the list.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public ListEntryComponent copy() { + ListEntryComponent dst = new ListEntryComponent(); + copyValues(dst); + if (flag != null) { + dst.flag = new ArrayList(); + for (CodeableConcept i : flag) + dst.flag.add(i.copy()); + }; + dst.deleted = deleted == null ? null : deleted.copy(); + dst.date = date == null ? null : date.copy(); + dst.item = item == null ? null : item.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (flag == null || flag.isEmpty()) && (deleted == null || deleted.isEmpty()) + && (date == null || date.isEmpty()) && (item == null || item.isEmpty()); + } + + } + + /** + * Identifier for the List assigned for business purposes outside the context of FHIR. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." ) + protected List identifier; + + /** + * This code defines the purpose of the list - why it was created. + */ + @Child(name="code", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." ) + protected CodeableConcept code; + + /** + * The common subject (or patient) of the resources that are in the list, if there is one. + */ + @Child(name="subject", type={Patient.class, Group.class, Device.class, Location.class}, order=1, min=0, max=1) + @Description(shortDefinition="If all resources have the same subject", formalDefinition="The common subject (or patient) of the resources that are in the list, if there is one." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + protected Resource subjectTarget; + + /** + * The entity responsible for deciding what the contents of the list were. + */ + @Child(name="source", type={Practitioner.class, Patient.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who and/or what defined the list contents", formalDefinition="The entity responsible for deciding what the contents of the list were." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were.) + */ + protected Resource sourceTarget; + + /** + * The date that the list was prepared. + */ + @Child(name="date", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." ) + protected DateTimeType date; + + /** + * Whether items in the list have a meaningful order. + */ + @Child(name="ordered", type={BooleanType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Whether items in the list have a meaningful order", formalDefinition="Whether items in the list have a meaningful order." ) + protected BooleanType ordered; + + /** + * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + @Child(name="mode", type={CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="working | snapshot | changes", formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." ) + protected Enumeration mode; + + /** + * Entries in this list. + */ + @Child(name="entry", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." ) + protected List entry; + + /** + * If the list is empty, why the list is empty. + */ + @Child(name="emptyReason", type={CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." ) + protected CodeableConcept emptyReason; + + private static final long serialVersionUID = 1475323442L; + + public List_() { + super(); + } + + public List_(Enumeration mode) { + super(); + this.mode = mode; + } + + /** + * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier for the List assigned for business purposes outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #code} (This code defines the purpose of the list - why it was created.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (This code defines the purpose of the list - why it was created.) + */ + public List_ setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.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 common subject (or patient) of the resources that are in the list, if there is one.) + */ + public List_ 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 common subject (or patient) of the resources that are in the list, if there is one.) + */ + public Resource getSubjectTarget() { + 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 common subject (or patient) of the resources that are in the list, if there is one.) + */ + public List_ setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #source} (The entity responsible for deciding what the contents of the list were.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The entity responsible for deciding what the contents of the list were.) + */ + public List_ setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} 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 responsible for deciding what the contents of the list were.) + */ + public Resource getSourceTarget() { + return this.sourceTarget; + } + + /** + * @param value {@link #source} 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 responsible for deciding what the contents of the list were.) + */ + public List_ setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public List_ setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the list was prepared. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the list was prepared. + */ + public List_ setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #ordered} (Whether items in the list have a meaningful order.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public BooleanType getOrderedElement() { + if (this.ordered == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.ordered"); + else if (Configuration.doAutoCreate()) + this.ordered = new BooleanType(); + return this.ordered; + } + + public boolean hasOrderedElement() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + public boolean hasOrdered() { + return this.ordered != null && !this.ordered.isEmpty(); + } + + /** + * @param value {@link #ordered} (Whether items in the list have a meaningful order.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value + */ + public List_ setOrderedElement(BooleanType value) { + this.ordered = value; + return this; + } + + /** + * @return Whether items in the list have a meaningful order. + */ + public boolean getOrdered() { + return this.ordered == null ? false : this.ordered.getValue(); + } + + /** + * @param value Whether items in the list have a meaningful order. + */ + public List_ setOrdered(boolean value) { + if (value == false) + this.ordered = null; + else { + if (this.ordered == null) + this.ordered = new BooleanType(); + this.ordered.setValue(value); + } + return this; + } + + /** + * @return {@link #mode} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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} (How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public List_ setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public ListMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + */ + public List_ setMode(ListMode value) { + if (this.mode == null) + this.mode = new Enumeration(ListMode.ENUM_FACTORY); + this.mode.setValue(value); + return this; + } + + /** + * @return {@link #entry} (Entries in this list.) + */ + public List getEntry() { + if (this.entry == null) + this.entry = new ArrayList(); + return this.entry; + } + + public boolean hasEntry() { + if (this.entry == null) + return false; + for (ListEntryComponent item : this.entry) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entry} (Entries in this list.) + */ + // syntactic sugar + public ListEntryComponent addEntry() { //3 + ListEntryComponent t = new ListEntryComponent(); + if (this.entry == null) + this.entry = new ArrayList(); + this.entry.add(t); + return t; + } + + /** + * @return {@link #emptyReason} (If the list is empty, why the list is empty.) + */ + public CodeableConcept getEmptyReason() { + if (this.emptyReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create List_.emptyReason"); + else if (Configuration.doAutoCreate()) + this.emptyReason = new CodeableConcept(); + return this.emptyReason; + } + + public boolean hasEmptyReason() { + return this.emptyReason != null && !this.emptyReason.isEmpty(); + } + + /** + * @param value {@link #emptyReason} (If the list is empty, why the list is empty.) + */ + public List_ setEmptyReason(CodeableConcept value) { + this.emptyReason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list, if there is one.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("source", "Reference(Practitioner|Patient|Device)", "The entity responsible for deciding what the contents of the list were.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("ordered", "boolean", "Whether items in the list have a meaningful order.", 0, java.lang.Integer.MAX_VALUE, ordered)); + childrenList.add(new Property("mode", "code", "How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry)); + childrenList.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); + } + + public List_ copy() { + List_ dst = new List_(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.source = source == null ? null : source.copy(); + dst.date = date == null ? null : date.copy(); + dst.ordered = ordered == null ? null : ordered.copy(); + dst.mode = mode == null ? null : mode.copy(); + if (entry != null) { + dst.entry = new ArrayList(); + for (ListEntryComponent i : entry) + dst.entry.add(i.copy()); + }; + dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); + return dst; + } + + protected List_ typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (date == null || date.isEmpty()) + && (ordered == null || ordered.isEmpty()) && (mode == null || mode.isEmpty()) && (entry == null || entry.isEmpty()) + && (emptyReason == null || emptyReason.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.List; + } + + @SearchParamDefinition(name="patient", path="List.subject", description="If all resources have the same subject", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" ) + public static final String SP_ITEM = "item"; + @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" ) + public static final String SP_EMPTYREASON = "empty-reason"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java index f6817803b06..b8347c43062 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java @@ -20,1034 +20,1034 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. - */ -@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") -public class Location extends DomainResource { - - public enum LocationStatus implements FhirEnum { - /** - * The location is operational. - */ - ACTIVE, - /** - * The location is temporarily closed. - */ - SUSPENDED, - /** - * The location is no longer used. - */ - INACTIVE, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ACTIVE; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("inactive".equals(codeString)) - return INACTIVE; - throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case SUSPENDED: return "suspended"; - case INACTIVE: return "inactive"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return ""; - case SUSPENDED: return ""; - case INACTIVE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The location is operational."; - case SUSPENDED: return "The location is temporarily closed."; - case INACTIVE: return "The location is no longer used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "active"; - case SUSPENDED: return "suspended"; - case INACTIVE: return "inactive"; - default: return "?"; - } - } - } - - public static class LocationStatusEnumFactory implements EnumFactory { - public LocationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return LocationStatus.ACTIVE; - if ("suspended".equals(codeString)) - return LocationStatus.SUSPENDED; - if ("inactive".equals(codeString)) - return LocationStatus.INACTIVE; - throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); - } - public String toCode(LocationStatus code) throws IllegalArgumentException { - if (code == LocationStatus.ACTIVE) - return "active"; - if (code == LocationStatus.SUSPENDED) - return "suspended"; - if (code == LocationStatus.INACTIVE) - return "inactive"; - return "?"; - } - } - - public enum LocationMode implements FhirEnum { - /** - * The Location resource represents a specific instance of a Location. - */ - INSTANCE, - /** - * The Location represents a class of Locations. - */ - KIND, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case INSTANCE: return "instance"; - case KIND: return "kind"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INSTANCE: return ""; - case KIND: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INSTANCE: return "The Location resource represents a specific instance of a Location."; - case KIND: return "The Location represents a class of Locations."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INSTANCE: return "instance"; - case KIND: return "kind"; - default: return "?"; - } - } - } - - public static class LocationModeEnumFactory implements EnumFactory { - public LocationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return LocationMode.INSTANCE; - if ("kind".equals(codeString)) - return LocationMode.KIND; - throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); - } - public String toCode(LocationMode code) throws IllegalArgumentException { - if (code == LocationMode.INSTANCE) - return "instance"; - if (code == LocationMode.KIND) - return "kind"; - return "?"; - } - } - - @Block() - public static class LocationPositionComponent extends BackboneElement { - /** - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - @Child(name="longitude", type={DecimalType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Longitude as expressed in KML", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." ) - protected DecimalType longitude; - - /** - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - @Child(name="latitude", type={DecimalType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Latitude as expressed in KML", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." ) - protected DecimalType latitude; - - /** - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - @Child(name="altitude", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Altitude as expressed in KML", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." ) - protected DecimalType altitude; - - private static final long serialVersionUID = -74276134L; - - public LocationPositionComponent() { - super(); - } - - public LocationPositionComponent(DecimalType longitude, DecimalType latitude) { - super(); - this.longitude = longitude; - this.latitude = latitude; - } - - /** - * @return {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value - */ - public DecimalType getLongitudeElement() { - if (this.longitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.longitude"); - else if (Configuration.doAutoCreate()) - this.longitude = new DecimalType(); - return this.longitude; - } - - public boolean hasLongitudeElement() { - return this.longitude != null && !this.longitude.isEmpty(); - } - - public boolean hasLongitude() { - return this.longitude != null && !this.longitude.isEmpty(); - } - - /** - * @param value {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value - */ - public LocationPositionComponent setLongitudeElement(DecimalType value) { - this.longitude = value; - return this; - } - - /** - * @return Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public BigDecimal getLongitude() { - return this.longitude == null ? null : this.longitude.getValue(); - } - - /** - * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public LocationPositionComponent setLongitude(BigDecimal value) { - if (this.longitude == null) - this.longitude = new DecimalType(); - this.longitude.setValue(value); - return this; - } - - /** - * @return {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value - */ - public DecimalType getLatitudeElement() { - if (this.latitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.latitude"); - else if (Configuration.doAutoCreate()) - this.latitude = new DecimalType(); - return this.latitude; - } - - public boolean hasLatitudeElement() { - return this.latitude != null && !this.latitude.isEmpty(); - } - - public boolean hasLatitude() { - return this.latitude != null && !this.latitude.isEmpty(); - } - - /** - * @param value {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value - */ - public LocationPositionComponent setLatitudeElement(DecimalType value) { - this.latitude = value; - return this; - } - - /** - * @return Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public BigDecimal getLatitude() { - return this.latitude == null ? null : this.latitude.getValue(); - } - - /** - * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public LocationPositionComponent setLatitude(BigDecimal value) { - if (this.latitude == null) - this.latitude = new DecimalType(); - this.latitude.setValue(value); - return this; - } - - /** - * @return {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value - */ - public DecimalType getAltitudeElement() { - if (this.altitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.altitude"); - else if (Configuration.doAutoCreate()) - this.altitude = new DecimalType(); - return this.altitude; - } - - public boolean hasAltitudeElement() { - return this.altitude != null && !this.altitude.isEmpty(); - } - - public boolean hasAltitude() { - return this.altitude != null && !this.altitude.isEmpty(); - } - - /** - * @param value {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value - */ - public LocationPositionComponent setAltitudeElement(DecimalType value) { - this.altitude = value; - return this; - } - - /** - * @return Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public BigDecimal getAltitude() { - return this.altitude == null ? null : this.altitude.getValue(); - } - - /** - * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public LocationPositionComponent setAltitude(BigDecimal value) { - if (value == null) - this.altitude = null; - else { - if (this.altitude == null) - this.altitude = new DecimalType(); - this.altitude.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("longitude", "decimal", "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, longitude)); - childrenList.add(new Property("latitude", "decimal", "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, latitude)); - childrenList.add(new Property("altitude", "decimal", "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, altitude)); - } - - public LocationPositionComponent copy() { - LocationPositionComponent dst = new LocationPositionComponent(); - copyValues(dst); - dst.longitude = longitude == null ? null : longitude.copy(); - dst.latitude = latitude == null ? null : latitude.copy(); - dst.altitude = altitude == null ? null : altitude.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty()) - && (altitude == null || altitude.isEmpty()); - } - - } - - /** - * Unique code or number identifying the location to its users. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." ) - protected List identifier; - - /** - * Name of the location as used by humans. Does not need to be unique. - */ - @Child(name="name", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Name of the location as used by humans", formalDefinition="Name of the location as used by humans. Does not need to be unique." ) - protected StringType name; - - /** - * Description of the Location, which helps in finding or referencing the place. - */ - @Child(name="description", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Description of the Location, which helps in finding or referencing the place", formalDefinition="Description of the Location, which helps in finding or referencing the place." ) - protected StringType description; - - /** - * Indicates the type of function performed at the location. - */ - @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Indicates the type of function performed at the location", formalDefinition="Indicates the type of function performed at the location." ) - protected CodeableConcept type; - - /** - * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details of the location", formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites." ) - protected List telecom; - - /** - * Physical location. - */ - @Child(name="address", type={Address.class}, order=4, min=0, max=1) - @Description(shortDefinition="Physical location", formalDefinition="Physical location." ) - protected Address address; - - /** - * Physical form of the location, e.g. building, room, vehicle, road. - */ - @Child(name="physicalType", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." ) - protected CodeableConcept physicalType; - - /** - * The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML). - */ - @Child(name="position", type={}, order=6, min=0, max=1) - @Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML)." ) - protected LocationPositionComponent position; - - /** - * The organization that is responsible for the provisioning and upkeep of the location. - */ - @Child(name="managingOrganization", type={Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="The organization that is responsible for the provisioning and upkeep of the location", formalDefinition="The organization that is responsible for the provisioning and upkeep of the location." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization that is responsible for the provisioning and upkeep of the location.) - */ - protected Organization managingOrganizationTarget; - - /** - * active | suspended | inactive. - */ - @Child(name="status", type={CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." ) - protected Enumeration status; - - /** - * Another Location which this Location is physically part of. - */ - @Child(name="partOf", type={Location.class}, order=9, min=0, max=1) - @Description(shortDefinition="Another Location which this Location is physically part of", formalDefinition="Another Location which this Location is physically part of." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (Another Location which this Location is physically part of.) - */ - protected Location partOfTarget; - - /** - * Indicates whether a resource instance represents a specific location or a class of locations. - */ - @Child(name="mode", type={CodeType.class}, order=10, min=0, max=1) - @Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." ) - protected Enumeration mode; - - private static final long serialVersionUID = -1202061661L; - - public Location() { - super(); - } - - /** - * @return {@link #identifier} (Unique code or number identifying the location to its users.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Unique code or number identifying the location to its users.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Location setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name of the location as used by humans. Does not need to be unique. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name of the location as used by humans. Does not need to be unique. - */ - public Location setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Description of the Location, which helps in finding or referencing the place.). 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 Location.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} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Location setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of the Location, which helps in finding or referencing the place. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of the Location, which helps in finding or referencing the place. - */ - public Location setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Indicates the type of function performed at the location.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of function performed at the location.) - */ - public Location setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #address} (Physical location.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Physical location.) - */ - public Location setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) - */ - public CodeableConcept getPhysicalType() { - if (this.physicalType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.physicalType"); - else if (Configuration.doAutoCreate()) - this.physicalType = new CodeableConcept(); - return this.physicalType; - } - - public boolean hasPhysicalType() { - return this.physicalType != null && !this.physicalType.isEmpty(); - } - - /** - * @param value {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) - */ - public Location setPhysicalType(CodeableConcept value) { - this.physicalType = value; - return this; - } - - /** - * @return {@link #position} (The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).) - */ - public LocationPositionComponent getPosition() { - if (this.position == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.position"); - else if (Configuration.doAutoCreate()) - this.position = new LocationPositionComponent(); - return this.position; - } - - public boolean hasPosition() { - return this.position != null && !this.position.isEmpty(); - } - - /** - * @param value {@link #position} (The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).) - */ - public Location setPosition(LocationPositionComponent value) { - this.position = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) - */ - public Location setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} 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 organization that is responsible for the provisioning and upkeep of the location.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} 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 that is responsible for the provisioning and upkeep of the location.) - */ - public Location setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Location setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return active | suspended | inactive. - */ - public LocationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value active | suspended | inactive. - */ - public Location setStatus(LocationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(LocationStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #partOf} (Another Location which this Location is physically part of.) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (Another Location which this Location is physically part of.) - */ - public Location setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} 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. (Another Location which this Location is physically part of.) - */ - public Location getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Location(); - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} 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. (Another Location which this Location is physically part of.) - */ - public Location setPartOfTarget(Location value) { - this.partOfTarget = value; - return this; - } - - /** - * @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Location setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Indicates whether a resource instance represents a specific location or a class of locations. - */ - public LocationMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Indicates whether a resource instance represents a specific location or a class of locations. - */ - public Location setMode(LocationMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(LocationMode.ENUM_FACTORY); - this.mode.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType)); - childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).", 0, java.lang.Integer.MAX_VALUE, position)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); - childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode)); - } - - public Location copy() { - Location dst = new Location(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.type = type == null ? null : type.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.physicalType = physicalType == null ? null : physicalType.copy(); - dst.position = position == null ? null : position.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.status = status == null ? null : status.copy(); - dst.partOf = partOf == null ? null : partOf.copy(); - dst.mode = mode == null ? null : mode.copy(); - return dst; - } - - protected Location typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (description == null || description.isEmpty()) && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (address == null || address.isEmpty()) && (physicalType == null || physicalType.isEmpty()) - && (position == null || position.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (status == null || status.isEmpty()) && (partOf == null || partOf.isEmpty()) && (mode == null || mode.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Location; - } - - @SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="near", path="", description="The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" ) - public static final String SP_NEAR = "near"; - @SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" ) - public static final String SP_PARTOF = "partof"; - @SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="near-distance", path="", description="A distance quantity to limit the near search to locations within a specific distance", type="token" ) - public static final String SP_NEARDISTANCE = "near-distance"; - @SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ +@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") +public class Location extends DomainResource { + + public enum LocationStatus implements FhirEnum { + /** + * The location is operational. + */ + ACTIVE, + /** + * The location is temporarily closed. + */ + SUSPENDED, + /** + * The location is no longer used. + */ + INACTIVE, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ACTIVE; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("inactive".equals(codeString)) + return INACTIVE; + throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case SUSPENDED: return "suspended"; + case INACTIVE: return "inactive"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return ""; + case SUSPENDED: return ""; + case INACTIVE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The location is operational."; + case SUSPENDED: return "The location is temporarily closed."; + case INACTIVE: return "The location is no longer used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "active"; + case SUSPENDED: return "suspended"; + case INACTIVE: return "inactive"; + default: return "?"; + } + } + } + + public static class LocationStatusEnumFactory implements EnumFactory { + public LocationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return LocationStatus.ACTIVE; + if ("suspended".equals(codeString)) + return LocationStatus.SUSPENDED; + if ("inactive".equals(codeString)) + return LocationStatus.INACTIVE; + throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); + } + public String toCode(LocationStatus code) throws IllegalArgumentException { + if (code == LocationStatus.ACTIVE) + return "active"; + if (code == LocationStatus.SUSPENDED) + return "suspended"; + if (code == LocationStatus.INACTIVE) + return "inactive"; + return "?"; + } + } + + public enum LocationMode implements FhirEnum { + /** + * The Location resource represents a specific instance of a Location. + */ + INSTANCE, + /** + * The Location represents a class of Locations. + */ + KIND, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INSTANCE: return "instance"; + case KIND: return "kind"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INSTANCE: return ""; + case KIND: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INSTANCE: return "The Location resource represents a specific instance of a Location."; + case KIND: return "The Location represents a class of Locations."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INSTANCE: return "instance"; + case KIND: return "kind"; + default: return "?"; + } + } + } + + public static class LocationModeEnumFactory implements EnumFactory { + public LocationMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("instance".equals(codeString)) + return LocationMode.INSTANCE; + if ("kind".equals(codeString)) + return LocationMode.KIND; + throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); + } + public String toCode(LocationMode code) throws IllegalArgumentException { + if (code == LocationMode.INSTANCE) + return "instance"; + if (code == LocationMode.KIND) + return "kind"; + return "?"; + } + } + + @Block() + public static class LocationPositionComponent extends BackboneElement { + /** + * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + @Child(name="longitude", type={DecimalType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Longitude as expressed in KML", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." ) + protected DecimalType longitude; + + /** + * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + @Child(name="latitude", type={DecimalType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Latitude as expressed in KML", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." ) + protected DecimalType latitude; + + /** + * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + @Child(name="altitude", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Altitude as expressed in KML", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." ) + protected DecimalType altitude; + + private static final long serialVersionUID = -74276134L; + + public LocationPositionComponent() { + super(); + } + + public LocationPositionComponent(DecimalType longitude, DecimalType latitude) { + super(); + this.longitude = longitude; + this.latitude = latitude; + } + + /** + * @return {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value + */ + public DecimalType getLongitudeElement() { + if (this.longitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.longitude"); + else if (Configuration.doAutoCreate()) + this.longitude = new DecimalType(); + return this.longitude; + } + + public boolean hasLongitudeElement() { + return this.longitude != null && !this.longitude.isEmpty(); + } + + public boolean hasLongitude() { + return this.longitude != null && !this.longitude.isEmpty(); + } + + /** + * @param value {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value + */ + public LocationPositionComponent setLongitudeElement(DecimalType value) { + this.longitude = value; + return this; + } + + /** + * @return Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public BigDecimal getLongitude() { + return this.longitude == null ? null : this.longitude.getValue(); + } + + /** + * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + */ + public LocationPositionComponent setLongitude(BigDecimal value) { + if (this.longitude == null) + this.longitude = new DecimalType(); + this.longitude.setValue(value); + return this; + } + + /** + * @return {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value + */ + public DecimalType getLatitudeElement() { + if (this.latitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.latitude"); + else if (Configuration.doAutoCreate()) + this.latitude = new DecimalType(); + return this.latitude; + } + + public boolean hasLatitudeElement() { + return this.latitude != null && !this.latitude.isEmpty(); + } + + public boolean hasLatitude() { + return this.latitude != null && !this.latitude.isEmpty(); + } + + /** + * @param value {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value + */ + public LocationPositionComponent setLatitudeElement(DecimalType value) { + this.latitude = value; + return this; + } + + /** + * @return Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public BigDecimal getLatitude() { + return this.latitude == null ? null : this.latitude.getValue(); + } + + /** + * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + */ + public LocationPositionComponent setLatitude(BigDecimal value) { + if (this.latitude == null) + this.latitude = new DecimalType(); + this.latitude.setValue(value); + return this; + } + + /** + * @return {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value + */ + public DecimalType getAltitudeElement() { + if (this.altitude == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create LocationPositionComponent.altitude"); + else if (Configuration.doAutoCreate()) + this.altitude = new DecimalType(); + return this.altitude; + } + + public boolean hasAltitudeElement() { + return this.altitude != null && !this.altitude.isEmpty(); + } + + public boolean hasAltitude() { + return this.altitude != null && !this.altitude.isEmpty(); + } + + /** + * @param value {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value + */ + public LocationPositionComponent setAltitudeElement(DecimalType value) { + this.altitude = value; + return this; + } + + /** + * @return Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public BigDecimal getAltitude() { + return this.altitude == null ? null : this.altitude.getValue(); + } + + /** + * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + */ + public LocationPositionComponent setAltitude(BigDecimal value) { + if (value == null) + this.altitude = null; + else { + if (this.altitude == null) + this.altitude = new DecimalType(); + this.altitude.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("longitude", "decimal", "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, longitude)); + childrenList.add(new Property("latitude", "decimal", "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, latitude)); + childrenList.add(new Property("altitude", "decimal", "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, altitude)); + } + + public LocationPositionComponent copy() { + LocationPositionComponent dst = new LocationPositionComponent(); + copyValues(dst); + dst.longitude = longitude == null ? null : longitude.copy(); + dst.latitude = latitude == null ? null : latitude.copy(); + dst.altitude = altitude == null ? null : altitude.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty()) + && (altitude == null || altitude.isEmpty()); + } + + } + + /** + * Unique code or number identifying the location to its users. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." ) + protected List identifier; + + /** + * Name of the location as used by humans. Does not need to be unique. + */ + @Child(name="name", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Name of the location as used by humans", formalDefinition="Name of the location as used by humans. Does not need to be unique." ) + protected StringType name; + + /** + * Description of the Location, which helps in finding or referencing the place. + */ + @Child(name="description", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Description of the Location, which helps in finding or referencing the place", formalDefinition="Description of the Location, which helps in finding or referencing the place." ) + protected StringType description; + + /** + * Indicates the type of function performed at the location. + */ + @Child(name="type", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Indicates the type of function performed at the location", formalDefinition="Indicates the type of function performed at the location." ) + protected CodeableConcept type; + + /** + * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details of the location", formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites." ) + protected List telecom; + + /** + * Physical location. + */ + @Child(name="address", type={Address.class}, order=4, min=0, max=1) + @Description(shortDefinition="Physical location", formalDefinition="Physical location." ) + protected Address address; + + /** + * Physical form of the location, e.g. building, room, vehicle, road. + */ + @Child(name="physicalType", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." ) + protected CodeableConcept physicalType; + + /** + * The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML). + */ + @Child(name="position", type={}, order=6, min=0, max=1) + @Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML)." ) + protected LocationPositionComponent position; + + /** + * The organization that is responsible for the provisioning and upkeep of the location. + */ + @Child(name="managingOrganization", type={Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="The organization that is responsible for the provisioning and upkeep of the location", formalDefinition="The organization that is responsible for the provisioning and upkeep of the location." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The organization that is responsible for the provisioning and upkeep of the location.) + */ + protected Organization managingOrganizationTarget; + + /** + * active | suspended | inactive. + */ + @Child(name="status", type={CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." ) + protected Enumeration status; + + /** + * Another Location which this Location is physically part of. + */ + @Child(name="partOf", type={Location.class}, order=9, min=0, max=1) + @Description(shortDefinition="Another Location which this Location is physically part of", formalDefinition="Another Location which this Location is physically part of." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (Another Location which this Location is physically part of.) + */ + protected Location partOfTarget; + + /** + * Indicates whether a resource instance represents a specific location or a class of locations. + */ + @Child(name="mode", type={CodeType.class}, order=10, min=0, max=1) + @Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." ) + protected Enumeration mode; + + private static final long serialVersionUID = -1202061661L; + + public Location() { + super(); + } + + /** + * @return {@link #identifier} (Unique code or number identifying the location to its users.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Unique code or number identifying the location to its users.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Location setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Name of the location as used by humans. Does not need to be unique. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Name of the location as used by humans. Does not need to be unique. + */ + public Location setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Description of the Location, which helps in finding or referencing the place.). 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 Location.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} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Location setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Description of the Location, which helps in finding or referencing the place. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Description of the Location, which helps in finding or referencing the place. + */ + public Location setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Indicates the type of function performed at the location.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of function performed at the location.) + */ + public Location setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #address} (Physical location.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Physical location.) + */ + public Location setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) + */ + public CodeableConcept getPhysicalType() { + if (this.physicalType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.physicalType"); + else if (Configuration.doAutoCreate()) + this.physicalType = new CodeableConcept(); + return this.physicalType; + } + + public boolean hasPhysicalType() { + return this.physicalType != null && !this.physicalType.isEmpty(); + } + + /** + * @param value {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) + */ + public Location setPhysicalType(CodeableConcept value) { + this.physicalType = value; + return this; + } + + /** + * @return {@link #position} (The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).) + */ + public LocationPositionComponent getPosition() { + if (this.position == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.position"); + else if (Configuration.doAutoCreate()) + this.position = new LocationPositionComponent(); + return this.position; + } + + public boolean hasPosition() { + return this.position != null && !this.position.isEmpty(); + } + + /** + * @param value {@link #position} (The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).) + */ + public Location setPosition(LocationPositionComponent value) { + this.position = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The organization that is responsible for the provisioning and upkeep of the location.) + */ + public Location setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} 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 organization that is responsible for the provisioning and upkeep of the location.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} 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 that is responsible for the provisioning and upkeep of the location.) + */ + public Location setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Location setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return active | suspended | inactive. + */ + public LocationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value active | suspended | inactive. + */ + public Location setStatus(LocationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(LocationStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #partOf} (Another Location which this Location is physically part of.) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (Another Location which this Location is physically part of.) + */ + public Location setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} 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. (Another Location which this Location is physically part of.) + */ + public Location getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Location(); + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} 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. (Another Location which this Location is physically part of.) + */ + public Location setPartOfTarget(Location value) { + this.partOfTarget = value; + return this; + } + + /** + * @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Location.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Location setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return Indicates whether a resource instance represents a specific location or a class of locations. + */ + public LocationMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value Indicates whether a resource instance represents a specific location or a class of locations. + */ + public Location setMode(LocationMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(LocationMode.ENUM_FACTORY); + this.mode.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType)); + childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML).", 0, java.lang.Integer.MAX_VALUE, position)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); + childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode)); + } + + public Location copy() { + Location dst = new Location(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.type = type == null ? null : type.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.physicalType = physicalType == null ? null : physicalType.copy(); + dst.position = position == null ? null : position.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.status = status == null ? null : status.copy(); + dst.partOf = partOf == null ? null : partOf.copy(); + dst.mode = mode == null ? null : mode.copy(); + return dst; + } + + protected Location typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (description == null || description.isEmpty()) && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (address == null || address.isEmpty()) && (physicalType == null || physicalType.isEmpty()) + && (position == null || position.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (status == null || status.isEmpty()) && (partOf == null || partOf.isEmpty()) && (mode == null || mode.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Location; + } + + @SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="near", path="", description="The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" ) + public static final String SP_NEAR = "near"; + @SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" ) + public static final String SP_PARTOF = "partof"; + @SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="near-distance", path="", description="A distance quantity to limit the near search to locations within a specific distance", type="token" ) + public static final String SP_NEARDISTANCE = "near-distance"; + @SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java index 5dcde895493..25e13ec94fa 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java @@ -20,853 +20,853 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. - */ -@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") -public class Media extends DomainResource { - - public enum MediaType implements FhirEnum { - /** - * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents. - */ - PHOTO, - /** - * The media consists of a series of frames that capture a moving image. - */ - VIDEO, - /** - * The media consists of a sound recording. - */ - AUDIO, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PHOTO; - if ("video".equals(codeString)) - return VIDEO; - if ("audio".equals(codeString)) - return AUDIO; - throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PHOTO: return "photo"; - case VIDEO: return "video"; - case AUDIO: return "audio"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PHOTO: return ""; - case VIDEO: return ""; - case AUDIO: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents."; - case VIDEO: return "The media consists of a series of frames that capture a moving image."; - case AUDIO: return "The media consists of a sound recording."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PHOTO: return "photo"; - case VIDEO: return "video"; - case AUDIO: return "audio"; - default: return "?"; - } - } - } - - public static class MediaTypeEnumFactory implements EnumFactory { - public MediaType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("photo".equals(codeString)) - return MediaType.PHOTO; - if ("video".equals(codeString)) - return MediaType.VIDEO; - if ("audio".equals(codeString)) - return MediaType.AUDIO; - throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'"); - } - public String toCode(MediaType code) throws IllegalArgumentException { - if (code == MediaType.PHOTO) - return "photo"; - if (code == MediaType.VIDEO) - return "video"; - if (code == MediaType.AUDIO) - return "audio"; - return "?"; - } - } - - /** - * Whether the media is a photo (still image), an audio recording, or a video recording. - */ - @Child(name="type", type={CodeType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." ) - protected Enumeration type; - - /** - * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. - */ - @Child(name="subtype", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="The type of acquisition equipment/process", formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality." ) - protected CodeableConcept subtype; - - /** - * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier(s) for the image", formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers." ) - protected List identifier; - - /** - * 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. - */ - @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When the media was taken/recorded (start)", formalDefinition="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." ) - protected DateTimeType created; - - /** - * Who/What this Media is a record of. - */ - @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who/What this Media is a record of.) - */ - protected Resource subjectTarget; - - /** - * The person who administered the collection of the image. - */ - @Child(name="operator", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." ) - protected Reference operator; - - /** - * The actual object that is the target of the reference (The person who administered the collection of the image.) - */ - protected Practitioner operatorTarget; - - /** - * The name of the imaging view e.g Lateral or Antero-posterior (AP). - */ - @Child(name="view", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Imaging view e.g Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g Lateral or Antero-posterior (AP)." ) - protected CodeableConcept view; - - /** - * The name of the device / manufacturer of the device that was used to make the recording. - */ - @Child(name="deviceName", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Name of the device/manufacturer", formalDefinition="The name of the device / manufacturer of the device that was used to make the recording." ) - protected StringType deviceName; - - /** - * Height of the image in pixels(photo/video). - */ - @Child(name="height", type={IntegerType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Height of the image in pixels(photo/video)", formalDefinition="Height of the image in pixels(photo/video)." ) - protected IntegerType height; - - /** - * Width of the image in pixels (photo/video). - */ - @Child(name="width", type={IntegerType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) - protected IntegerType width; - - /** - * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. - */ - @Child(name="frames", type={IntegerType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required." ) - protected IntegerType frames; - - /** - * The duration of the recording in seconds - for audio and video. - */ - @Child(name="duration", type={IntegerType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) - protected IntegerType duration; - - /** - * The actual content of the media - inline or by direct reference to the media source file. - */ - @Child(name="content", type={Attachment.class}, order=11, min=1, max=1) - @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." ) - protected Attachment content; - - private static final long serialVersionUID = 1930988698L; - - public Media() { - super(); - } - - public Media(Enumeration type, Attachment content) { - super(); - this.type = type; - this.content = content; - } - - /** - * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Media setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Whether the media is a photo (still image), an audio recording, or a video recording. - */ - public MediaType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Whether the media is a photo (still image), an audio recording, or a video recording. - */ - public Media setType(MediaType value) { - if (this.type == null) - this.type = new Enumeration(MediaType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) - */ - public CodeableConcept getSubtype() { - if (this.subtype == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.subtype"); - else if (Configuration.doAutoCreate()) - this.subtype = new CodeableConcept(); - return this.subtype; - } - - public boolean hasSubtype() { - return this.subtype != null && !this.subtype.isEmpty(); - } - - /** - * @param value {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) - */ - public Media setSubtype(CodeableConcept value) { - this.subtype = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #created} (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.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (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.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Media setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @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 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(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Who/What this Media is a record of.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.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} (Who/What this Media is a record of.) - */ - public Media 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. (Who/What this Media is a record of.) - */ - public Resource getSubjectTarget() { - 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. (Who/What this Media is a record of.) - */ - public Media setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #operator} (The person who administered the collection of the image.) - */ - public Reference getOperator() { - if (this.operator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.operator"); - else if (Configuration.doAutoCreate()) - this.operator = new Reference(); - return this.operator; - } - - public boolean hasOperator() { - return this.operator != null && !this.operator.isEmpty(); - } - - /** - * @param value {@link #operator} (The person who administered the collection of the image.) - */ - public Media setOperator(Reference value) { - this.operator = value; - return this; - } - - /** - * @return {@link #operator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) - */ - public Practitioner getOperatorTarget() { - if (this.operatorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.operator"); - else if (Configuration.doAutoCreate()) - this.operatorTarget = new Practitioner(); - return this.operatorTarget; - } - - /** - * @param value {@link #operator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) - */ - public Media setOperatorTarget(Practitioner value) { - this.operatorTarget = value; - return this; - } - - /** - * @return {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) - */ - public CodeableConcept getView() { - if (this.view == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.view"); - else if (Configuration.doAutoCreate()) - this.view = new CodeableConcept(); - return this.view; - } - - public boolean hasView() { - return this.view != null && !this.view.isEmpty(); - } - - /** - * @param value {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) - */ - public Media setView(CodeableConcept value) { - this.view = value; - return this; - } - - /** - * @return {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value - */ - public StringType getDeviceNameElement() { - if (this.deviceName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.deviceName"); - else if (Configuration.doAutoCreate()) - this.deviceName = new StringType(); - return this.deviceName; - } - - public boolean hasDeviceNameElement() { - return this.deviceName != null && !this.deviceName.isEmpty(); - } - - public boolean hasDeviceName() { - return this.deviceName != null && !this.deviceName.isEmpty(); - } - - /** - * @param value {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value - */ - public Media setDeviceNameElement(StringType value) { - this.deviceName = value; - return this; - } - - /** - * @return The name of the device / manufacturer of the device that was used to make the recording. - */ - public String getDeviceName() { - return this.deviceName == null ? null : this.deviceName.getValue(); - } - - /** - * @param value The name of the device / manufacturer of the device that was used to make the recording. - */ - public Media setDeviceName(String value) { - if (Utilities.noString(value)) - this.deviceName = null; - else { - if (this.deviceName == null) - this.deviceName = new StringType(); - this.deviceName.setValue(value); - } - return this; - } - - /** - * @return {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public IntegerType getHeightElement() { - if (this.height == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.height"); - else if (Configuration.doAutoCreate()) - this.height = new IntegerType(); - return this.height; - } - - public boolean hasHeightElement() { - return this.height != null && !this.height.isEmpty(); - } - - public boolean hasHeight() { - return this.height != null && !this.height.isEmpty(); - } - - /** - * @param value {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public Media setHeightElement(IntegerType value) { - this.height = value; - return this; - } - - /** - * @return Height of the image in pixels(photo/video). - */ - public int getHeight() { - return this.height == null ? null : this.height.getValue(); - } - - /** - * @param value Height of the image in pixels(photo/video). - */ - public Media setHeight(int value) { - if (value == -1) - this.height = null; - else { - if (this.height == null) - this.height = new IntegerType(); - this.height.setValue(value); - } - return this; - } - - /** - * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public IntegerType getWidthElement() { - if (this.width == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.width"); - else if (Configuration.doAutoCreate()) - this.width = new IntegerType(); - return this.width; - } - - public boolean hasWidthElement() { - return this.width != null && !this.width.isEmpty(); - } - - public boolean hasWidth() { - return this.width != null && !this.width.isEmpty(); - } - - /** - * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public Media setWidthElement(IntegerType value) { - this.width = value; - return this; - } - - /** - * @return Width of the image in pixels (photo/video). - */ - public int getWidth() { - return this.width == null ? null : this.width.getValue(); - } - - /** - * @param value Width of the image in pixels (photo/video). - */ - public Media setWidth(int value) { - if (value == -1) - this.width = null; - else { - if (this.width == null) - this.width = new IntegerType(); - this.width.setValue(value); - } - return this; - } - - /** - * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public IntegerType getFramesElement() { - if (this.frames == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.frames"); - else if (Configuration.doAutoCreate()) - this.frames = new IntegerType(); - return this.frames; - } - - public boolean hasFramesElement() { - return this.frames != null && !this.frames.isEmpty(); - } - - public boolean hasFrames() { - return this.frames != null && !this.frames.isEmpty(); - } - - /** - * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public Media setFramesElement(IntegerType value) { - this.frames = value; - return this; - } - - /** - * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. - */ - public int getFrames() { - return this.frames == null ? null : this.frames.getValue(); - } - - /** - * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. - */ - public Media setFrames(int value) { - if (value == -1) - this.frames = null; - else { - if (this.frames == null) - this.frames = new IntegerType(); - this.frames.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public IntegerType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new IntegerType(); - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public Media setDurationElement(IntegerType value) { - this.duration = value; - return this; - } - - /** - * @return The duration of the recording in seconds - for audio and video. - */ - public int getDuration() { - return this.duration == null ? null : this.duration.getValue(); - } - - /** - * @param value The duration of the recording in seconds - for audio and video. - */ - public Media setDuration(int value) { - if (value == -1) - this.duration = null; - else { - if (this.duration == null) - this.duration = new IntegerType(); - this.duration.setValue(value); - } - return this; - } - - /** - * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) - */ - public Attachment getContent() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.content"); - else if (Configuration.doAutoCreate()) - this.content = new Attachment(); - return this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) - */ - public Media setContent(Attachment value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("created", "dateTime", "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.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, java.lang.Integer.MAX_VALUE, operator)); - childrenList.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g Lateral or Antero-posterior (AP).", 0, java.lang.Integer.MAX_VALUE, view)); - childrenList.add(new Property("deviceName", "string", "The name of the device / manufacturer of the device that was used to make the recording.", 0, java.lang.Integer.MAX_VALUE, deviceName)); - childrenList.add(new Property("height", "integer", "Height of the image in pixels(photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); - childrenList.add(new Property("width", "integer", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); - childrenList.add(new Property("frames", "integer", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, java.lang.Integer.MAX_VALUE, frames)); - childrenList.add(new Property("duration", "integer", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public Media copy() { - Media dst = new Media(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.subtype = subtype == null ? null : subtype.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.created = created == null ? null : created.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.operator = operator == null ? null : operator.copy(); - dst.view = view == null ? null : view.copy(); - dst.deviceName = deviceName == null ? null : deviceName.copy(); - dst.height = height == null ? null : height.copy(); - dst.width = width == null ? null : width.copy(); - dst.frames = frames == null ? null : frames.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.content = content == null ? null : content.copy(); - return dst; - } - - protected Media typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (created == null || created.isEmpty()) - && (subject == null || subject.isEmpty()) && (operator == null || operator.isEmpty()) && (view == null || view.isEmpty()) - && (deviceName == null || deviceName.isEmpty()) && (height == null || height.isEmpty()) && (width == null || width.isEmpty()) - && (frames == null || frames.isEmpty()) && (duration == null || duration.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Media; - } - - @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="created", path="Media.created", description="When the media was taken/recorded (start)", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - @SearchParamDefinition(name="view", path="Media.view", description="Imaging view e.g Lateral or Antero-posterior", type="token" ) - public static final String SP_VIEW = "view"; - @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference" ) - public static final String SP_OPERATOR = "operator"; - -} - + +/* + 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; +/** + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ +@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") +public class Media extends DomainResource { + + public enum MediaType implements FhirEnum { + /** + * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents. + */ + PHOTO, + /** + * The media consists of a series of frames that capture a moving image. + */ + VIDEO, + /** + * The media consists of a sound recording. + */ + AUDIO, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PHOTO; + if ("video".equals(codeString)) + return VIDEO; + if ("audio".equals(codeString)) + return AUDIO; + throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PHOTO: return "photo"; + case VIDEO: return "video"; + case AUDIO: return "audio"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PHOTO: return ""; + case VIDEO: return ""; + case AUDIO: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents."; + case VIDEO: return "The media consists of a series of frames that capture a moving image."; + case AUDIO: return "The media consists of a sound recording."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PHOTO: return "photo"; + case VIDEO: return "video"; + case AUDIO: return "audio"; + default: return "?"; + } + } + } + + public static class MediaTypeEnumFactory implements EnumFactory { + public MediaType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("photo".equals(codeString)) + return MediaType.PHOTO; + if ("video".equals(codeString)) + return MediaType.VIDEO; + if ("audio".equals(codeString)) + return MediaType.AUDIO; + throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'"); + } + public String toCode(MediaType code) throws IllegalArgumentException { + if (code == MediaType.PHOTO) + return "photo"; + if (code == MediaType.VIDEO) + return "video"; + if (code == MediaType.AUDIO) + return "audio"; + return "?"; + } + } + + /** + * Whether the media is a photo (still image), an audio recording, or a video recording. + */ + @Child(name="type", type={CodeType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." ) + protected Enumeration type; + + /** + * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. + */ + @Child(name="subtype", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="The type of acquisition equipment/process", formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality." ) + protected CodeableConcept subtype; + + /** + * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier(s) for the image", formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers." ) + protected List identifier; + + /** + * 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. + */ + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When the media was taken/recorded (start)", formalDefinition="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." ) + protected DateTimeType created; + + /** + * Who/What this Media is a record of. + */ + @Child(name="subject", type={Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Who/What this Media is a record of.) + */ + protected Resource subjectTarget; + + /** + * The person who administered the collection of the image. + */ + @Child(name="operator", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." ) + protected Reference operator; + + /** + * The actual object that is the target of the reference (The person who administered the collection of the image.) + */ + protected Practitioner operatorTarget; + + /** + * The name of the imaging view e.g Lateral or Antero-posterior (AP). + */ + @Child(name="view", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Imaging view e.g Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g Lateral or Antero-posterior (AP)." ) + protected CodeableConcept view; + + /** + * The name of the device / manufacturer of the device that was used to make the recording. + */ + @Child(name="deviceName", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Name of the device/manufacturer", formalDefinition="The name of the device / manufacturer of the device that was used to make the recording." ) + protected StringType deviceName; + + /** + * Height of the image in pixels(photo/video). + */ + @Child(name="height", type={IntegerType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Height of the image in pixels(photo/video)", formalDefinition="Height of the image in pixels(photo/video)." ) + protected IntegerType height; + + /** + * Width of the image in pixels (photo/video). + */ + @Child(name="width", type={IntegerType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) + protected IntegerType width; + + /** + * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + @Child(name="frames", type={IntegerType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required." ) + protected IntegerType frames; + + /** + * The duration of the recording in seconds - for audio and video. + */ + @Child(name="duration", type={IntegerType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) + protected IntegerType duration; + + /** + * The actual content of the media - inline or by direct reference to the media source file. + */ + @Child(name="content", type={Attachment.class}, order=11, min=1, max=1) + @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." ) + protected Attachment content; + + private static final long serialVersionUID = 1930988698L; + + public Media() { + super(); + } + + public Media(Enumeration type, Attachment content) { + super(); + this.type = type; + this.content = content; + } + + /** + * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Media setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Whether the media is a photo (still image), an audio recording, or a video recording. + */ + public MediaType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Whether the media is a photo (still image), an audio recording, or a video recording. + */ + public Media setType(MediaType value) { + if (this.type == null) + this.type = new Enumeration(MediaType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) + */ + public CodeableConcept getSubtype() { + if (this.subtype == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.subtype"); + else if (Configuration.doAutoCreate()) + this.subtype = new CodeableConcept(); + return this.subtype; + } + + public boolean hasSubtype() { + return this.subtype != null && !this.subtype.isEmpty(); + } + + /** + * @param value {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.) + */ + public Media setSubtype(CodeableConcept value) { + this.subtype = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #created} (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.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (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.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Media setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @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 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(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Who/What this Media is a record of.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.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} (Who/What this Media is a record of.) + */ + public Media 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. (Who/What this Media is a record of.) + */ + public Resource getSubjectTarget() { + 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. (Who/What this Media is a record of.) + */ + public Media setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #operator} (The person who administered the collection of the image.) + */ + public Reference getOperator() { + if (this.operator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.operator"); + else if (Configuration.doAutoCreate()) + this.operator = new Reference(); + return this.operator; + } + + public boolean hasOperator() { + return this.operator != null && !this.operator.isEmpty(); + } + + /** + * @param value {@link #operator} (The person who administered the collection of the image.) + */ + public Media setOperator(Reference value) { + this.operator = value; + return this; + } + + /** + * @return {@link #operator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) + */ + public Practitioner getOperatorTarget() { + if (this.operatorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.operator"); + else if (Configuration.doAutoCreate()) + this.operatorTarget = new Practitioner(); + return this.operatorTarget; + } + + /** + * @param value {@link #operator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) + */ + public Media setOperatorTarget(Practitioner value) { + this.operatorTarget = value; + return this; + } + + /** + * @return {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) + */ + public CodeableConcept getView() { + if (this.view == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.view"); + else if (Configuration.doAutoCreate()) + this.view = new CodeableConcept(); + return this.view; + } + + public boolean hasView() { + return this.view != null && !this.view.isEmpty(); + } + + /** + * @param value {@link #view} (The name of the imaging view e.g Lateral or Antero-posterior (AP).) + */ + public Media setView(CodeableConcept value) { + this.view = value; + return this; + } + + /** + * @return {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value + */ + public StringType getDeviceNameElement() { + if (this.deviceName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.deviceName"); + else if (Configuration.doAutoCreate()) + this.deviceName = new StringType(); + return this.deviceName; + } + + public boolean hasDeviceNameElement() { + return this.deviceName != null && !this.deviceName.isEmpty(); + } + + public boolean hasDeviceName() { + return this.deviceName != null && !this.deviceName.isEmpty(); + } + + /** + * @param value {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value + */ + public Media setDeviceNameElement(StringType value) { + this.deviceName = value; + return this; + } + + /** + * @return The name of the device / manufacturer of the device that was used to make the recording. + */ + public String getDeviceName() { + return this.deviceName == null ? null : this.deviceName.getValue(); + } + + /** + * @param value The name of the device / manufacturer of the device that was used to make the recording. + */ + public Media setDeviceName(String value) { + if (Utilities.noString(value)) + this.deviceName = null; + else { + if (this.deviceName == null) + this.deviceName = new StringType(); + this.deviceName.setValue(value); + } + return this; + } + + /** + * @return {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public IntegerType getHeightElement() { + if (this.height == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.height"); + else if (Configuration.doAutoCreate()) + this.height = new IntegerType(); + return this.height; + } + + public boolean hasHeightElement() { + return this.height != null && !this.height.isEmpty(); + } + + public boolean hasHeight() { + return this.height != null && !this.height.isEmpty(); + } + + /** + * @param value {@link #height} (Height of the image in pixels(photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value + */ + public Media setHeightElement(IntegerType value) { + this.height = value; + return this; + } + + /** + * @return Height of the image in pixels(photo/video). + */ + public int getHeight() { + return this.height == null ? null : this.height.getValue(); + } + + /** + * @param value Height of the image in pixels(photo/video). + */ + public Media setHeight(int value) { + if (value == -1) + this.height = null; + else { + if (this.height == null) + this.height = new IntegerType(); + this.height.setValue(value); + } + return this; + } + + /** + * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public IntegerType getWidthElement() { + if (this.width == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.width"); + else if (Configuration.doAutoCreate()) + this.width = new IntegerType(); + return this.width; + } + + public boolean hasWidthElement() { + return this.width != null && !this.width.isEmpty(); + } + + public boolean hasWidth() { + return this.width != null && !this.width.isEmpty(); + } + + /** + * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value + */ + public Media setWidthElement(IntegerType value) { + this.width = value; + return this; + } + + /** + * @return Width of the image in pixels (photo/video). + */ + public int getWidth() { + return this.width == null ? null : this.width.getValue(); + } + + /** + * @param value Width of the image in pixels (photo/video). + */ + public Media setWidth(int value) { + if (value == -1) + this.width = null; + else { + if (this.width == null) + this.width = new IntegerType(); + this.width.setValue(value); + } + return this; + } + + /** + * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public IntegerType getFramesElement() { + if (this.frames == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.frames"); + else if (Configuration.doAutoCreate()) + this.frames = new IntegerType(); + return this.frames; + } + + public boolean hasFramesElement() { + return this.frames != null && !this.frames.isEmpty(); + } + + public boolean hasFrames() { + return this.frames != null && !this.frames.isEmpty(); + } + + /** + * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value + */ + public Media setFramesElement(IntegerType value) { + this.frames = value; + return this; + } + + /** + * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + public int getFrames() { + return this.frames == null ? null : this.frames.getValue(); + } + + /** + * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + */ + public Media setFrames(int value) { + if (value == -1) + this.frames = null; + else { + if (this.frames == null) + this.frames = new IntegerType(); + this.frames.setValue(value); + } + return this; + } + + /** + * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public IntegerType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new IntegerType(); + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public Media setDurationElement(IntegerType value) { + this.duration = value; + return this; + } + + /** + * @return The duration of the recording in seconds - for audio and video. + */ + public int getDuration() { + return this.duration == null ? null : this.duration.getValue(); + } + + /** + * @param value The duration of the recording in seconds - for audio and video. + */ + public Media setDuration(int value) { + if (value == -1) + this.duration = null; + else { + if (this.duration == null) + this.duration = new IntegerType(); + this.duration.setValue(value); + } + return this; + } + + /** + * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) + */ + public Attachment getContent() { + if (this.content == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Media.content"); + else if (Configuration.doAutoCreate()) + this.content = new Attachment(); + return this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) + */ + public Media setContent(Attachment value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("created", "dateTime", "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.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, java.lang.Integer.MAX_VALUE, operator)); + childrenList.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g Lateral or Antero-posterior (AP).", 0, java.lang.Integer.MAX_VALUE, view)); + childrenList.add(new Property("deviceName", "string", "The name of the device / manufacturer of the device that was used to make the recording.", 0, java.lang.Integer.MAX_VALUE, deviceName)); + childrenList.add(new Property("height", "integer", "Height of the image in pixels(photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); + childrenList.add(new Property("width", "integer", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); + childrenList.add(new Property("frames", "integer", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, java.lang.Integer.MAX_VALUE, frames)); + childrenList.add(new Property("duration", "integer", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public Media copy() { + Media dst = new Media(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.subtype = subtype == null ? null : subtype.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.created = created == null ? null : created.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.operator = operator == null ? null : operator.copy(); + dst.view = view == null ? null : view.copy(); + dst.deviceName = deviceName == null ? null : deviceName.copy(); + dst.height = height == null ? null : height.copy(); + dst.width = width == null ? null : width.copy(); + dst.frames = frames == null ? null : frames.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.content = content == null ? null : content.copy(); + return dst; + } + + protected Media typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (created == null || created.isEmpty()) + && (subject == null || subject.isEmpty()) && (operator == null || operator.isEmpty()) && (view == null || view.isEmpty()) + && (deviceName == null || deviceName.isEmpty()) && (height == null || height.isEmpty()) && (width == null || width.isEmpty()) + && (frames == null || frames.isEmpty()) && (duration == null || duration.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Media; + } + + @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="created", path="Media.created", description="When the media was taken/recorded (start)", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" ) + public static final String SP_SUBTYPE = "subtype"; + @SearchParamDefinition(name="view", path="Media.view", description="Imaging view e.g Lateral or Antero-posterior", type="token" ) + public static final String SP_VIEW = "view"; + @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference" ) + public static final String SP_OPERATOR = "operator"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java index faea230fe1f..0e51873f673 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java @@ -20,944 +20,944 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Primarily used for identification and definition of Medication, but also covers ingredients and packaging. - */ -@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") -public class Medication extends DomainResource { - - public enum MedicationKind implements FhirEnum { - /** - * The medication is a product. - */ - PRODUCT, - /** - * The medication is a package - a contained group of one of more products. - */ - PACKAGE, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PRODUCT: return "product"; - case PACKAGE: return "package"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRODUCT: return ""; - case PACKAGE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRODUCT: return "The medication is a product."; - case PACKAGE: return "The medication is a package - a contained group of one of more products."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRODUCT: return "product"; - case PACKAGE: return "package"; - default: return "?"; - } - } - } - - public static class MedicationKindEnumFactory implements EnumFactory { - public MedicationKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("product".equals(codeString)) - return MedicationKind.PRODUCT; - if ("package".equals(codeString)) - return MedicationKind.PACKAGE; - throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); - } - public String toCode(MedicationKind code) throws IllegalArgumentException { - if (code == MedicationKind.PRODUCT) - return "product"; - if (code == MedicationKind.PACKAGE) - return "package"; - return "?"; - } - } - - @Block() - public static class MedicationProductComponent extends BackboneElement { - /** - * Describes the form of the item. Powder; tables; carton. - */ - @Child(name="form", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="powder | tablets | carton +", formalDefinition="Describes the form of the item. Powder; tables; carton." ) - protected CodeableConcept form; - - /** - * Identifies a particular constituent of interest in the product. - */ - @Child(name="ingredient", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." ) - protected List ingredient; - - private static final long serialVersionUID = -506109200L; - - public MedicationProductComponent() { - super(); - } - - /** - * @return {@link #form} (Describes the form of the item. Powder; tables; carton.) - */ - public CodeableConcept getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductComponent.form"); - else if (Configuration.doAutoCreate()) - this.form = new CodeableConcept(); - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (Describes the form of the item. Powder; tables; carton.) - */ - public MedicationProductComponent setForm(CodeableConcept value) { - this.form = value; - return this; - } - - /** - * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) - */ - public List getIngredient() { - if (this.ingredient == null) - this.ingredient = new ArrayList(); - return this.ingredient; - } - - public boolean hasIngredient() { - if (this.ingredient == null) - return false; - for (MedicationProductIngredientComponent item : this.ingredient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) - */ - // syntactic sugar - public MedicationProductIngredientComponent addIngredient() { //3 - MedicationProductIngredientComponent t = new MedicationProductIngredientComponent(); - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("form", "CodeableConcept", "Describes the form of the item. Powder; tables; carton.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient)); - } - - public MedicationProductComponent copy() { - MedicationProductComponent dst = new MedicationProductComponent(); - copyValues(dst); - dst.form = form == null ? null : form.copy(); - if (ingredient != null) { - dst.ingredient = new ArrayList(); - for (MedicationProductIngredientComponent i : ingredient) - dst.ingredient.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (form == null || form.isEmpty()) && (ingredient == null || ingredient.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationProductIngredientComponent extends BackboneElement { - /** - * The actual ingredient - either a substance (simple ingredient) or another medication. - */ - @Child(name="item", type={Substance.class, Medication.class}, order=1, min=1, max=1) - @Description(shortDefinition="The product contained", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - protected Resource itemTarget; - - /** - * Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet. - */ - @Child(name="amount", type={Ratio.class}, order=2, min=0, max=1) - @Description(shortDefinition="How much ingredient in product", formalDefinition="Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet." ) - protected Ratio amount; - - private static final long serialVersionUID = -1217232889L; - - public MedicationProductIngredientComponent() { - super(); - } - - public MedicationProductIngredientComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductIngredientComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public MedicationProductIngredientComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} 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 actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public Resource getItemTarget() { - return this.itemTarget; - } - - /** - * @param value {@link #item} 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 actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public MedicationProductIngredientComponent setItemTarget(Resource value) { - this.itemTarget = value; - return this; - } - - /** - * @return {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) - */ - public Ratio getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductIngredientComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Ratio(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) - */ - public MedicationProductIngredientComponent setAmount(Ratio value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "Reference(Substance|Medication)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("amount", "Ratio", "Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public MedicationProductIngredientComponent copy() { - MedicationProductIngredientComponent dst = new MedicationProductIngredientComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationPackageComponent extends BackboneElement { - /** - * The kind of container that this package comes as. - */ - @Child(name="container", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="E.g. box, vial, blister-pack", formalDefinition="The kind of container that this package comes as." ) - protected CodeableConcept container; - - /** - * A set of components that go to make up the described item. - */ - @Child(name="content", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What is in the package?", formalDefinition="A set of components that go to make up the described item." ) - protected List content; - - private static final long serialVersionUID = 503772472L; - - public MedicationPackageComponent() { - super(); - } - - /** - * @return {@link #container} (The kind of container that this package comes as.) - */ - public CodeableConcept getContainer() { - if (this.container == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageComponent.container"); - else if (Configuration.doAutoCreate()) - this.container = new CodeableConcept(); - return this.container; - } - - public boolean hasContainer() { - return this.container != null && !this.container.isEmpty(); - } - - /** - * @param value {@link #container} (The kind of container that this package comes as.) - */ - public MedicationPackageComponent setContainer(CodeableConcept value) { - this.container = value; - return this; - } - - /** - * @return {@link #content} (A set of components that go to make up the described item.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (MedicationPackageContentComponent item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (A set of components that go to make up the described item.) - */ - // syntactic sugar - public MedicationPackageContentComponent addContent() { //3 - MedicationPackageContentComponent t = new MedicationPackageContentComponent(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("container", "CodeableConcept", "The kind of container that this package comes as.", 0, java.lang.Integer.MAX_VALUE, container)); - childrenList.add(new Property("content", "", "A set of components that go to make up the described item.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - public MedicationPackageComponent copy() { - MedicationPackageComponent dst = new MedicationPackageComponent(); - copyValues(dst); - dst.container = container == null ? null : container.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (MedicationPackageContentComponent i : content) - dst.content.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (container == null || container.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationPackageContentComponent extends BackboneElement { - /** - * Identifies one of the items in the package. - */ - @Child(name="item", type={Medication.class}, order=1, min=1, max=1) - @Description(shortDefinition="A product in the package", formalDefinition="Identifies one of the items in the package." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (Identifies one of the items in the package.) - */ - protected Medication itemTarget; - - /** - * The amount of the product that is in the package. - */ - @Child(name="amount", type={Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="How many are in the package?", formalDefinition="The amount of the product that is in the package." ) - protected Quantity amount; - - private static final long serialVersionUID = -1385430192L; - - public MedicationPackageContentComponent() { - super(); - } - - public MedicationPackageContentComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Identifies one of the items in the package.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Identifies one of the items in the package.) - */ - public MedicationPackageContentComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} 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 one of the items in the package.) - */ - public Medication getItemTarget() { - if (this.itemTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); - else if (Configuration.doAutoCreate()) - this.itemTarget = new Medication(); - return this.itemTarget; - } - - /** - * @param value {@link #item} 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 one of the items in the package.) - */ - public MedicationPackageContentComponent setItemTarget(Medication value) { - this.itemTarget = value; - return this; - } - - /** - * @return {@link #amount} (The amount of the product that is in the package.) - */ - public Quantity getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Quantity(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (The amount of the product that is in the package.) - */ - public MedicationPackageContentComponent setAmount(Quantity value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "Reference(Medication)", "Identifies one of the items in the package.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("amount", "Quantity", "The amount of the product that is in the package.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public MedicationPackageContentComponent copy() { - MedicationPackageContentComponent dst = new MedicationPackageContentComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - /** - * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. - */ - @Child(name="name", type={StringType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Common / Commercial name", formalDefinition="The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code." ) - protected StringType name; - - /** - * A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes. - */ - @Child(name="code", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes." ) - protected CodeableConcept code; - - /** - * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). - */ - @Child(name="isBrand", type={BooleanType.class}, order=1, min=0, max=1) - @Description(shortDefinition="True if a brand", formalDefinition="Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is)." ) - protected BooleanType isBrand; - - /** - * Describes the details of the manufacturer. - */ - @Child(name="manufacturer", type={Organization.class}, order=2, min=0, max=1) - @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer." ) - protected Reference manufacturer; - - /** - * The actual object that is the target of the reference (Describes the details of the manufacturer.) - */ - protected Organization manufacturerTarget; - - /** - * Medications are either a single administrable product or a package that contains one or more products. - */ - @Child(name="kind", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="product | package", formalDefinition="Medications are either a single administrable product or a package that contains one or more products." ) - protected Enumeration kind; - - /** - * Information that only applies to products (not packages). - */ - @Child(name="product", type={}, order=4, min=0, max=1) - @Description(shortDefinition="Administrable medication details", formalDefinition="Information that only applies to products (not packages)." ) - protected MedicationProductComponent product; - - /** - * Information that only applies to packages (not products). - */ - @Child(name="package_", type={}, order=5, min=0, max=1) - @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." ) - protected MedicationPackageComponent package_; - - private static final long serialVersionUID = 385691577L; - - public Medication() { - super(); - } - - /** - * @return {@link #name} (The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Medication setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. - */ - public Medication setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) - */ - public Medication setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value - */ - public BooleanType getIsBrandElement() { - if (this.isBrand == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.isBrand"); - else if (Configuration.doAutoCreate()) - this.isBrand = new BooleanType(); - return this.isBrand; - } - - public boolean hasIsBrandElement() { - return this.isBrand != null && !this.isBrand.isEmpty(); - } - - public boolean hasIsBrand() { - return this.isBrand != null && !this.isBrand.isEmpty(); - } - - /** - * @param value {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value - */ - public Medication setIsBrandElement(BooleanType value) { - this.isBrand = value; - return this; - } - - /** - * @return Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). - */ - public boolean getIsBrand() { - return this.isBrand == null ? false : this.isBrand.getValue(); - } - - /** - * @param value Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). - */ - public Medication setIsBrand(boolean value) { - if (value == false) - this.isBrand = null; - else { - if (this.isBrand == null) - this.isBrand = new BooleanType(); - this.isBrand.setValue(value); - } - return this; - } - - /** - * @return {@link #manufacturer} (Describes the details of the manufacturer.) - */ - public Reference getManufacturer() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new Reference(); - return this.manufacturer; - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (Describes the details of the manufacturer.) - */ - public Medication setManufacturer(Reference value) { - this.manufacturer = value; - return this; - } - - /** - * @return {@link #manufacturer} 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. (Describes the details of the manufacturer.) - */ - public Organization getManufacturerTarget() { - if (this.manufacturerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturerTarget = new Organization(); - return this.manufacturerTarget; - } - - /** - * @param value {@link #manufacturer} 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. (Describes the details of the manufacturer.) - */ - public Medication setManufacturerTarget(Organization value) { - this.manufacturerTarget = value; - return this; - } - - /** - * @return {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(); - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Medication setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Medications are either a single administrable product or a package that contains one or more products. - */ - public MedicationKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Medications are either a single administrable product or a package that contains one or more products. - */ - public Medication setKind(MedicationKind value) { - if (value == null) - this.kind = null; - else { - if (this.kind == null) - this.kind = new Enumeration(MedicationKind.ENUM_FACTORY); - this.kind.setValue(value); - } - return this; - } - - /** - * @return {@link #product} (Information that only applies to products (not packages).) - */ - public MedicationProductComponent getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.product"); - else if (Configuration.doAutoCreate()) - this.product = new MedicationProductComponent(); - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Information that only applies to products (not packages).) - */ - public Medication setProduct(MedicationProductComponent value) { - this.product = value; - return this; - } - - /** - * @return {@link #package_} (Information that only applies to packages (not products).) - */ - public MedicationPackageComponent getPackage() { - if (this.package_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.package_"); - else if (Configuration.doAutoCreate()) - this.package_ = new MedicationPackageComponent(); - return this.package_; - } - - public boolean hasPackage() { - return this.package_ != null && !this.package_.isEmpty(); - } - - /** - * @param value {@link #package_} (Information that only applies to packages (not products).) - */ - public Medication setPackage(MedicationPackageComponent value) { - this.package_ = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("isBrand", "boolean", "Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).", 0, java.lang.Integer.MAX_VALUE, isBrand)); - childrenList.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("kind", "code", "Medications are either a single administrable product or a package that contains one or more products.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("product", "", "Information that only applies to products (not packages).", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("package", "", "Information that only applies to packages (not products).", 0, java.lang.Integer.MAX_VALUE, package_)); - } - - public Medication copy() { - Medication dst = new Medication(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.code = code == null ? null : code.copy(); - dst.isBrand = isBrand == null ? null : isBrand.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.product = product == null ? null : product.copy(); - dst.package_ = package_ == null ? null : package_.copy(); - return dst; - } - - protected Medication typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (code == null || code.isEmpty()) - && (isBrand == null || isBrand.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) - && (kind == null || kind.isEmpty()) && (product == null || product.isEmpty()) && (package_ == null || package_.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Medication; - } - - @SearchParamDefinition(name="content", path="Medication.package.content.item", description="A product in the package", type="reference" ) - public static final String SP_CONTENT = "content"; - @SearchParamDefinition(name="form", path="Medication.product.form", description="powder | tablets | carton +", type="token" ) - public static final String SP_FORM = "form"; - @SearchParamDefinition(name="container", path="Medication.package.container", description="E.g. box, vial, blister-pack", type="token" ) - public static final String SP_CONTAINER = "container"; - @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="Manufacturer of the item", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - @SearchParamDefinition(name="name", path="Medication.name", description="Common / Commercial name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item", description="The product contained", type="reference" ) - public static final String SP_INGREDIENT = "ingredient"; - @SearchParamDefinition(name="code", path="Medication.code", description="Codes that identify this medication", type="token" ) - public static final String SP_CODE = "code"; - -} - + +/* + 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; +/** + * Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + */ +@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") +public class Medication extends DomainResource { + + public enum MedicationKind implements FhirEnum { + /** + * The medication is a product. + */ + PRODUCT, + /** + * The medication is a package - a contained group of one of more products. + */ + PACKAGE, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PRODUCT: return "product"; + case PACKAGE: return "package"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PRODUCT: return ""; + case PACKAGE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PRODUCT: return "The medication is a product."; + case PACKAGE: return "The medication is a package - a contained group of one of more products."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PRODUCT: return "product"; + case PACKAGE: return "package"; + default: return "?"; + } + } + } + + public static class MedicationKindEnumFactory implements EnumFactory { + public MedicationKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("product".equals(codeString)) + return MedicationKind.PRODUCT; + if ("package".equals(codeString)) + return MedicationKind.PACKAGE; + throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); + } + public String toCode(MedicationKind code) throws IllegalArgumentException { + if (code == MedicationKind.PRODUCT) + return "product"; + if (code == MedicationKind.PACKAGE) + return "package"; + return "?"; + } + } + + @Block() + public static class MedicationProductComponent extends BackboneElement { + /** + * Describes the form of the item. Powder; tables; carton. + */ + @Child(name="form", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="powder | tablets | carton +", formalDefinition="Describes the form of the item. Powder; tables; carton." ) + protected CodeableConcept form; + + /** + * Identifies a particular constituent of interest in the product. + */ + @Child(name="ingredient", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." ) + protected List ingredient; + + private static final long serialVersionUID = -506109200L; + + public MedicationProductComponent() { + super(); + } + + /** + * @return {@link #form} (Describes the form of the item. Powder; tables; carton.) + */ + public CodeableConcept getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductComponent.form"); + else if (Configuration.doAutoCreate()) + this.form = new CodeableConcept(); + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (Describes the form of the item. Powder; tables; carton.) + */ + public MedicationProductComponent setForm(CodeableConcept value) { + this.form = value; + return this; + } + + /** + * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) + */ + public List getIngredient() { + if (this.ingredient == null) + this.ingredient = new ArrayList(); + return this.ingredient; + } + + public boolean hasIngredient() { + if (this.ingredient == null) + return false; + for (MedicationProductIngredientComponent item : this.ingredient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) + */ + // syntactic sugar + public MedicationProductIngredientComponent addIngredient() { //3 + MedicationProductIngredientComponent t = new MedicationProductIngredientComponent(); + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("form", "CodeableConcept", "Describes the form of the item. Powder; tables; carton.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient)); + } + + public MedicationProductComponent copy() { + MedicationProductComponent dst = new MedicationProductComponent(); + copyValues(dst); + dst.form = form == null ? null : form.copy(); + if (ingredient != null) { + dst.ingredient = new ArrayList(); + for (MedicationProductIngredientComponent i : ingredient) + dst.ingredient.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (form == null || form.isEmpty()) && (ingredient == null || ingredient.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationProductIngredientComponent extends BackboneElement { + /** + * The actual ingredient - either a substance (simple ingredient) or another medication. + */ + @Child(name="item", type={Substance.class, Medication.class}, order=1, min=1, max=1) + @Description(shortDefinition="The product contained", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + protected Resource itemTarget; + + /** + * Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet. + */ + @Child(name="amount", type={Ratio.class}, order=2, min=0, max=1) + @Description(shortDefinition="How much ingredient in product", formalDefinition="Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet." ) + protected Ratio amount; + + private static final long serialVersionUID = -1217232889L; + + public MedicationProductIngredientComponent() { + super(); + } + + public MedicationProductIngredientComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductIngredientComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public MedicationProductIngredientComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} 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 actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public Resource getItemTarget() { + return this.itemTarget; + } + + /** + * @param value {@link #item} 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 actual ingredient - either a substance (simple ingredient) or another medication.) + */ + public MedicationProductIngredientComponent setItemTarget(Resource value) { + this.itemTarget = value; + return this; + } + + /** + * @return {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) + */ + public Ratio getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationProductIngredientComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Ratio(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.) + */ + public MedicationProductIngredientComponent setAmount(Ratio value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "Reference(Substance|Medication)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("amount", "Ratio", "Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public MedicationProductIngredientComponent copy() { + MedicationProductIngredientComponent dst = new MedicationProductIngredientComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationPackageComponent extends BackboneElement { + /** + * The kind of container that this package comes as. + */ + @Child(name="container", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="E.g. box, vial, blister-pack", formalDefinition="The kind of container that this package comes as." ) + protected CodeableConcept container; + + /** + * A set of components that go to make up the described item. + */ + @Child(name="content", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What is in the package?", formalDefinition="A set of components that go to make up the described item." ) + protected List content; + + private static final long serialVersionUID = 503772472L; + + public MedicationPackageComponent() { + super(); + } + + /** + * @return {@link #container} (The kind of container that this package comes as.) + */ + public CodeableConcept getContainer() { + if (this.container == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageComponent.container"); + else if (Configuration.doAutoCreate()) + this.container = new CodeableConcept(); + return this.container; + } + + public boolean hasContainer() { + return this.container != null && !this.container.isEmpty(); + } + + /** + * @param value {@link #container} (The kind of container that this package comes as.) + */ + public MedicationPackageComponent setContainer(CodeableConcept value) { + this.container = value; + return this; + } + + /** + * @return {@link #content} (A set of components that go to make up the described item.) + */ + public List getContent() { + if (this.content == null) + this.content = new ArrayList(); + return this.content; + } + + public boolean hasContent() { + if (this.content == null) + return false; + for (MedicationPackageContentComponent item : this.content) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #content} (A set of components that go to make up the described item.) + */ + // syntactic sugar + public MedicationPackageContentComponent addContent() { //3 + MedicationPackageContentComponent t = new MedicationPackageContentComponent(); + if (this.content == null) + this.content = new ArrayList(); + this.content.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("container", "CodeableConcept", "The kind of container that this package comes as.", 0, java.lang.Integer.MAX_VALUE, container)); + childrenList.add(new Property("content", "", "A set of components that go to make up the described item.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public MedicationPackageComponent copy() { + MedicationPackageComponent dst = new MedicationPackageComponent(); + copyValues(dst); + dst.container = container == null ? null : container.copy(); + if (content != null) { + dst.content = new ArrayList(); + for (MedicationPackageContentComponent i : content) + dst.content.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (container == null || container.isEmpty()) && (content == null || content.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationPackageContentComponent extends BackboneElement { + /** + * Identifies one of the items in the package. + */ + @Child(name="item", type={Medication.class}, order=1, min=1, max=1) + @Description(shortDefinition="A product in the package", formalDefinition="Identifies one of the items in the package." ) + protected Reference item; + + /** + * The actual object that is the target of the reference (Identifies one of the items in the package.) + */ + protected Medication itemTarget; + + /** + * The amount of the product that is in the package. + */ + @Child(name="amount", type={Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="How many are in the package?", formalDefinition="The amount of the product that is in the package." ) + protected Quantity amount; + + private static final long serialVersionUID = -1385430192L; + + public MedicationPackageContentComponent() { + super(); + } + + public MedicationPackageContentComponent(Reference item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Identifies one of the items in the package.) + */ + public Reference getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new Reference(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Identifies one of the items in the package.) + */ + public MedicationPackageContentComponent setItem(Reference value) { + this.item = value; + return this; + } + + /** + * @return {@link #item} 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 one of the items in the package.) + */ + public Medication getItemTarget() { + if (this.itemTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.item"); + else if (Configuration.doAutoCreate()) + this.itemTarget = new Medication(); + return this.itemTarget; + } + + /** + * @param value {@link #item} 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 one of the items in the package.) + */ + public MedicationPackageContentComponent setItemTarget(Medication value) { + this.itemTarget = value; + return this; + } + + /** + * @return {@link #amount} (The amount of the product that is in the package.) + */ + public Quantity getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPackageContentComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Quantity(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (The amount of the product that is in the package.) + */ + public MedicationPackageContentComponent setAmount(Quantity value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "Reference(Medication)", "Identifies one of the items in the package.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("amount", "Quantity", "The amount of the product that is in the package.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public MedicationPackageContentComponent copy() { + MedicationPackageContentComponent dst = new MedicationPackageContentComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + /** + * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + */ + @Child(name="name", type={StringType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Common / Commercial name", formalDefinition="The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code." ) + protected StringType name; + + /** + * A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes. + */ + @Child(name="code", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes." ) + protected CodeableConcept code; + + /** + * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + */ + @Child(name="isBrand", type={BooleanType.class}, order=1, min=0, max=1) + @Description(shortDefinition="True if a brand", formalDefinition="Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is)." ) + protected BooleanType isBrand; + + /** + * Describes the details of the manufacturer. + */ + @Child(name="manufacturer", type={Organization.class}, order=2, min=0, max=1) + @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer." ) + protected Reference manufacturer; + + /** + * The actual object that is the target of the reference (Describes the details of the manufacturer.) + */ + protected Organization manufacturerTarget; + + /** + * Medications are either a single administrable product or a package that contains one or more products. + */ + @Child(name="kind", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="product | package", formalDefinition="Medications are either a single administrable product or a package that contains one or more products." ) + protected Enumeration kind; + + /** + * Information that only applies to products (not packages). + */ + @Child(name="product", type={}, order=4, min=0, max=1) + @Description(shortDefinition="Administrable medication details", formalDefinition="Information that only applies to products (not packages)." ) + protected MedicationProductComponent product; + + /** + * Information that only applies to packages (not products). + */ + @Child(name="package_", type={}, order=5, min=0, max=1) + @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." ) + protected MedicationPackageComponent package_; + + private static final long serialVersionUID = 385691577L; + + public Medication() { + super(); + } + + /** + * @return {@link #name} (The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Medication setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + */ + public Medication setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.) + */ + public Medication setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value + */ + public BooleanType getIsBrandElement() { + if (this.isBrand == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.isBrand"); + else if (Configuration.doAutoCreate()) + this.isBrand = new BooleanType(); + return this.isBrand; + } + + public boolean hasIsBrandElement() { + return this.isBrand != null && !this.isBrand.isEmpty(); + } + + public boolean hasIsBrand() { + return this.isBrand != null && !this.isBrand.isEmpty(); + } + + /** + * @param value {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value + */ + public Medication setIsBrandElement(BooleanType value) { + this.isBrand = value; + return this; + } + + /** + * @return Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + */ + public boolean getIsBrand() { + return this.isBrand == null ? false : this.isBrand.getValue(); + } + + /** + * @param value Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + */ + public Medication setIsBrand(boolean value) { + if (value == false) + this.isBrand = null; + else { + if (this.isBrand == null) + this.isBrand = new BooleanType(); + this.isBrand.setValue(value); + } + return this; + } + + /** + * @return {@link #manufacturer} (Describes the details of the manufacturer.) + */ + public Reference getManufacturer() { + if (this.manufacturer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturer = new Reference(); + return this.manufacturer; + } + + public boolean hasManufacturer() { + return this.manufacturer != null && !this.manufacturer.isEmpty(); + } + + /** + * @param value {@link #manufacturer} (Describes the details of the manufacturer.) + */ + public Medication setManufacturer(Reference value) { + this.manufacturer = value; + return this; + } + + /** + * @return {@link #manufacturer} 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. (Describes the details of the manufacturer.) + */ + public Organization getManufacturerTarget() { + if (this.manufacturerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.manufacturer"); + else if (Configuration.doAutoCreate()) + this.manufacturerTarget = new Organization(); + return this.manufacturerTarget; + } + + /** + * @param value {@link #manufacturer} 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. (Describes the details of the manufacturer.) + */ + public Medication setManufacturerTarget(Organization value) { + this.manufacturerTarget = value; + return this; + } + + /** + * @return {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(); + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Medications are either a single administrable product or a package that contains one or more products.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Medication setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Medications are either a single administrable product or a package that contains one or more products. + */ + public MedicationKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Medications are either a single administrable product or a package that contains one or more products. + */ + public Medication setKind(MedicationKind value) { + if (value == null) + this.kind = null; + else { + if (this.kind == null) + this.kind = new Enumeration(MedicationKind.ENUM_FACTORY); + this.kind.setValue(value); + } + return this; + } + + /** + * @return {@link #product} (Information that only applies to products (not packages).) + */ + public MedicationProductComponent getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.product"); + else if (Configuration.doAutoCreate()) + this.product = new MedicationProductComponent(); + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Information that only applies to products (not packages).) + */ + public Medication setProduct(MedicationProductComponent value) { + this.product = value; + return this; + } + + /** + * @return {@link #package_} (Information that only applies to packages (not products).) + */ + public MedicationPackageComponent getPackage() { + if (this.package_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Medication.package_"); + else if (Configuration.doAutoCreate()) + this.package_ = new MedicationPackageComponent(); + return this.package_; + } + + public boolean hasPackage() { + return this.package_ != null && !this.package_.isEmpty(); + } + + /** + * @param value {@link #package_} (Information that only applies to packages (not products).) + */ + public Medication setPackage(MedicationPackageComponent value) { + this.package_ = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("isBrand", "boolean", "Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is).", 0, java.lang.Integer.MAX_VALUE, isBrand)); + childrenList.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); + childrenList.add(new Property("kind", "code", "Medications are either a single administrable product or a package that contains one or more products.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("product", "", "Information that only applies to products (not packages).", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("package", "", "Information that only applies to packages (not products).", 0, java.lang.Integer.MAX_VALUE, package_)); + } + + public Medication copy() { + Medication dst = new Medication(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.code = code == null ? null : code.copy(); + dst.isBrand = isBrand == null ? null : isBrand.copy(); + dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.product = product == null ? null : product.copy(); + dst.package_ = package_ == null ? null : package_.copy(); + return dst; + } + + protected Medication typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (code == null || code.isEmpty()) + && (isBrand == null || isBrand.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) + && (kind == null || kind.isEmpty()) && (product == null || product.isEmpty()) && (package_ == null || package_.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Medication; + } + + @SearchParamDefinition(name="content", path="Medication.package.content.item", description="A product in the package", type="reference" ) + public static final String SP_CONTENT = "content"; + @SearchParamDefinition(name="form", path="Medication.product.form", description="powder | tablets | carton +", type="token" ) + public static final String SP_FORM = "form"; + @SearchParamDefinition(name="container", path="Medication.package.container", description="E.g. box, vial, blister-pack", type="token" ) + public static final String SP_CONTAINER = "container"; + @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="Manufacturer of the item", type="reference" ) + public static final String SP_MANUFACTURER = "manufacturer"; + @SearchParamDefinition(name="name", path="Medication.name", description="Common / Commercial name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item", description="The product contained", type="reference" ) + public static final String SP_INGREDIENT = "ingredient"; + @SearchParamDefinition(name="code", path="Medication.code", description="Codes that identify this medication", type="token" ) + public static final String SP_CODE = "code"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java index bc9cbe45576..7523417d90d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java @@ -20,1202 +20,1202 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** + +/* + 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 event of a patient being given a dose of a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. -Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. - */ -@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") -public class MedicationAdministration extends DomainResource { - - public enum MedicationAdminStatus implements FhirEnum { - /** - * The administration has started but has not yet completed. - */ - INPROGRESS, - /** - * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the administration have occurred. - */ - COMPLETED, - /** - * The administration was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the administration have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return INPROGRESS; - if ("on hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered in error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - case STOPPED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The administration has started but has not yet completed."; - case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the administration have occurred."; - case ENTEREDINERROR: return "The administration was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered in error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - } - - public static class MedicationAdminStatusEnumFactory implements EnumFactory { - public MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in progress".equals(codeString)) - return MedicationAdminStatus.INPROGRESS; - if ("on hold".equals(codeString)) - return MedicationAdminStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationAdminStatus.COMPLETED; - if ("entered in error".equals(codeString)) - return MedicationAdminStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationAdminStatus.STOPPED; - throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); - } - public String toCode(MedicationAdminStatus code) throws IllegalArgumentException { - if (code == MedicationAdminStatus.INPROGRESS) - return "in progress"; - if (code == MedicationAdminStatus.ONHOLD) - return "on hold"; - if (code == MedicationAdminStatus.COMPLETED) - return "completed"; - if (code == MedicationAdminStatus.ENTEREDINERROR) - return "entered in error"; - if (code == MedicationAdminStatus.STOPPED) - return "stopped"; - return "?"; - } - } - - @Block() - public static class MedicationAdministrationDosageComponent extends BackboneElement { - /** - * The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period). - */ - @Child(name="timing", type={DateTimeType.class, Period.class}, order=1, min=0, max=1) - @Description(shortDefinition="When dose(s) were given", formalDefinition="The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period)." ) - protected Type timing; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm". - */ - @Child(name="site", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. - */ - @Child(name="route", type={CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Path of substance into body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc." ) - protected CodeableConcept route; - - /** +Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + */ +@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") +public class MedicationAdministration extends DomainResource { + + public enum MedicationAdminStatus implements FhirEnum { + /** + * The administration has started but has not yet completed. + */ + INPROGRESS, + /** + * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the administration have occurred. + */ + COMPLETED, + /** + * The administration was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the administration have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return INPROGRESS; + if ("on hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered in error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + case STOPPED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The administration has started but has not yet completed."; + case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the administration have occurred."; + case ENTEREDINERROR: return "The administration was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered in error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + } + + public static class MedicationAdminStatusEnumFactory implements EnumFactory { + public MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return MedicationAdminStatus.INPROGRESS; + if ("on hold".equals(codeString)) + return MedicationAdminStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationAdminStatus.COMPLETED; + if ("entered in error".equals(codeString)) + return MedicationAdminStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationAdminStatus.STOPPED; + throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); + } + public String toCode(MedicationAdminStatus code) throws IllegalArgumentException { + if (code == MedicationAdminStatus.INPROGRESS) + return "in progress"; + if (code == MedicationAdminStatus.ONHOLD) + return "on hold"; + if (code == MedicationAdminStatus.COMPLETED) + return "completed"; + if (code == MedicationAdminStatus.ENTEREDINERROR) + return "entered in error"; + if (code == MedicationAdminStatus.STOPPED) + return "stopped"; + return "?"; + } + } + + @Block() + public static class MedicationAdministrationDosageComponent extends BackboneElement { + /** + * The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period). + */ + @Child(name="timing", type={DateTimeType.class, Period.class}, order=1, min=0, max=1) + @Description(shortDefinition="When dose(s) were given", formalDefinition="The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period)." ) + protected Type timing; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + */ + @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm". + */ + @Child(name="site", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. + */ + @Child(name="route", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Path of substance into body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc." ) + protected CodeableConcept route; + + /** * A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name="method", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - */ - @Child(name="quantity", type={Quantity.class}, order=6, min=0, max=1) - @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." ) - protected Quantity quantity; - - /** - * Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. - */ - @Child(name="rate", type={Ratio.class}, order=7, min=0, max=1) - @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours. - */ - @Child(name="maxDosePerPeriod", type={Ratio.class}, order=8, min=0, max=1) - @Description(shortDefinition="Total dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = 1667442570L; - - public MedicationAdministrationDosageComponent() { - super(); - } - - /** - * @return {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) - */ - public MedicationAdministrationDosageComponent setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationAdministrationDosageComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) - */ - public MedicationAdministrationDosageComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) - */ - public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name="method", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. + */ + @Child(name="quantity", type={Quantity.class}, order=6, min=0, max=1) + @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. + */ + @Child(name="rate", type={Ratio.class}, order=7, min=0, max=1) + @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours. + */ + @Child(name="maxDosePerPeriod", type={Ratio.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = 1667442570L; + + public MedicationAdministrationDosageComponent() { + super(); + } + + /** + * @return {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).) + */ + public MedicationAdministrationDosageComponent setTiming(Type value) { + this.timing = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public MedicationAdministrationDosageComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm".) + */ + public MedicationAdministrationDosageComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.) + */ + public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** * @return {@link #method} (A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** * @param value {@link #method} (A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) - */ - public MedicationAdministrationDosageComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) - */ - public MedicationAdministrationDosageComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours.) - */ - public MedicationAdministrationDosageComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("timing[x]", "dateTime|Period", "The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity", "Quantity", "The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationAdministrationDosageComponent copy() { - MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent(); - copyValues(dst); - dst.timing = timing == null ? null : timing.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (timing == null || timing.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) - && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - } - - /** - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) - protected List identifier; - - /** - * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - */ - @Child(name="status", type={CodeType.class}, order=0, min=1, max=1) - @Description(shortDefinition="in progress | on hold | completed | entered in error | stopped", formalDefinition="Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way." ) - protected Enumeration status; - - /** - * The person or animal to whom the medication was given. - */ - @Child(name="patient", type={Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="Who received medication?", formalDefinition="The person or animal to whom the medication was given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person or animal to whom the medication was given.) - */ - protected Patient patientTarget; - - /** - * The individual who was responsible for giving the medication to the patient. - */ - @Child(name="practitioner", type={Practitioner.class}, order=2, min=1, max=1) - @Description(shortDefinition="Who administered substance?", formalDefinition="The individual who was responsible for giving the medication to the patient." ) - protected Reference practitioner; - - /** - * The actual object that is the target of the reference (The individual who was responsible for giving the medication to the patient.) - */ - protected Practitioner practitionerTarget; - - /** - * The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. - */ - @Child(name="encounter", type={Encounter.class}, order=3, min=0, max=1) - @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - protected Encounter encounterTarget; - - /** - * The original request, instruction or authority to perform the administration. - */ - @Child(name="prescription", type={MedicationPrescription.class}, order=4, min=1, max=1) - @Description(shortDefinition="Order administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." ) - protected Reference prescription; - - /** - * The actual object that is the target of the reference (The original request, instruction or authority to perform the administration.) - */ - protected MedicationPrescription prescriptionTarget; - - /** - * Set this to true if the record is saying that the medication was NOT administered. - */ - @Child(name="wasNotGiven", type={BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="True if medication not administered", formalDefinition="Set this to true if the record is saying that the medication was NOT administered." ) - protected BooleanType wasNotGiven; - - /** - * A code indicating why the administration was not performed. - */ - @Child(name="reasonNotGiven", type={CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." ) - protected List reasonNotGiven; - - /** - * An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same. - */ - @Child(name="effectiveTime", type={DateTimeType.class, Period.class}, order=7, min=1, max=1) - @Description(shortDefinition="Start and end time of administration", formalDefinition="An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same." ) - protected Type effectiveTime; - - /** - * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name="medication", type={Medication.class}, order=8, min=0, max=1) - @Description(shortDefinition="What was administered?", formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * The device used in administering the medication to the patient. E.g. a particular infusion pump. - */ - @Child(name="device", type={Device.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient. E.g. a particular infusion pump." ) - protected List device; - /** - * The actual objects that are the target of the reference (The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - protected List deviceTarget; - - - /** - * Provides details of how much of the medication was administered. - */ - @Child(name="dosage", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Medicine administration instructions to the patient/carer", formalDefinition="Provides details of how much of the medication was administered." ) - protected List dosage; - - private static final long serialVersionUID = -138666373L; - - public MedicationAdministration() { - super(); - } - - public MedicationAdministration(Enumeration status, Reference patient, Reference practitioner, Reference prescription, Type effectiveTime) { - super(); - this.status = status; - this.patient = patient; - this.practitioner = practitioner; - this.prescription = prescription; - this.effectiveTime = effectiveTime; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationAdministration setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - */ - public MedicationAdminStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - */ - public MedicationAdministration setStatus(MedicationAdminStatus value) { - if (this.status == null) - this.status = new Enumeration(MedicationAdminStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #patient} (The person or animal to whom the medication was given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.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} (The person or animal to whom the medication was given.) - */ - public MedicationAdministration 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. (The person or animal to whom the medication was given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.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. (The person or animal to whom the medication was given.) - */ - public MedicationAdministration setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) - */ - public Reference getPractitioner() { - if (this.practitioner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitioner = new Reference(); - return this.practitioner; - } - - public boolean hasPractitioner() { - return this.practitioner != null && !this.practitioner.isEmpty(); - } - - /** - * @param value {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) - */ - public MedicationAdministration setPractitioner(Reference value) { - this.practitioner = value; - return this; - } - - /** - * @return {@link #practitioner} 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 individual who was responsible for giving the medication to the patient.) - */ - public Practitioner getPractitionerTarget() { - if (this.practitionerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitionerTarget = new Practitioner(); - return this.practitionerTarget; - } - - /** - * @param value {@link #practitioner} 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 individual who was responsible for giving the medication to the patient.) - */ - public MedicationAdministration setPractitionerTarget(Practitioner value) { - this.practitionerTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.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 visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public MedicationAdministration 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 visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.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 visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public MedicationAdministration setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #prescription} (The original request, instruction or authority to perform the administration.) - */ - public Reference getPrescription() { - if (this.prescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.prescription"); - else if (Configuration.doAutoCreate()) - this.prescription = new Reference(); - return this.prescription; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (The original request, instruction or authority to perform the administration.) - */ - public MedicationAdministration setPrescription(Reference value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #prescription} 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 original request, instruction or authority to perform the administration.) - */ - public MedicationPrescription getPrescriptionTarget() { - if (this.prescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.prescription"); - else if (Configuration.doAutoCreate()) - this.prescriptionTarget = new MedicationPrescription(); - return this.prescriptionTarget; - } - - /** - * @param value {@link #prescription} 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 original request, instruction or authority to perform the administration.) - */ - public MedicationAdministration setPrescriptionTarget(MedicationPrescription value) { - this.prescriptionTarget = value; - return this; - } - - /** - * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public MedicationAdministration setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the medication was NOT administered. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the medication was NOT administered. - */ - public MedicationAdministration setWasNotGiven(boolean value) { - if (value == false) - this.wasNotGiven = null; - else { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - } - return this; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - /** - * @return {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) - */ - public Type getEffectiveTime() { - return this.effectiveTime; - } - - /** - * @return {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) - */ - public DateTimeType getEffectiveTimeDateTimeType() throws Exception { - if (!(this.effectiveTime instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (DateTimeType) this.effectiveTime; - } - - /** - * @return {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) - */ - public Period getEffectiveTimePeriod() throws Exception { - if (!(this.effectiveTime instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (Period) this.effectiveTime; - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) - */ - public MedicationAdministration setEffectiveTime(Type value) { - this.effectiveTime = value; - return this; - } - - /** - * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationAdministration setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} 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 medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); - return this.medicationTarget; - } - - /** - * @param value {@link #medication} 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 medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationAdministration setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - public List getDevice() { - if (this.device == null) - this.device = new ArrayList(); - return this.device; - } - - public boolean hasDevice() { - if (this.device == null) - return false; - for (Reference item : this.device) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - // syntactic sugar - public Reference addDevice() { //3 - Reference t = new Reference(); - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return t; - } - - /** - * @return {@link #device} (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 device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - public List getDeviceTarget() { - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - return this.deviceTarget; - } - - // syntactic sugar - /** - * @return {@link #device} (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 device used in administering the medication to the patient. E.g. a particular infusion pump.) - */ - public Device addDeviceTarget() { - Device r = new Device(); - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - this.deviceTarget.add(r); - return r; - } - - /** - * @return {@link #dosage} (Provides details of how much of the medication was administered.) - */ - public List getDosage() { - if (this.dosage == null) - this.dosage = new ArrayList(); - return this.dosage; - } - - public boolean hasDosage() { - if (this.dosage == null) - return false; - for (MedicationAdministrationDosageComponent item : this.dosage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosage} (Provides details of how much of the medication was administered.) - */ - // syntactic sugar - public MedicationAdministrationDosageComponent addDosage() { //3 - MedicationAdministrationDosageComponent t = new MedicationAdministrationDosageComponent(); - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal to whom the medication was given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("practitioner", "Reference(Practitioner)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, practitioner)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT administered.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient. E.g. a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("dosage", "", "Provides details of how much of the medication was administered.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - public MedicationAdministration copy() { - MedicationAdministration dst = new MedicationAdministration(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.practitioner = practitioner == null ? null : practitioner.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.prescription = prescription == null ? null : prescription.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.medication = medication == null ? null : medication.copy(); - if (device != null) { - dst.device = new ArrayList(); - for (Reference i : device) - dst.device.add(i.copy()); - }; - if (dosage != null) { - dst.dosage = new ArrayList(); - for (MedicationAdministrationDosageComponent i : dosage) - dst.dosage.add(i.copy()); - }; - return dst; - } - - protected MedicationAdministration typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (practitioner == null || practitioner.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (prescription == null || prescription.isEmpty()) - && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) - && (effectiveTime == null || effectiveTime.isEmpty()) && (medication == null || medication.isEmpty()) - && (device == null || device.isEmpty()) && (dosage == null || dosage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationAdministration; - } - - @SearchParamDefinition(name="medication", path="MedicationAdministration.medication", description="Return administrations of this medication", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="effectivetime", path="MedicationAdministration.effectiveTime[x]", description="Date administration happened (or did not happen)", type="date" ) - public static final String SP_EFFECTIVETIME = "effectivetime"; - @SearchParamDefinition(name="patient", path="MedicationAdministration.patient", description="The identity of a patient to list administrations for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="MedicationAdministration.status", description="MedicationAdministration event status (for example one of active/paused/completed/nullified)", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="prescription", path="MedicationAdministration.prescription", description="The identity of a prescription to list administrations from", type="reference" ) - public static final String SP_PRESCRIPTION = "prescription"; - @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference" ) - public static final String SP_DEVICE = "device"; - @SearchParamDefinition(name="notgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) - public static final String SP_NOTGIVEN = "notgiven"; - @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter", description="Return administrations that share this encounter", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.) + */ + public MedicationAdministrationDosageComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.) + */ + public MedicationAdministrationDosageComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours.) + */ + public MedicationAdministrationDosageComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("timing[x]", "dateTime|Period", "The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period).", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body. E.g. 'left arm'.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity", "Quantity", "The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationAdministrationDosageComponent copy() { + MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent(); + copyValues(dst); + dst.timing = timing == null ? null : timing.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (timing == null || timing.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) + && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + } + + /** + * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) + protected List identifier; + + /** + * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + @Child(name="status", type={CodeType.class}, order=0, min=1, max=1) + @Description(shortDefinition="in progress | on hold | completed | entered in error | stopped", formalDefinition="Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way." ) + protected Enumeration status; + + /** + * The person or animal to whom the medication was given. + */ + @Child(name="patient", type={Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="Who received medication?", formalDefinition="The person or animal to whom the medication was given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person or animal to whom the medication was given.) + */ + protected Patient patientTarget; + + /** + * The individual who was responsible for giving the medication to the patient. + */ + @Child(name="practitioner", type={Practitioner.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who administered substance?", formalDefinition="The individual who was responsible for giving the medication to the patient." ) + protected Reference practitioner; + + /** + * The actual object that is the target of the reference (The individual who was responsible for giving the medication to the patient.) + */ + protected Practitioner practitionerTarget; + + /** + * The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. + */ + @Child(name="encounter", type={Encounter.class}, order=3, min=0, max=1) + @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + protected Encounter encounterTarget; + + /** + * The original request, instruction or authority to perform the administration. + */ + @Child(name="prescription", type={MedicationPrescription.class}, order=4, min=1, max=1) + @Description(shortDefinition="Order administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (The original request, instruction or authority to perform the administration.) + */ + protected MedicationPrescription prescriptionTarget; + + /** + * Set this to true if the record is saying that the medication was NOT administered. + */ + @Child(name="wasNotGiven", type={BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="True if medication not administered", formalDefinition="Set this to true if the record is saying that the medication was NOT administered." ) + protected BooleanType wasNotGiven; + + /** + * A code indicating why the administration was not performed. + */ + @Child(name="reasonNotGiven", type={CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." ) + protected List reasonNotGiven; + + /** + * An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same. + */ + @Child(name="effectiveTime", type={DateTimeType.class, Period.class}, order=7, min=1, max=1) + @Description(shortDefinition="Start and end time of administration", formalDefinition="An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same." ) + protected Type effectiveTime; + + /** + * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name="medication", type={Medication.class}, order=8, min=0, max=1) + @Description(shortDefinition="What was administered?", formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Reference medication; + + /** + * The actual object that is the target of the reference (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + protected Medication medicationTarget; + + /** + * The device used in administering the medication to the patient. E.g. a particular infusion pump. + */ + @Child(name="device", type={Device.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient. E.g. a particular infusion pump." ) + protected List device; + /** + * The actual objects that are the target of the reference (The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + protected List deviceTarget; + + + /** + * Provides details of how much of the medication was administered. + */ + @Child(name="dosage", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Medicine administration instructions to the patient/carer", formalDefinition="Provides details of how much of the medication was administered." ) + protected List dosage; + + private static final long serialVersionUID = -138666373L; + + public MedicationAdministration() { + super(); + } + + public MedicationAdministration(Enumeration status, Reference patient, Reference practitioner, Reference prescription, Type effectiveTime) { + super(); + this.status = status; + this.patient = patient; + this.practitioner = practitioner; + this.prescription = prescription; + this.effectiveTime = effectiveTime; + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #status} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationAdministration setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + public MedicationAdminStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + */ + public MedicationAdministration setStatus(MedicationAdminStatus value) { + if (this.status == null) + this.status = new Enumeration(MedicationAdminStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #patient} (The person or animal to whom the medication was given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.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} (The person or animal to whom the medication was given.) + */ + public MedicationAdministration 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. (The person or animal to whom the medication was given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.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. (The person or animal to whom the medication was given.) + */ + public MedicationAdministration setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) + */ + public Reference getPractitioner() { + if (this.practitioner == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitioner = new Reference(); + return this.practitioner; + } + + public boolean hasPractitioner() { + return this.practitioner != null && !this.practitioner.isEmpty(); + } + + /** + * @param value {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) + */ + public MedicationAdministration setPractitioner(Reference value) { + this.practitioner = value; + return this; + } + + /** + * @return {@link #practitioner} 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 individual who was responsible for giving the medication to the patient.) + */ + public Practitioner getPractitionerTarget() { + if (this.practitionerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); + else if (Configuration.doAutoCreate()) + this.practitionerTarget = new Practitioner(); + return this.practitionerTarget; + } + + /** + * @param value {@link #practitioner} 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 individual who was responsible for giving the medication to the patient.) + */ + public MedicationAdministration setPractitionerTarget(Practitioner value) { + this.practitionerTarget = value; + return this; + } + + /** + * @return {@link #encounter} (The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.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 visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public MedicationAdministration 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 visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.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 visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.) + */ + public MedicationAdministration setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #prescription} (The original request, instruction or authority to perform the administration.) + */ + public Reference getPrescription() { + if (this.prescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.prescription"); + else if (Configuration.doAutoCreate()) + this.prescription = new Reference(); + return this.prescription; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (The original request, instruction or authority to perform the administration.) + */ + public MedicationAdministration setPrescription(Reference value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #prescription} 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 original request, instruction or authority to perform the administration.) + */ + public MedicationPrescription getPrescriptionTarget() { + if (this.prescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.prescription"); + else if (Configuration.doAutoCreate()) + this.prescriptionTarget = new MedicationPrescription(); + return this.prescriptionTarget; + } + + /** + * @param value {@link #prescription} 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 original request, instruction or authority to perform the administration.) + */ + public MedicationAdministration setPrescriptionTarget(MedicationPrescription value) { + this.prescriptionTarget = value; + return this; + } + + /** + * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public BooleanType getWasNotGivenElement() { + if (this.wasNotGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.wasNotGiven"); + else if (Configuration.doAutoCreate()) + this.wasNotGiven = new BooleanType(); + return this.wasNotGiven; + } + + public boolean hasWasNotGivenElement() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + public boolean hasWasNotGiven() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + /** + * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public MedicationAdministration setWasNotGivenElement(BooleanType value) { + this.wasNotGiven = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the medication was NOT administered. + */ + public boolean getWasNotGiven() { + return this.wasNotGiven == null ? false : this.wasNotGiven.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the medication was NOT administered. + */ + public MedicationAdministration setWasNotGiven(boolean value) { + if (value == false) + this.wasNotGiven = null; + else { + if (this.wasNotGiven == null) + this.wasNotGiven = new BooleanType(); + this.wasNotGiven.setValue(value); + } + return this; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) + */ + public List getReasonNotGiven() { + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + return this.reasonNotGiven; + } + + public boolean hasReasonNotGiven() { + if (this.reasonNotGiven == null) + return false; + for (CodeableConcept item : this.reasonNotGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) + */ + // syntactic sugar + public CodeableConcept addReasonNotGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return t; + } + + /** + * @return {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) + */ + public Type getEffectiveTime() { + return this.effectiveTime; + } + + /** + * @return {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) + */ + public DateTimeType getEffectiveTimeDateTimeType() throws Exception { + if (!(this.effectiveTime instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); + return (DateTimeType) this.effectiveTime; + } + + /** + * @return {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) + */ + public Period getEffectiveTimePeriod() throws Exception { + if (!(this.effectiveTime instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); + return (Period) this.effectiveTime; + } + + public boolean hasEffectiveTime() { + return this.effectiveTime != null && !this.effectiveTime.isEmpty(); + } + + /** + * @param value {@link #effectiveTime} (An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.) + */ + public MedicationAdministration setEffectiveTime(Type value) { + this.effectiveTime = value; + return this; + } + + /** + * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedication() { + if (this.medication == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.medication"); + else if (Configuration.doAutoCreate()) + this.medication = new Reference(); + return this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationAdministration setMedication(Reference value) { + this.medication = value; + return this; + } + + /** + * @return {@link #medication} 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 medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Medication getMedicationTarget() { + if (this.medicationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationAdministration.medication"); + else if (Configuration.doAutoCreate()) + this.medicationTarget = new Medication(); + return this.medicationTarget; + } + + /** + * @param value {@link #medication} 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 medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationAdministration setMedicationTarget(Medication value) { + this.medicationTarget = value; + return this; + } + + /** + * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + public List getDevice() { + if (this.device == null) + this.device = new ArrayList(); + return this.device; + } + + public boolean hasDevice() { + if (this.device == null) + return false; + for (Reference item : this.device) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #device} (The device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + // syntactic sugar + public Reference addDevice() { //3 + Reference t = new Reference(); + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return t; + } + + /** + * @return {@link #device} (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 device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + public List getDeviceTarget() { + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + return this.deviceTarget; + } + + // syntactic sugar + /** + * @return {@link #device} (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 device used in administering the medication to the patient. E.g. a particular infusion pump.) + */ + public Device addDeviceTarget() { + Device r = new Device(); + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + this.deviceTarget.add(r); + return r; + } + + /** + * @return {@link #dosage} (Provides details of how much of the medication was administered.) + */ + public List getDosage() { + if (this.dosage == null) + this.dosage = new ArrayList(); + return this.dosage; + } + + public boolean hasDosage() { + if (this.dosage == null) + return false; + for (MedicationAdministrationDosageComponent item : this.dosage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosage} (Provides details of how much of the medication was administered.) + */ + // syntactic sugar + public MedicationAdministrationDosageComponent addDosage() { //3 + MedicationAdministrationDosageComponent t = new MedicationAdministrationDosageComponent(); + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal to whom the medication was given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("practitioner", "Reference(Practitioner)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, practitioner)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT administered.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); + childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); + childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); + childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient. E.g. a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("dosage", "", "Provides details of how much of the medication was administered.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + public MedicationAdministration copy() { + MedicationAdministration dst = new MedicationAdministration(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.practitioner = practitioner == null ? null : practitioner.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.prescription = prescription == null ? null : prescription.copy(); + dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); + if (reasonNotGiven != null) { + dst.reasonNotGiven = new ArrayList(); + for (CodeableConcept i : reasonNotGiven) + dst.reasonNotGiven.add(i.copy()); + }; + dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); + dst.medication = medication == null ? null : medication.copy(); + if (device != null) { + dst.device = new ArrayList(); + for (Reference i : device) + dst.device.add(i.copy()); + }; + if (dosage != null) { + dst.dosage = new ArrayList(); + for (MedicationAdministrationDosageComponent i : dosage) + dst.dosage.add(i.copy()); + }; + return dst; + } + + protected MedicationAdministration typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (practitioner == null || practitioner.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (prescription == null || prescription.isEmpty()) + && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) + && (effectiveTime == null || effectiveTime.isEmpty()) && (medication == null || medication.isEmpty()) + && (device == null || device.isEmpty()) && (dosage == null || dosage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationAdministration; + } + + @SearchParamDefinition(name="medication", path="MedicationAdministration.medication", description="Return administrations of this medication", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="effectivetime", path="MedicationAdministration.effectiveTime[x]", description="Date administration happened (or did not happen)", type="date" ) + public static final String SP_EFFECTIVETIME = "effectivetime"; + @SearchParamDefinition(name="patient", path="MedicationAdministration.patient", description="The identity of a patient to list administrations for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="MedicationAdministration.status", description="MedicationAdministration event status (for example one of active/paused/completed/nullified)", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="prescription", path="MedicationAdministration.prescription", description="The identity of a prescription to list administrations from", type="reference" ) + public static final String SP_PRESCRIPTION = "prescription"; + @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference" ) + public static final String SP_DEVICE = "device"; + @SearchParamDefinition(name="notgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) + public static final String SP_NOTGIVEN = "notgiven"; + @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter", description="Return administrations that share this encounter", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java index 49cffa567c9..a8e90f16cc4 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java @@ -20,1634 +20,1634 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. - */ -@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") -public class MedicationDispense extends DomainResource { - - public enum MedicationDispenseStatus implements FhirEnum { - /** - * The dispense has started but has not yet completed. - */ - INPROGRESS, - /** - * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the dispense have occurred. - */ - COMPLETED, - /** - * The dispense was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the dispense have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return INPROGRESS; - if ("on hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered in error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - case STOPPED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The dispense has started but has not yet completed."; - case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the dispense have occurred."; - case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "in progress"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered in error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - } - - public static class MedicationDispenseStatusEnumFactory implements EnumFactory { - public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in progress".equals(codeString)) - return MedicationDispenseStatus.INPROGRESS; - if ("on hold".equals(codeString)) - return MedicationDispenseStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationDispenseStatus.COMPLETED; - if ("entered in error".equals(codeString)) - return MedicationDispenseStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationDispenseStatus.STOPPED; - throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - public String toCode(MedicationDispenseStatus code) throws IllegalArgumentException { - if (code == MedicationDispenseStatus.INPROGRESS) - return "in progress"; - if (code == MedicationDispenseStatus.ONHOLD) - return "on hold"; - if (code == MedicationDispenseStatus.COMPLETED) - return "completed"; - if (code == MedicationDispenseStatus.ENTEREDINERROR) - return "entered in error"; - if (code == MedicationDispenseStatus.STOPPED) - return "stopped"; - return "?"; - } - } - - @Block() - public static class MedicationDispenseDispenseComponent extends BackboneElement { - /** - * Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="External identifier for individual item", formalDefinition="Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR." ) - protected Identifier identifier; - - /** - * A code specifying the state of the dispense event. - */ - @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="in progress | on hold | completed | entered in error | stopped", formalDefinition="A code specifying the state of the dispense event." ) - protected Enumeration status; - - /** - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) - protected CodeableConcept type; - - /** - * The amount of medication that has been dispensed. Includes unit of measure. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." ) - protected Quantity quantity; - - /** - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name="medication", type={Medication.class}, order=5, min=0, max=1) - @Description(shortDefinition="What medication was supplied", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * The time when the dispensed product was packaged and reviewed. - */ - @Child(name="whenPrepared", type={DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Dispense processing time", formalDefinition="The time when the dispensed product was packaged and reviewed." ) - protected DateTimeType whenPrepared; - - /** - * The time the dispensed product was provided to the patient or their representative. - */ - @Child(name="whenHandedOver", type={DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed product was provided to the patient or their representative." ) - protected DateTimeType whenHandedOver; - - /** - * Identification of the facility/location where the medication was shipped to, as part of the dispense event. - */ - @Child(name="destination", type={Location.class}, order=8, min=0, max=1) - @Description(shortDefinition="Where the medication was sent", formalDefinition="Identification of the facility/location where the medication was shipped to, as part of the dispense event." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional. - */ - @Child(name="receiver", type={Patient.class, Practitioner.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who collected the medication", formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - protected List receiverTarget; - - - /** - * Indicates how the medication is to be used by the patient. - */ - @Child(name="dosage", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Medicine administration instructions to the patient/carer", formalDefinition="Indicates how the medication is to be used by the patient." ) - protected List dosage; - - private static final long serialVersionUID = -1394745561L; - - public MedicationDispenseDispenseComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR.) - */ - public MedicationDispenseDispenseComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationDispenseDispenseComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the dispense event. - */ - public MedicationDispenseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the dispense event. - */ - public MedicationDispenseDispenseComponent setStatus(MedicationDispenseStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(MedicationDispenseStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public MedicationDispenseDispenseComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) - */ - public MedicationDispenseDispenseComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationDispenseDispenseComponent setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); - return this.medicationTarget; - } - - /** - * @param value {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationDispenseDispenseComponent setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value - */ - public DateTimeType getWhenPreparedElement() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new DateTimeType(); - return this.whenPrepared; - } - - public boolean hasWhenPreparedElement() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value - */ - public MedicationDispenseDispenseComponent setWhenPreparedElement(DateTimeType value) { - this.whenPrepared = value; - return this; - } - - /** - * @return The time when the dispensed product was packaged and reviewed. - */ - 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(Date value) { - if (value == null) - this.whenPrepared = null; - else { - if (this.whenPrepared == null) - this.whenPrepared = new DateTimeType(); - this.whenPrepared.setValue(value); - } - return this; - } - - /** - * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public DateTimeType getWhenHandedOverElement() { - if (this.whenHandedOver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.whenHandedOver"); - else if (Configuration.doAutoCreate()) - this.whenHandedOver = new DateTimeType(); - return this.whenHandedOver; - } - - public boolean hasWhenHandedOverElement() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - public boolean hasWhenHandedOver() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - /** - * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public MedicationDispenseDispenseComponent setWhenHandedOverElement(DateTimeType value) { - this.whenHandedOver = value; - return this; - } - - /** - * @return The time the dispensed product was provided to the patient or their representative. - */ - 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(Date value) { - if (value == null) - this.whenHandedOver = null; - else { - if (this.whenHandedOver == null) - this.whenHandedOver = new DateTimeType(); - this.whenHandedOver.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public MedicationDispenseDispenseComponent setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} 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. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); - return this.destinationTarget; - } - - /** - * @param value {@link #destination} 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. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public MedicationDispenseDispenseComponent setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - /** - * @return {@link #receiver} (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 person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - /** - * @return {@link #dosage} (Indicates how the medication is to be used by the patient.) - */ - public List getDosage() { - if (this.dosage == null) - this.dosage = new ArrayList(); - return this.dosage; - } - - public boolean hasDosage() { - if (this.dosage == null) - return false; - for (MedicationDispenseDispenseDosageComponent item : this.dosage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosage} (Indicates how the medication is to be used by the patient.) - */ - // syntactic sugar - public MedicationDispenseDispenseDosageComponent addDosage() { //3 - MedicationDispenseDispenseDosageComponent t = new MedicationDispenseDispenseDosageComponent(); - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "Quantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Patient|Practitioner)", "Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.", 0, java.lang.Integer.MAX_VALUE, receiver)); - childrenList.add(new Property("dosage", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - public MedicationDispenseDispenseComponent copy() { - MedicationDispenseDispenseComponent dst = new MedicationDispenseDispenseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.medication = medication == null ? null : medication.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - if (dosage != null) { - dst.dosage = new ArrayList(); - for (MedicationDispenseDispenseDosageComponent i : dosage) - dst.dosage.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (medication == null || medication.isEmpty()) - && (whenPrepared == null || whenPrepared.isEmpty()) && (whenHandedOver == null || whenHandedOver.isEmpty()) - && (destination == null || destination.isEmpty()) && (receiver == null || receiver.isEmpty()) - && (dosage == null || dosage.isEmpty()); - } - - } - - @Block() - public static class MedicationDispenseDispenseDosageComponent extends BackboneElement { - /** - * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. - */ - @Child(name="additionalInstructions", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="E.g. 'Take with food'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) - protected CodeableConcept additionalInstructions; - - /** - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name="schedule", type={DateTimeType.class, Period.class, Timing.class}, order=2, min=0, max=1) - @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type schedule; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name="site", type={CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - */ - @Child(name="route", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) - protected CodeableConcept route; - - /** + +/* + 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; +/** + * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + */ +@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") +public class MedicationDispense extends DomainResource { + + public enum MedicationDispenseStatus implements FhirEnum { + /** + * The dispense has started but has not yet completed. + */ + INPROGRESS, + /** + * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the dispense have occurred. + */ + COMPLETED, + /** + * The dispense was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the dispense have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return INPROGRESS; + if ("on hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered in error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + case STOPPED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The dispense has started but has not yet completed."; + case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the dispense have occurred."; + case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered in error"; + case STOPPED: return "stopped"; + default: return "?"; + } + } + } + + public static class MedicationDispenseStatusEnumFactory implements EnumFactory { + public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return MedicationDispenseStatus.INPROGRESS; + if ("on hold".equals(codeString)) + return MedicationDispenseStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationDispenseStatus.COMPLETED; + if ("entered in error".equals(codeString)) + return MedicationDispenseStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationDispenseStatus.STOPPED; + throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); + } + public String toCode(MedicationDispenseStatus code) throws IllegalArgumentException { + if (code == MedicationDispenseStatus.INPROGRESS) + return "in progress"; + if (code == MedicationDispenseStatus.ONHOLD) + return "on hold"; + if (code == MedicationDispenseStatus.COMPLETED) + return "completed"; + if (code == MedicationDispenseStatus.ENTEREDINERROR) + return "entered in error"; + if (code == MedicationDispenseStatus.STOPPED) + return "stopped"; + return "?"; + } + } + + @Block() + public static class MedicationDispenseDispenseComponent extends BackboneElement { + /** + * Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="External identifier for individual item", formalDefinition="Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR." ) + protected Identifier identifier; + + /** + * A code specifying the state of the dispense event. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="in progress | on hold | completed | entered in error | stopped", formalDefinition="A code specifying the state of the dispense event." ) + protected Enumeration status; + + /** + * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of medication that has been dispensed. Includes unit of measure. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." ) + protected Quantity quantity; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name="medication", type={Medication.class}, order=5, min=0, max=1) + @Description(shortDefinition="What medication was supplied", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Reference medication; + + /** + * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + protected Medication medicationTarget; + + /** + * The time when the dispensed product was packaged and reviewed. + */ + @Child(name="whenPrepared", type={DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Dispense processing time", formalDefinition="The time when the dispensed product was packaged and reviewed." ) + protected DateTimeType whenPrepared; + + /** + * The time the dispensed product was provided to the patient or their representative. + */ + @Child(name="whenHandedOver", type={DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed product was provided to the patient or their representative." ) + protected DateTimeType whenHandedOver; + + /** + * Identification of the facility/location where the medication was shipped to, as part of the dispense event. + */ + @Child(name="destination", type={Location.class}, order=8, min=0, max=1) + @Description(shortDefinition="Where the medication was sent", formalDefinition="Identification of the facility/location where the medication was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional. + */ + @Child(name="receiver", type={Patient.class, Practitioner.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who collected the medication", formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + protected List receiverTarget; + + + /** + * Indicates how the medication is to be used by the patient. + */ + @Child(name="dosage", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Medicine administration instructions to the patient/carer", formalDefinition="Indicates how the medication is to be used by the patient." ) + protected List dosage; + + private static final long serialVersionUID = -1394745561L; + + public MedicationDispenseDispenseComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR.) + */ + public MedicationDispenseDispenseComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationDispenseDispenseComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the dispense event. + */ + public MedicationDispenseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the dispense event. + */ + public MedicationDispenseDispenseComponent setStatus(MedicationDispenseStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(MedicationDispenseStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public MedicationDispenseDispenseComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) + */ + public MedicationDispenseDispenseComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedication() { + if (this.medication == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.medication"); + else if (Configuration.doAutoCreate()) + this.medication = new Reference(); + return this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationDispenseDispenseComponent setMedication(Reference value) { + this.medication = value; + return this; + } + + /** + * @return {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Medication getMedicationTarget() { + if (this.medicationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.medication"); + else if (Configuration.doAutoCreate()) + this.medicationTarget = new Medication(); + return this.medicationTarget; + } + + /** + * @param value {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationDispenseDispenseComponent setMedicationTarget(Medication value) { + this.medicationTarget = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value + */ + public DateTimeType getWhenPreparedElement() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new DateTimeType(); + return this.whenPrepared; + } + + public boolean hasWhenPreparedElement() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value + */ + public MedicationDispenseDispenseComponent setWhenPreparedElement(DateTimeType value) { + this.whenPrepared = value; + return this; + } + + /** + * @return The time when the dispensed product was packaged and reviewed. + */ + 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(Date value) { + if (value == null) + this.whenPrepared = null; + else { + if (this.whenPrepared == null) + this.whenPrepared = new DateTimeType(); + this.whenPrepared.setValue(value); + } + return this; + } + + /** + * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public DateTimeType getWhenHandedOverElement() { + if (this.whenHandedOver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.whenHandedOver"); + else if (Configuration.doAutoCreate()) + this.whenHandedOver = new DateTimeType(); + return this.whenHandedOver; + } + + public boolean hasWhenHandedOverElement() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + public boolean hasWhenHandedOver() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + /** + * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value + */ + public MedicationDispenseDispenseComponent setWhenHandedOverElement(DateTimeType value) { + this.whenHandedOver = value; + return this; + } + + /** + * @return The time the dispensed product was provided to the patient or their representative. + */ + 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(Date value) { + if (value == null) + this.whenHandedOver = null; + else { + if (this.whenHandedOver == null) + this.whenHandedOver = new DateTimeType(); + this.whenHandedOver.setValue(value); + } + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public MedicationDispenseDispenseComponent setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} 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. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); + return this.destinationTarget; + } + + /** + * @param value {@link #destination} 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. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) + */ + public MedicationDispenseDispenseComponent setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + /** + * @return {@link #receiver} (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 person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + /** + * @return {@link #dosage} (Indicates how the medication is to be used by the patient.) + */ + public List getDosage() { + if (this.dosage == null) + this.dosage = new ArrayList(); + return this.dosage; + } + + public boolean hasDosage() { + if (this.dosage == null) + return false; + for (MedicationDispenseDispenseDosageComponent item : this.dosage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosage} (Indicates how the medication is to be used by the patient.) + */ + // syntactic sugar + public MedicationDispenseDispenseDosageComponent addDosage() { //3 + MedicationDispenseDispenseDosageComponent t = new MedicationDispenseDispenseDosageComponent(); + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "Quantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Patient|Practitioner)", "Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional.", 0, java.lang.Integer.MAX_VALUE, receiver)); + childrenList.add(new Property("dosage", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + public MedicationDispenseDispenseComponent copy() { + MedicationDispenseDispenseComponent dst = new MedicationDispenseDispenseComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.medication = medication == null ? null : medication.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + if (dosage != null) { + dst.dosage = new ArrayList(); + for (MedicationDispenseDispenseDosageComponent i : dosage) + dst.dosage.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (medication == null || medication.isEmpty()) + && (whenPrepared == null || whenPrepared.isEmpty()) && (whenHandedOver == null || whenHandedOver.isEmpty()) + && (destination == null || destination.isEmpty()) && (receiver == null || receiver.isEmpty()) + && (dosage == null || dosage.isEmpty()); + } + + } + + @Block() + public static class MedicationDispenseDispenseDosageComponent extends BackboneElement { + /** + * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + */ + @Child(name="additionalInstructions", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="E.g. 'Take with food'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) + protected CodeableConcept additionalInstructions; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name="schedule", type={DateTimeType.class, Period.class, Timing.class}, order=2, min=0, max=1) + @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type schedule; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + */ + @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name="site", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + */ + @Child(name="route", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) + protected CodeableConcept route; + + /** * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name="method", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) - @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Quantity quantity; - - /** - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - */ - @Child(name="rate", type={Ratio.class}, order=8, min=0, max=1) - @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. - */ - @Child(name="maxDosePerPeriod", type={Ratio.class}, order=9, min=0, max=1) - @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -677555528L; - - public MedicationDispenseDispenseDosageComponent() { - super(); - } - - /** - * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public CodeableConcept getAdditionalInstructions() { - if (this.additionalInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.additionalInstructions"); - else if (Configuration.doAutoCreate()) - this.additionalInstructions = new CodeableConcept(); - return this.additionalInstructions; - } - - public boolean hasAdditionalInstructions() { - return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); - } - - /** - * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public MedicationDispenseDispenseDosageComponent setAdditionalInstructions(CodeableConcept value) { - this.additionalInstructions = value; - return this; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getSchedule() { - return this.schedule; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getScheduleDateTimeType() throws Exception { - if (!(this.schedule instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.schedule.getClass().getName()+" was encountered"); - return (DateTimeType) this.schedule; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getSchedulePeriod() throws Exception { - if (!(this.schedule instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.schedule.getClass().getName()+" was encountered"); - return (Period) this.schedule; - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getScheduleTiming() throws Exception { - if (!(this.schedule instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.schedule.getClass().getName()+" was encountered"); - return (Timing) this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public MedicationDispenseDispenseDosageComponent setSchedule(Type value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationDispenseDispenseDosageComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationDispenseDispenseDosageComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public MedicationDispenseDispenseDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name="method", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + */ + @Child(name="rate", type={Ratio.class}, order=8, min=0, max=1) + @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. + */ + @Child(name="maxDosePerPeriod", type={Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -677555528L; + + public MedicationDispenseDispenseDosageComponent() { + super(); + } + + /** + * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public CodeableConcept getAdditionalInstructions() { + if (this.additionalInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.additionalInstructions"); + else if (Configuration.doAutoCreate()) + this.additionalInstructions = new CodeableConcept(); + return this.additionalInstructions; + } + + public boolean hasAdditionalInstructions() { + return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); + } + + /** + * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public MedicationDispenseDispenseDosageComponent setAdditionalInstructions(CodeableConcept value) { + this.additionalInstructions = value; + return this; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getSchedule() { + return this.schedule; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getScheduleDateTimeType() throws Exception { + if (!(this.schedule instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.schedule.getClass().getName()+" was encountered"); + return (DateTimeType) this.schedule; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getSchedulePeriod() throws Exception { + if (!(this.schedule instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.schedule.getClass().getName()+" was encountered"); + return (Period) this.schedule; + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getScheduleTiming() throws Exception { + if (!(this.schedule instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.schedule.getClass().getName()+" was encountered"); + return (Timing) this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationDispenseDispenseDosageComponent setSchedule(Type value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public MedicationDispenseDispenseDosageComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationDispenseDispenseDosageComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public MedicationDispenseDispenseDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationDispenseDispenseDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationDispenseDispenseDosageComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public MedicationDispenseDispenseDosageComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) - */ - public MedicationDispenseDispenseDosageComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); - childrenList.add(new Property("schedule[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationDispenseDispenseDosageComponent copy() { - MedicationDispenseDispenseDosageComponent dst = new MedicationDispenseDispenseDosageComponent(); - copyValues(dst); - dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (additionalInstructions == null || additionalInstructions.isEmpty()) - && (schedule == null || schedule.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationDispenseSubstitutionComponent extends BackboneElement { - /** - * A code signifying whether a different drug was dispensed from what was prescribed. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type of substitiution", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." ) - protected CodeableConcept type; - - /** - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - */ - @Child(name="reason", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." ) - protected List reason; - - /** - * The person or organization that has primary responsibility for the substitution. - */ - @Child(name="responsibleParty", type={Practitioner.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." ) - protected List responsibleParty; - /** - * The actual objects that are the target of the reference (The person or organization that has primary responsibility for the substitution.) - */ - protected List responsiblePartyTarget; - - - private static final long serialVersionUID = 1218245830L; - - public MedicationDispenseSubstitutionComponent() { - super(); - } - - public MedicationDispenseSubstitutionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) - */ - public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - /** - * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) - */ - public List getResponsibleParty() { - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - return this.responsibleParty; - } - - public boolean hasResponsibleParty() { - if (this.responsibleParty == null) - return false; - for (Reference item : this.responsibleParty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) - */ - // syntactic sugar - public Reference addResponsibleParty() { //3 - Reference t = new Reference(); - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - this.responsibleParty.add(t); - return t; - } - - /** - * @return {@link #responsibleParty} (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 person or organization that has primary responsibility for the substitution.) - */ - public List getResponsiblePartyTarget() { - if (this.responsiblePartyTarget == null) - this.responsiblePartyTarget = new ArrayList(); - return this.responsiblePartyTarget; - } - - // syntactic sugar - /** - * @return {@link #responsibleParty} (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 person or organization that has primary responsibility for the substitution.) - */ - public Practitioner addResponsiblePartyTarget() { - Practitioner r = new Practitioner(); - if (this.responsiblePartyTarget == null) - this.responsiblePartyTarget = new ArrayList(); - this.responsiblePartyTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("responsibleParty", "Reference(Practitioner)", "The person or organization that has primary responsibility for the substitution.", 0, java.lang.Integer.MAX_VALUE, responsibleParty)); - } - - public MedicationDispenseSubstitutionComponent copy() { - MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (responsibleParty != null) { - dst.responsibleParty = new ArrayList(); - for (Reference i : responsibleParty) - dst.responsibleParty.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - && (responsibleParty == null || responsibleParty.isEmpty()); - } - - } - - /** - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." ) - protected Identifier identifier; - - /** - * A code specifying the state of the set of dispense events. - */ - @Child(name="status", type={CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="in progress | on hold | completed | entered in error | stopped", formalDefinition="A code specifying the state of the set of dispense events." ) - protected Enumeration status; - - /** - * A link to a resource representing the person to whom the medication will be given. - */ - @Child(name="patient", type={Patient.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) - */ - protected Patient patientTarget; - - /** - * The individual responsible for dispensing the medication. - */ - @Child(name="dispenser", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Practitioner responsible for dispensing medication", formalDefinition="The individual responsible for dispensing the medication." ) - protected Reference dispenser; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication.) - */ - protected Practitioner dispenserTarget; - - /** - * Indicates the medication order that is being dispensed against. - */ - @Child(name="authorizingPrescription", type={MedicationPrescription.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." ) - protected List authorizingPrescription; - /** - * The actual objects that are the target of the reference (Indicates the medication order that is being dispensed against.) - */ - protected List authorizingPrescriptionTarget; - - - /** - * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - */ - @Child(name="dispense", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details for individual dispensed medicationdetails", formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of medication dispensed." ) - protected List dispense; - - /** - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. - */ - @Child(name="substitution", type={}, order=5, min=0, max=1) - @Description(shortDefinition="Deals with substitution of one medicine for another", formalDefinition="Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why." ) - protected MedicationDispenseSubstitutionComponent substitution; - - private static final long serialVersionUID = -1188892461L; - - public MedicationDispense() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) - */ - public MedicationDispense setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationDispense setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the set of dispense events. - */ - public MedicationDispenseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the set of dispense events. - */ - public MedicationDispense setStatus(MedicationDispenseStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(MedicationDispenseStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.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} (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationDispense 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. (A link to a resource representing the person to whom the medication will be given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.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. (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationDispense setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #dispenser} (The individual responsible for dispensing the medication.) - */ - public Reference getDispenser() { - if (this.dispenser == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.dispenser"); - else if (Configuration.doAutoCreate()) - this.dispenser = new Reference(); - return this.dispenser; - } - - public boolean hasDispenser() { - return this.dispenser != null && !this.dispenser.isEmpty(); - } - - /** - * @param value {@link #dispenser} (The individual responsible for dispensing the medication.) - */ - public MedicationDispense setDispenser(Reference value) { - this.dispenser = value; - return this; - } - - /** - * @return {@link #dispenser} 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 individual responsible for dispensing the medication.) - */ - public Practitioner getDispenserTarget() { - if (this.dispenserTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.dispenser"); - else if (Configuration.doAutoCreate()) - this.dispenserTarget = new Practitioner(); - return this.dispenserTarget; - } - - /** - * @param value {@link #dispenser} 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 individual responsible for dispensing the medication.) - */ - public MedicationDispense setDispenserTarget(Practitioner value) { - this.dispenserTarget = value; - return this; - } - - /** - * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) - */ - public List getAuthorizingPrescription() { - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - return this.authorizingPrescription; - } - - public boolean hasAuthorizingPrescription() { - if (this.authorizingPrescription == null) - return false; - for (Reference item : this.authorizingPrescription) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) - */ - // syntactic sugar - public Reference addAuthorizingPrescription() { //3 - Reference t = new Reference(); - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - this.authorizingPrescription.add(t); - return t; - } - - /** - * @return {@link #authorizingPrescription} (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. Indicates the medication order that is being dispensed against.) - */ - public List getAuthorizingPrescriptionTarget() { - if (this.authorizingPrescriptionTarget == null) - this.authorizingPrescriptionTarget = new ArrayList(); - return this.authorizingPrescriptionTarget; - } - - // syntactic sugar - /** - * @return {@link #authorizingPrescription} (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. Indicates the medication order that is being dispensed against.) - */ - public MedicationPrescription addAuthorizingPrescriptionTarget() { - MedicationPrescription r = new MedicationPrescription(); - if (this.authorizingPrescriptionTarget == null) - this.authorizingPrescriptionTarget = new ArrayList(); - this.authorizingPrescriptionTarget.add(r); - return r; - } - - /** - * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of medication dispensed.) - */ - public List getDispense() { - if (this.dispense == null) - this.dispense = new ArrayList(); - return this.dispense; - } - - public boolean hasDispense() { - if (this.dispense == null) - return false; - for (MedicationDispenseDispenseComponent item : this.dispense) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of medication dispensed.) - */ - // syntactic sugar - public MedicationDispenseDispenseComponent addDispense() { //3 - MedicationDispenseDispenseComponent t = new MedicationDispenseDispenseComponent(); - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return t; - } - - /** - * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) - */ - public MedicationDispenseSubstitutionComponent getSubstitution() { - if (this.substitution == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.substitution"); - else if (Configuration.doAutoCreate()) - this.substitution = new MedicationDispenseSubstitutionComponent(); - return this.substitution; - } - - public boolean hasSubstitution() { - return this.substitution != null && !this.substitution.isEmpty(); - } - - /** - * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) - */ - public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { - this.substitution = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("dispenser", "Reference(Practitioner)", "The individual responsible for dispensing the medication.", 0, java.lang.Integer.MAX_VALUE, dispenser)); - childrenList.add(new Property("authorizingPrescription", "Reference(MedicationPrescription)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription)); - childrenList.add(new Property("dispense", "", "Indicates the details of the dispense event such as the days supply and quantity of medication dispensed.", 0, java.lang.Integer.MAX_VALUE, dispense)); - childrenList.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.", 0, java.lang.Integer.MAX_VALUE, substitution)); - } - - public MedicationDispense copy() { - MedicationDispense dst = new MedicationDispense(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.dispenser = dispenser == null ? null : dispenser.copy(); - if (authorizingPrescription != null) { - dst.authorizingPrescription = new ArrayList(); - for (Reference i : authorizingPrescription) - dst.authorizingPrescription.add(i.copy()); - }; - if (dispense != null) { - dst.dispense = new ArrayList(); - for (MedicationDispenseDispenseComponent i : dispense) - dst.dispense.add(i.copy()); - }; - dst.substitution = substitution == null ? null : substitution.copy(); - return dst; - } - - protected MedicationDispense typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (dispenser == null || dispenser.isEmpty()) && (authorizingPrescription == null || authorizingPrescription.isEmpty()) - && (dispense == null || dispense.isEmpty()) && (substitution == null || substitution.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationDispense; - } - - @SearchParamDefinition(name="medication", path="MedicationDispense.dispense.medication", description="Returns dispenses of this medicine", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="patient", path="MedicationDispense.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="MedicationDispense.dispense.status", description="Status of the dispense", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="The identity of a prescription to list dispenses from", type="reference" ) - public static final String SP_PRESCRIPTION = "prescription"; - @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Return all dispenses with the specified responsible party", type="reference" ) - public static final String SP_RESPONSIBLEPARTY = "responsibleparty"; - @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific indiividual", type="reference" ) - public static final String SP_DISPENSER = "dispenser"; - @SearchParamDefinition(name="type", path="MedicationDispense.dispense.type", description="Return all dispenses of a specific type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="whenprepared", path="MedicationDispense.dispense.whenPrepared", description="Date when medication prepared", type="date" ) - public static final String SP_WHENPREPARED = "whenprepared"; - @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.dispense.whenHandedOver", description="Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)", type="date" ) - public static final String SP_WHENHANDEDOVER = "whenhandedover"; - @SearchParamDefinition(name="destination", path="MedicationDispense.dispense.destination", description="Return dispenses that should be sent to a secific destination", type="reference" ) - public static final String SP_DESTINATION = "destination"; - -} - +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationDispenseDispenseDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationDispenseDispenseDosageComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public MedicationDispenseDispenseDosageComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseDispenseDosageComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.) + */ + public MedicationDispenseDispenseDosageComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); + childrenList.add(new Property("schedule[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationDispenseDispenseDosageComponent copy() { + MedicationDispenseDispenseDosageComponent dst = new MedicationDispenseDispenseDosageComponent(); + copyValues(dst); + dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (additionalInstructions == null || additionalInstructions.isEmpty()) + && (schedule == null || schedule.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) + && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationDispenseSubstitutionComponent extends BackboneElement { + /** + * A code signifying whether a different drug was dispensed from what was prescribed. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type of substitiution", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." ) + protected CodeableConcept type; + + /** + * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. + */ + @Child(name="reason", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." ) + protected List reason; + + /** + * The person or organization that has primary responsibility for the substitution. + */ + @Child(name="responsibleParty", type={Practitioner.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." ) + protected List responsibleParty; + /** + * The actual objects that are the target of the reference (The person or organization that has primary responsibility for the substitution.) + */ + protected List responsiblePartyTarget; + + + private static final long serialVersionUID = 1218245830L; + + public MedicationDispenseSubstitutionComponent() { + super(); + } + + public MedicationDispenseSubstitutionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) + */ + public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) + */ + public List getReason() { + if (this.reason == null) + this.reason = new ArrayList(); + return this.reason; + } + + public boolean hasReason() { + if (this.reason == null) + return false; + for (CodeableConcept item : this.reason) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) + */ + // syntactic sugar + public CodeableConcept addReason() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reason == null) + this.reason = new ArrayList(); + this.reason.add(t); + return t; + } + + /** + * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) + */ + public List getResponsibleParty() { + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + return this.responsibleParty; + } + + public boolean hasResponsibleParty() { + if (this.responsibleParty == null) + return false; + for (Reference item : this.responsibleParty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) + */ + // syntactic sugar + public Reference addResponsibleParty() { //3 + Reference t = new Reference(); + if (this.responsibleParty == null) + this.responsibleParty = new ArrayList(); + this.responsibleParty.add(t); + return t; + } + + /** + * @return {@link #responsibleParty} (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 person or organization that has primary responsibility for the substitution.) + */ + public List getResponsiblePartyTarget() { + if (this.responsiblePartyTarget == null) + this.responsiblePartyTarget = new ArrayList(); + return this.responsiblePartyTarget; + } + + // syntactic sugar + /** + * @return {@link #responsibleParty} (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 person or organization that has primary responsibility for the substitution.) + */ + public Practitioner addResponsiblePartyTarget() { + Practitioner r = new Practitioner(); + if (this.responsiblePartyTarget == null) + this.responsiblePartyTarget = new ArrayList(); + this.responsiblePartyTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("responsibleParty", "Reference(Practitioner)", "The person or organization that has primary responsibility for the substitution.", 0, java.lang.Integer.MAX_VALUE, responsibleParty)); + } + + public MedicationDispenseSubstitutionComponent copy() { + MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (reason != null) { + dst.reason = new ArrayList(); + for (CodeableConcept i : reason) + dst.reason.add(i.copy()); + }; + if (responsibleParty != null) { + dst.responsibleParty = new ArrayList(); + for (Reference i : responsibleParty) + dst.responsibleParty.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + && (responsibleParty == null || responsibleParty.isEmpty()); + } + + } + + /** + * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." ) + protected Identifier identifier; + + /** + * A code specifying the state of the set of dispense events. + */ + @Child(name="status", type={CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="in progress | on hold | completed | entered in error | stopped", formalDefinition="A code specifying the state of the set of dispense events." ) + protected Enumeration status; + + /** + * A link to a resource representing the person to whom the medication will be given. + */ + @Child(name="patient", type={Patient.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) + */ + protected Patient patientTarget; + + /** + * The individual responsible for dispensing the medication. + */ + @Child(name="dispenser", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Practitioner responsible for dispensing medication", formalDefinition="The individual responsible for dispensing the medication." ) + protected Reference dispenser; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication.) + */ + protected Practitioner dispenserTarget; + + /** + * Indicates the medication order that is being dispensed against. + */ + @Child(name="authorizingPrescription", type={MedicationPrescription.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." ) + protected List authorizingPrescription; + /** + * The actual objects that are the target of the reference (Indicates the medication order that is being dispensed against.) + */ + protected List authorizingPrescriptionTarget; + + + /** + * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. + */ + @Child(name="dispense", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details for individual dispensed medicationdetails", formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of medication dispensed." ) + protected List dispense; + + /** + * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. + */ + @Child(name="substitution", type={}, order=5, min=0, max=1) + @Description(shortDefinition="Deals with substitution of one medicine for another", formalDefinition="Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why." ) + protected MedicationDispenseSubstitutionComponent substitution; + + private static final long serialVersionUID = -1188892461L; + + public MedicationDispense() { + super(); + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) + */ + public MedicationDispense setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationDispense setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the set of dispense events. + */ + public MedicationDispenseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the set of dispense events. + */ + public MedicationDispense setStatus(MedicationDispenseStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(MedicationDispenseStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.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} (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationDispense 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. (A link to a resource representing the person to whom the medication will be given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.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. (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationDispense setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #dispenser} (The individual responsible for dispensing the medication.) + */ + public Reference getDispenser() { + if (this.dispenser == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.dispenser"); + else if (Configuration.doAutoCreate()) + this.dispenser = new Reference(); + return this.dispenser; + } + + public boolean hasDispenser() { + return this.dispenser != null && !this.dispenser.isEmpty(); + } + + /** + * @param value {@link #dispenser} (The individual responsible for dispensing the medication.) + */ + public MedicationDispense setDispenser(Reference value) { + this.dispenser = value; + return this; + } + + /** + * @return {@link #dispenser} 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 individual responsible for dispensing the medication.) + */ + public Practitioner getDispenserTarget() { + if (this.dispenserTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.dispenser"); + else if (Configuration.doAutoCreate()) + this.dispenserTarget = new Practitioner(); + return this.dispenserTarget; + } + + /** + * @param value {@link #dispenser} 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 individual responsible for dispensing the medication.) + */ + public MedicationDispense setDispenserTarget(Practitioner value) { + this.dispenserTarget = value; + return this; + } + + /** + * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) + */ + public List getAuthorizingPrescription() { + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + return this.authorizingPrescription; + } + + public boolean hasAuthorizingPrescription() { + if (this.authorizingPrescription == null) + return false; + for (Reference item : this.authorizingPrescription) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) + */ + // syntactic sugar + public Reference addAuthorizingPrescription() { //3 + Reference t = new Reference(); + if (this.authorizingPrescription == null) + this.authorizingPrescription = new ArrayList(); + this.authorizingPrescription.add(t); + return t; + } + + /** + * @return {@link #authorizingPrescription} (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. Indicates the medication order that is being dispensed against.) + */ + public List getAuthorizingPrescriptionTarget() { + if (this.authorizingPrescriptionTarget == null) + this.authorizingPrescriptionTarget = new ArrayList(); + return this.authorizingPrescriptionTarget; + } + + // syntactic sugar + /** + * @return {@link #authorizingPrescription} (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. Indicates the medication order that is being dispensed against.) + */ + public MedicationPrescription addAuthorizingPrescriptionTarget() { + MedicationPrescription r = new MedicationPrescription(); + if (this.authorizingPrescriptionTarget == null) + this.authorizingPrescriptionTarget = new ArrayList(); + this.authorizingPrescriptionTarget.add(r); + return r; + } + + /** + * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of medication dispensed.) + */ + public List getDispense() { + if (this.dispense == null) + this.dispense = new ArrayList(); + return this.dispense; + } + + public boolean hasDispense() { + if (this.dispense == null) + return false; + for (MedicationDispenseDispenseComponent item : this.dispense) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of medication dispensed.) + */ + // syntactic sugar + public MedicationDispenseDispenseComponent addDispense() { //3 + MedicationDispenseDispenseComponent t = new MedicationDispenseDispenseComponent(); + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return t; + } + + /** + * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) + */ + public MedicationDispenseSubstitutionComponent getSubstitution() { + if (this.substitution == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationDispense.substitution"); + else if (Configuration.doAutoCreate()) + this.substitution = new MedicationDispenseSubstitutionComponent(); + return this.substitution; + } + + public boolean hasSubstitution() { + return this.substitution != null && !this.substitution.isEmpty(); + } + + /** + * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.) + */ + public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { + this.substitution = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("dispenser", "Reference(Practitioner)", "The individual responsible for dispensing the medication.", 0, java.lang.Integer.MAX_VALUE, dispenser)); + childrenList.add(new Property("authorizingPrescription", "Reference(MedicationPrescription)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription)); + childrenList.add(new Property("dispense", "", "Indicates the details of the dispense event such as the days supply and quantity of medication dispensed.", 0, java.lang.Integer.MAX_VALUE, dispense)); + childrenList.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why.", 0, java.lang.Integer.MAX_VALUE, substitution)); + } + + public MedicationDispense copy() { + MedicationDispense dst = new MedicationDispense(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.dispenser = dispenser == null ? null : dispenser.copy(); + if (authorizingPrescription != null) { + dst.authorizingPrescription = new ArrayList(); + for (Reference i : authorizingPrescription) + dst.authorizingPrescription.add(i.copy()); + }; + if (dispense != null) { + dst.dispense = new ArrayList(); + for (MedicationDispenseDispenseComponent i : dispense) + dst.dispense.add(i.copy()); + }; + dst.substitution = substitution == null ? null : substitution.copy(); + return dst; + } + + protected MedicationDispense typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (patient == null || patient.isEmpty()) && (dispenser == null || dispenser.isEmpty()) && (authorizingPrescription == null || authorizingPrescription.isEmpty()) + && (dispense == null || dispense.isEmpty()) && (substitution == null || substitution.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationDispense; + } + + @SearchParamDefinition(name="medication", path="MedicationDispense.dispense.medication", description="Returns dispenses of this medicine", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="patient", path="MedicationDispense.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="MedicationDispense.dispense.status", description="Status of the dispense", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="The identity of a prescription to list dispenses from", type="reference" ) + public static final String SP_PRESCRIPTION = "prescription"; + @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Return all dispenses with the specified responsible party", type="reference" ) + public static final String SP_RESPONSIBLEPARTY = "responsibleparty"; + @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific indiividual", type="reference" ) + public static final String SP_DISPENSER = "dispenser"; + @SearchParamDefinition(name="type", path="MedicationDispense.dispense.type", description="Return all dispenses of a specific type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="whenprepared", path="MedicationDispense.dispense.whenPrepared", description="Date when medication prepared", type="date" ) + public static final String SP_WHENPREPARED = "whenprepared"; + @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.dispense.whenHandedOver", description="Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)", type="date" ) + public static final String SP_WHENHANDEDOVER = "whenhandedover"; + @SearchParamDefinition(name="destination", path="MedicationDispense.dispense.destination", description="Return dispenses that should be sent to a secific destination", type="reference" ) + public static final String SP_DESTINATION = "destination"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java index 6c72f1e324c..7e2e9a81521 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java @@ -20,1550 +20,1550 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 order for both supply of the medication and the instructions for administration of the medicine to a patient. - */ -@ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/Profile/MedicationPrescription") -public class MedicationPrescription extends DomainResource { - - public enum MedicationPrescriptionStatus implements FhirEnum { - /** - * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. - */ - ACTIVE, - /** - * Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the prescription have occurred (this will rarely be made explicit). - */ - COMPLETED, - /** - * The prescription was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the prescription have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * The prescription was replaced by a newer one, which encompasses all the information in the previous one. - */ - SUPERCEDED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return ACTIVE; - if ("on hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - if ("superceded".equals(codeString)) - return SUPERCEDED; - throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered in error"; - case STOPPED: return "stopped"; - case SUPERCEDED: return "superceded"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return ""; - case ONHOLD: return ""; - case COMPLETED: return ""; - case ENTEREDINERROR: return ""; - case STOPPED: return ""; - case SUPERCEDED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The prescription is 'actionable', but not all actions that are implied by it have occurred yet."; - case ONHOLD: return "Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; - case COMPLETED: return "All actions that are implied by the prescription have occurred (this will rarely be made explicit)."; - case ENTEREDINERROR: return "The prescription was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the prescription have been permanently halted, before all of them occurred."; - case SUPERCEDED: return "The prescription was replaced by a newer one, which encompasses all the information in the previous one."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "active"; - case ONHOLD: return "on hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered in error"; - case STOPPED: return "stopped"; - case SUPERCEDED: return "superceded"; - default: return "?"; - } - } - } - - public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory { - public MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return MedicationPrescriptionStatus.ACTIVE; - if ("on hold".equals(codeString)) - return MedicationPrescriptionStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationPrescriptionStatus.COMPLETED; - if ("entered in error".equals(codeString)) - return MedicationPrescriptionStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationPrescriptionStatus.STOPPED; - if ("superceded".equals(codeString)) - return MedicationPrescriptionStatus.SUPERCEDED; - throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); - } - public String toCode(MedicationPrescriptionStatus code) throws IllegalArgumentException { - if (code == MedicationPrescriptionStatus.ACTIVE) - return "active"; - if (code == MedicationPrescriptionStatus.ONHOLD) - return "on hold"; - if (code == MedicationPrescriptionStatus.COMPLETED) - return "completed"; - if (code == MedicationPrescriptionStatus.ENTEREDINERROR) - return "entered in error"; - if (code == MedicationPrescriptionStatus.STOPPED) - return "stopped"; - if (code == MedicationPrescriptionStatus.SUPERCEDED) - return "superceded"; - return "?"; - } - } - - @Block() - public static class MedicationPrescriptionDosageInstructionComponent extends BackboneElement { - /** - * Free text dosage instructions for cases where the instructions are too complex to code. - */ - @Child(name="text", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Dosage instructions expressed as text", formalDefinition="Free text dosage instructions for cases where the instructions are too complex to code." ) - protected StringType text; - - /** - * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. - */ - @Child(name="additionalInstructions", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Supplemental instructions - e.g. 'with meals'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) - protected CodeableConcept additionalInstructions; - - /** - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name="scheduled", type={DateTimeType.class, Period.class, Timing.class}, order=3, min=0, max=1) - @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type scheduled; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name="site", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. - */ - @Child(name="route", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient." ) - protected CodeableConcept route; - - /** + +/* + 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 order for both supply of the medication and the instructions for administration of the medicine to a patient. + */ +@ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/Profile/MedicationPrescription") +public class MedicationPrescription extends DomainResource { + + public enum MedicationPrescriptionStatus implements FhirEnum { + /** + * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. + */ + ACTIVE, + /** + * Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called "suspended". + */ + ONHOLD, + /** + * All actions that are implied by the prescription have occurred (this will rarely be made explicit). + */ + COMPLETED, + /** + * The prescription was entered in error and therefore nullified. + */ + ENTEREDINERROR, + /** + * Actions implied by the prescription have been permanently halted, before all of them occurred. + */ + STOPPED, + /** + * The prescription was replaced by a newer one, which encompasses all the information in the previous one. + */ + SUPERCEDED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return ACTIVE; + if ("on hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + if ("stopped".equals(codeString)) + return STOPPED; + if ("superceded".equals(codeString)) + return SUPERCEDED; + throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ACTIVE: return "active"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered in error"; + case STOPPED: return "stopped"; + case SUPERCEDED: return "superceded"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ACTIVE: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case ENTEREDINERROR: return ""; + case STOPPED: return ""; + case SUPERCEDED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ACTIVE: return "The prescription is 'actionable', but not all actions that are implied by it have occurred yet."; + case ONHOLD: return "Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called 'suspended'."; + case COMPLETED: return "All actions that are implied by the prescription have occurred (this will rarely be made explicit)."; + case ENTEREDINERROR: return "The prescription was entered in error and therefore nullified."; + case STOPPED: return "Actions implied by the prescription have been permanently halted, before all of them occurred."; + case SUPERCEDED: return "The prescription was replaced by a newer one, which encompasses all the information in the previous one."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ACTIVE: return "active"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case ENTEREDINERROR: return "entered in error"; + case STOPPED: return "stopped"; + case SUPERCEDED: return "superceded"; + default: return "?"; + } + } + } + + public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory { + public MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("active".equals(codeString)) + return MedicationPrescriptionStatus.ACTIVE; + if ("on hold".equals(codeString)) + return MedicationPrescriptionStatus.ONHOLD; + if ("completed".equals(codeString)) + return MedicationPrescriptionStatus.COMPLETED; + if ("entered in error".equals(codeString)) + return MedicationPrescriptionStatus.ENTEREDINERROR; + if ("stopped".equals(codeString)) + return MedicationPrescriptionStatus.STOPPED; + if ("superceded".equals(codeString)) + return MedicationPrescriptionStatus.SUPERCEDED; + throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); + } + public String toCode(MedicationPrescriptionStatus code) throws IllegalArgumentException { + if (code == MedicationPrescriptionStatus.ACTIVE) + return "active"; + if (code == MedicationPrescriptionStatus.ONHOLD) + return "on hold"; + if (code == MedicationPrescriptionStatus.COMPLETED) + return "completed"; + if (code == MedicationPrescriptionStatus.ENTEREDINERROR) + return "entered in error"; + if (code == MedicationPrescriptionStatus.STOPPED) + return "stopped"; + if (code == MedicationPrescriptionStatus.SUPERCEDED) + return "superceded"; + return "?"; + } + } + + @Block() + public static class MedicationPrescriptionDosageInstructionComponent extends BackboneElement { + /** + * Free text dosage instructions for cases where the instructions are too complex to code. + */ + @Child(name="text", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Dosage instructions expressed as text", formalDefinition="Free text dosage instructions for cases where the instructions are too complex to code." ) + protected StringType text; + + /** + * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + */ + @Child(name="additionalInstructions", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Supplemental instructions - e.g. 'with meals'", formalDefinition="Additional instructions such as 'Swallow with plenty of water' which may or may not be coded." ) + protected CodeableConcept additionalInstructions; + + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name="scheduled", type={DateTimeType.class, Period.class, Timing.class}, order=3, min=0, max=1) + @Description(shortDefinition="When medication should be administered", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type scheduled; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + */ + @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name="site", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. + */ + @Child(name="route", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="How drug should enter body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient." ) + protected CodeableConcept route; + + /** * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name="method", type={CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name="doseQuantity", type={Quantity.class}, order=8, min=0, max=1) - @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Quantity doseQuantity; - - /** - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - */ - @Child(name="rate", type={Ratio.class}, order=9, min=0, max=1) - @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - */ - @Child(name="maxDosePerPeriod", type={Ratio.class}, order=10, min=0, max=1) - @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -62208513L; - - public MedicationPrescriptionDosageInstructionComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationPrescriptionDosageInstructionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions for cases where the instructions are too complex to code. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions for cases where the instructions are too complex to code. - */ - public MedicationPrescriptionDosageInstructionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public CodeableConcept getAdditionalInstructions() { - if (this.additionalInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.additionalInstructions"); - else if (Configuration.doAutoCreate()) - this.additionalInstructions = new CodeableConcept(); - return this.additionalInstructions; - } - - public boolean hasAdditionalInstructions() { - return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); - } - - /** - * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public MedicationPrescriptionDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { - this.additionalInstructions = value; - return this; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getScheduledDateTimeType() throws Exception { - if (!(this.scheduled instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (DateTimeType) this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getScheduledPeriod() throws Exception { - if (!(this.scheduled instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getScheduledTiming() throws Exception { - if (!(this.scheduled instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public MedicationPrescriptionDosageInstructionComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationPrescriptionDosageInstructionComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationPrescriptionDosageInstructionComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) - */ - public MedicationPrescriptionDosageInstructionComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name="method", type={CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name="doseQuantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Quantity doseQuantity; + + /** + * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + */ + @Child(name="rate", type={Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. + */ + @Child(name="maxDosePerPeriod", type={Ratio.class}, order=10, min=0, max=1) + @Description(shortDefinition="Upper limit on medication per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -62208513L; + + public MedicationPrescriptionDosageInstructionComponent() { + super(); + } + + /** + * @return {@link #text} (Free text dosage instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Free text dosage instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public MedicationPrescriptionDosageInstructionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Free text dosage instructions for cases where the instructions are too complex to code. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Free text dosage instructions for cases where the instructions are too complex to code. + */ + public MedicationPrescriptionDosageInstructionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public CodeableConcept getAdditionalInstructions() { + if (this.additionalInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.additionalInstructions"); + else if (Configuration.doAutoCreate()) + this.additionalInstructions = new CodeableConcept(); + return this.additionalInstructions; + } + + public boolean hasAdditionalInstructions() { + return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); + } + + /** + * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) + */ + public MedicationPrescriptionDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { + this.additionalInstructions = value; + return this; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getScheduledDateTimeType() throws Exception { + if (!(this.scheduled instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (DateTimeType) this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + /** + * @return {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationPrescriptionDosageInstructionComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public MedicationPrescriptionDosageInstructionComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationPrescriptionDosageInstructionComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.) + */ + public MedicationPrescriptionDosageInstructionComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationPrescriptionDosageInstructionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #doseQuantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public Quantity getDoseQuantity() { - if (this.doseQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.doseQuantity"); - else if (Configuration.doAutoCreate()) - this.doseQuantity = new Quantity(); - return this.doseQuantity; - } - - public boolean hasDoseQuantity() { - return this.doseQuantity != null && !this.doseQuantity.isEmpty(); - } - - /** - * @param value {@link #doseQuantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationPrescriptionDosageInstructionComponent setDoseQuantity(Quantity value) { - this.doseQuantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public MedicationPrescriptionDosageInstructionComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public MedicationPrescriptionDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions for cases where the instructions are too complex to code.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); - childrenList.add(new Property("scheduled[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("doseQuantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationPrescriptionDosageInstructionComponent copy() { - MedicationPrescriptionDosageInstructionComponent dst = new MedicationPrescriptionDosageInstructionComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) - && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) - && (doseQuantity == null || doseQuantity.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - } - - @Block() - public static class MedicationPrescriptionDispenseComponent extends BackboneElement { - /** - * Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name="medication", type={Medication.class}, order=1, min=0, max=1) - @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationPrescriptionDosageInstructionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #doseQuantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public Quantity getDoseQuantity() { + if (this.doseQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.doseQuantity"); + else if (Configuration.doAutoCreate()) + this.doseQuantity = new Quantity(); + return this.doseQuantity; + } + + public boolean hasDoseQuantity() { + return this.doseQuantity != null && !this.doseQuantity.isEmpty(); + } + + /** + * @param value {@link #doseQuantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationPrescriptionDosageInstructionComponent setDoseQuantity(Quantity value) { + this.doseQuantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public MedicationPrescriptionDosageInstructionComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDosageInstructionComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public MedicationPrescriptionDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("text", "string", "Free text dosage instructions for cases where the instructions are too complex to code.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as 'Swallow with plenty of water' which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); + childrenList.add(new Property("scheduled[x]", "dateTime|Period|Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("doseQuantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationPrescriptionDosageInstructionComponent copy() { + MedicationPrescriptionDosageInstructionComponent dst = new MedicationPrescriptionDosageInstructionComponent(); + copyValues(dst); + dst.text = text == null ? null : text.copy(); + dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) + && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) + && (doseQuantity == null || doseQuantity.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + } + + @Block() + public static class MedicationPrescriptionDispenseComponent extends BackboneElement { + /** + * Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name="medication", type={Medication.class}, order=1, min=0, max=1) + @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Reference medication; + + /** + * The actual object that is the target of the reference (Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + protected Medication medicationTarget; + + /** * Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. -Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. - */ - @Child(name="validityPeriod", type={Period.class}, order=2, min=0, max=1) - @Description(shortDefinition="Time period supply is authorized for", formalDefinition="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \nIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \nRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription." ) - protected Period validityPeriod; - - /** +Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. + */ + @Child(name="validityPeriod", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time period supply is authorized for", formalDefinition="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \nIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \nRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription." ) + protected Period validityPeriod; + + /** * An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - */ - @Child(name="numberOfRepeatsAllowed", type={IntegerType.class}, order=3, min=0, max=1) - @Description(shortDefinition="# of refills authorized", formalDefinition="An integer indicating the number of repeats of the Dispense. \nUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill." ) - protected IntegerType numberOfRepeatsAllowed; - - /** - * The amount that is to be dispensed. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount of medication to supply per dispense", formalDefinition="The amount that is to be dispensed." ) - protected Quantity quantity; - - /** +UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + */ + @Child(name="numberOfRepeatsAllowed", type={IntegerType.class}, order=3, min=0, max=1) + @Description(shortDefinition="# of refills authorized", formalDefinition="An integer indicating the number of repeats of the Dispense. \nUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill." ) + protected IntegerType numberOfRepeatsAllowed; + + /** + * The amount that is to be dispensed. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount of medication to supply per dispense", formalDefinition="The amount that is to be dispensed." ) + protected Quantity quantity; + + /** * Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. -In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. - */ - @Child(name="expectedSupplyDuration", type={Duration.class}, order=5, min=0, max=1) - @Description(shortDefinition="Days supply per dispense", formalDefinition="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \nIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors." ) - protected Duration expectedSupplyDuration; - - private static final long serialVersionUID = -492174040L; - - public MedicationPrescriptionDispenseComponent() { - super(); - } - - /** - * @return {@link #medication} (Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescriptionDispenseComponent setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} 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 medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); - return this.medicationTarget; - } - - /** - * @param value {@link #medication} 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 medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescriptionDispenseComponent setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** +In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. + */ + @Child(name="expectedSupplyDuration", type={Duration.class}, order=5, min=0, max=1) + @Description(shortDefinition="Days supply per dispense", formalDefinition="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \nIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors." ) + protected Duration expectedSupplyDuration; + + private static final long serialVersionUID = -492174040L; + + public MedicationPrescriptionDispenseComponent() { + super(); + } + + /** + * @return {@link #medication} (Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedication() { + if (this.medication == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.medication"); + else if (Configuration.doAutoCreate()) + this.medication = new Reference(); + return this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationPrescriptionDispenseComponent setMedication(Reference value) { + this.medication = value; + return this; + } + + /** + * @return {@link #medication} 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 medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Medication getMedicationTarget() { + if (this.medicationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.medication"); + else if (Configuration.doAutoCreate()) + this.medicationTarget = new Medication(); + return this.medicationTarget; + } + + /** + * @param value {@link #medication} 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 medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationPrescriptionDispenseComponent setMedicationTarget(Medication value) { + this.medicationTarget = value; + return this; + } + + /** * @return {@link #validityPeriod} (Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. -Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) - */ - public Period getValidityPeriod() { - if (this.validityPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.validityPeriod"); - else if (Configuration.doAutoCreate()) - this.validityPeriod = new Period(); - return this.validityPeriod; - } - - public boolean hasValidityPeriod() { - return this.validityPeriod != null && !this.validityPeriod.isEmpty(); - } - - /** +Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) + */ + public Period getValidityPeriod() { + if (this.validityPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.validityPeriod"); + else if (Configuration.doAutoCreate()) + this.validityPeriod = new Period(); + return this.validityPeriod; + } + + public boolean hasValidityPeriod() { + return this.validityPeriod != null && !this.validityPeriod.isEmpty(); + } + + /** * @param value {@link #validityPeriod} (Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. -Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) - */ - public MedicationPrescriptionDispenseComponent setValidityPeriod(Period value) { - this.validityPeriod = value; - return this; - } - - /** +Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.) + */ + public MedicationPrescriptionDispenseComponent setValidityPeriod(Period value) { + this.validityPeriod = value; + return this; + } + + /** * @return {@link #numberOfRepeatsAllowed} (An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value - */ - public IntegerType getNumberOfRepeatsAllowedElement() { - if (this.numberOfRepeatsAllowed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.numberOfRepeatsAllowed"); - else if (Configuration.doAutoCreate()) - this.numberOfRepeatsAllowed = new IntegerType(); - return this.numberOfRepeatsAllowed; - } - - public boolean hasNumberOfRepeatsAllowedElement() { - return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); - } - - public boolean hasNumberOfRepeatsAllowed() { - return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); - } - - /** +UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value + */ + public IntegerType getNumberOfRepeatsAllowedElement() { + if (this.numberOfRepeatsAllowed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.numberOfRepeatsAllowed"); + else if (Configuration.doAutoCreate()) + this.numberOfRepeatsAllowed = new IntegerType(); + return this.numberOfRepeatsAllowed; + } + + public boolean hasNumberOfRepeatsAllowedElement() { + return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); + } + + public boolean hasNumberOfRepeatsAllowed() { + return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); + } + + /** * @param value {@link #numberOfRepeatsAllowed} (An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value - */ - public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowedElement(IntegerType value) { - this.numberOfRepeatsAllowed = value; - return this; - } - - /** +UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value + */ + public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowedElement(IntegerType value) { + this.numberOfRepeatsAllowed = value; + return this; + } + + /** * @return An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - */ - public int getNumberOfRepeatsAllowed() { - return this.numberOfRepeatsAllowed == null ? null : this.numberOfRepeatsAllowed.getValue(); - } - - /** +UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + */ + public int getNumberOfRepeatsAllowed() { + return this.numberOfRepeatsAllowed == null ? null : this.numberOfRepeatsAllowed.getValue(); + } + + /** * @param value An integer indicating the number of repeats of the Dispense. -UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - */ - public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowed(int value) { - if (value == -1) - this.numberOfRepeatsAllowed = null; - else { - if (this.numberOfRepeatsAllowed == null) - this.numberOfRepeatsAllowed = new IntegerType(); - this.numberOfRepeatsAllowed.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The amount that is to be dispensed.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount that is to be dispensed.) - */ - public MedicationPrescriptionDispenseComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** +UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + */ + public MedicationPrescriptionDispenseComponent setNumberOfRepeatsAllowed(int value) { + if (value == -1) + this.numberOfRepeatsAllowed = null; + else { + if (this.numberOfRepeatsAllowed == null) + this.numberOfRepeatsAllowed = new IntegerType(); + this.numberOfRepeatsAllowed.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The amount that is to be dispensed.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount that is to be dispensed.) + */ + public MedicationPrescriptionDispenseComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** * @return {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. -In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) - */ - public Duration getExpectedSupplyDuration() { - if (this.expectedSupplyDuration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.expectedSupplyDuration"); - else if (Configuration.doAutoCreate()) - this.expectedSupplyDuration = new Duration(); - return this.expectedSupplyDuration; - } - - public boolean hasExpectedSupplyDuration() { - return this.expectedSupplyDuration != null && !this.expectedSupplyDuration.isEmpty(); - } - - /** +In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) + */ + public Duration getExpectedSupplyDuration() { + if (this.expectedSupplyDuration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionDispenseComponent.expectedSupplyDuration"); + else if (Configuration.doAutoCreate()) + this.expectedSupplyDuration = new Duration(); + return this.expectedSupplyDuration; + } + + public boolean hasExpectedSupplyDuration() { + return this.expectedSupplyDuration != null && !this.expectedSupplyDuration.isEmpty(); + } + + /** * @param value {@link #expectedSupplyDuration} (Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. -In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) - */ - public MedicationPrescriptionDispenseComponent setExpectedSupplyDuration(Duration value) { - this.expectedSupplyDuration = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("validityPeriod", "Period", "Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \nIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \nRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.", 0, java.lang.Integer.MAX_VALUE, validityPeriod)); - childrenList.add(new Property("numberOfRepeatsAllowed", "integer", "An integer indicating the number of repeats of the Dispense. \nUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.", 0, java.lang.Integer.MAX_VALUE, numberOfRepeatsAllowed)); - childrenList.add(new Property("quantity", "Quantity", "The amount that is to be dispensed.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("expectedSupplyDuration", "Duration", "Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \nIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.", 0, java.lang.Integer.MAX_VALUE, expectedSupplyDuration)); - } - - public MedicationPrescriptionDispenseComponent copy() { - MedicationPrescriptionDispenseComponent dst = new MedicationPrescriptionDispenseComponent(); - copyValues(dst); - dst.medication = medication == null ? null : medication.copy(); - dst.validityPeriod = validityPeriod == null ? null : validityPeriod.copy(); - dst.numberOfRepeatsAllowed = numberOfRepeatsAllowed == null ? null : numberOfRepeatsAllowed.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.expectedSupplyDuration = expectedSupplyDuration == null ? null : expectedSupplyDuration.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (medication == null || medication.isEmpty()) && (validityPeriod == null || validityPeriod.isEmpty()) - && (numberOfRepeatsAllowed == null || numberOfRepeatsAllowed.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (expectedSupplyDuration == null || expectedSupplyDuration.isEmpty()); - } - - } - - @Block() - public static class MedicationPrescriptionSubstitutionComponent extends BackboneElement { - /** - * A code signifying whether a different drug should be dispensed from what was prescribed. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) - protected CodeableConcept type; - - /** - * Indicates the reason for the substitution, or why substitution must or must not be performed. - */ - @Child(name="reason", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Why should substitution (not) be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) - protected CodeableConcept reason; - - private static final long serialVersionUID = 1693602518L; - - public MedicationPrescriptionSubstitutionComponent() { - super(); - } - - public MedicationPrescriptionSubstitutionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) - */ - public MedicationPrescriptionSubstitutionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) - */ - public MedicationPrescriptionSubstitutionComponent setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug should be dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution, or why substitution must or must not be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); - } - - public MedicationPrescriptionSubstitutionComponent copy() { - MedicationPrescriptionSubstitutionComponent dst = new MedicationPrescriptionSubstitutionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.reason = reason == null ? null : reason.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - ; - } - - } - - /** - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External identifier", formalDefinition="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system." ) - protected List identifier; - - /** - * The date (and perhaps time) when the prescription was written. - */ - @Child(name="dateWritten", type={DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) - protected DateTimeType dateWritten; - - /** - * A code specifying the state of the order. Generally this will be active or completed state. - */ - @Child(name="status", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="active | on hold | completed | entered in error | stopped | superceded", formalDefinition="A code specifying the state of the order. Generally this will be active or completed state." ) - protected Enumeration status; - - /** - * A link to a resource representing the person to whom the medication will be given. - */ - @Child(name="patient", type={Patient.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) - */ - protected Patient patientTarget; - - /** - * The healthcare professional responsible for authorizing the prescription. - */ - @Child(name="prescriber", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who ordered the medication(s)", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) - protected Reference prescriber; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) - */ - protected Practitioner prescriberTarget; - - /** - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - */ - @Child(name="encounter", type={Encounter.class}, order=4, min=0, max=1) - @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - protected Encounter encounterTarget; - - /** - * Can be the reason or the indication for writing the prescription. - */ - @Child(name="reason", type={CodeableConcept.class, Condition.class}, order=5, min=0, max=1) - @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) - protected Type reason; - - /** - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name="medication", type={Medication.class}, order=6, min=0, max=1) - @Description(shortDefinition="Medication to be taken", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * Indicates how the medication is to be used by the patient. - */ - @Child(name="dosageInstruction", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="How medication should be taken", formalDefinition="Indicates how the medication is to be used by the patient." ) - protected List dosageInstruction; - - /** - * Deals with details of the dispense part of the order. - */ - @Child(name="dispense", type={}, order=8, min=0, max=1) - @Description(shortDefinition="Medication supply authorization", formalDefinition="Deals with details of the dispense part of the order." ) - protected MedicationPrescriptionDispenseComponent dispense; - - /** - * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. - */ - @Child(name="substitution", type={}, order=9, min=0, max=1) - @Description(shortDefinition="Any restrictions on medication substitution?", formalDefinition="Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done." ) - protected MedicationPrescriptionSubstitutionComponent substitution; - - private static final long serialVersionUID = 609335905L; - - public MedicationPrescription() { - super(); - } - - /** - * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public DateTimeType getDateWrittenElement() { - if (this.dateWritten == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.dateWritten"); - else if (Configuration.doAutoCreate()) - this.dateWritten = new DateTimeType(); - return this.dateWritten; - } - - public boolean hasDateWrittenElement() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - public boolean hasDateWritten() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - /** - * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public MedicationPrescription setDateWrittenElement(DateTimeType value) { - this.dateWritten = value; - return this; - } - - /** - * @return The date (and perhaps time) when the prescription was written. - */ - 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(Date value) { - if (value == null) - this.dateWritten = null; - else { - if (this.dateWritten == null) - this.dateWritten = new DateTimeType(); - this.dateWritten.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationPrescription setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the order. Generally this will be active or completed state. - */ - public MedicationPrescriptionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the order. Generally this will be active or completed state. - */ - public MedicationPrescription setStatus(MedicationPrescriptionStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(MedicationPrescriptionStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.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} (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationPrescription 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. (A link to a resource representing the person to whom the medication will be given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.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. (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationPrescription setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public Reference getPrescriber() { - if (this.prescriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriber = new Reference(); - return this.prescriber; - } - - public boolean hasPrescriber() { - return this.prescriber != null && !this.prescriber.isEmpty(); - } - - /** - * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public MedicationPrescription setPrescriber(Reference value) { - this.prescriber = value; - return this; - } - - /** - * @return {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) - */ - public Practitioner getPrescriberTarget() { - if (this.prescriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriberTarget = new Practitioner(); - return this.prescriberTarget; - } - - /** - * @param value {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) - */ - public MedicationPrescription setPrescriberTarget(Practitioner value) { - this.prescriberTarget = value; - return this; - } - - /** - * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.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} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public MedicationPrescription 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public MedicationPrescription setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public CodeableConcept getReasonCodeableConcept() throws Exception { - if (!(this.reason instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Reference getReasonReference() throws Exception { - if (!(this.reason instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public MedicationPrescription setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescription setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); - return this.medicationTarget; - } - - /** - * @param value {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationPrescription setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - public List getDosageInstruction() { - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - return this.dosageInstruction; - } - - public boolean hasDosageInstruction() { - if (this.dosageInstruction == null) - return false; - for (MedicationPrescriptionDosageInstructionComponent item : this.dosageInstruction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - // syntactic sugar - public MedicationPrescriptionDosageInstructionComponent addDosageInstruction() { //3 - MedicationPrescriptionDosageInstructionComponent t = new MedicationPrescriptionDosageInstructionComponent(); - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return t; - } - - /** - * @return {@link #dispense} (Deals with details of the dispense part of the order.) - */ - public MedicationPrescriptionDispenseComponent getDispense() { - if (this.dispense == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.dispense"); - else if (Configuration.doAutoCreate()) - this.dispense = new MedicationPrescriptionDispenseComponent(); - return this.dispense; - } - - public boolean hasDispense() { - return this.dispense != null && !this.dispense.isEmpty(); - } - - /** - * @param value {@link #dispense} (Deals with details of the dispense part of the order.) - */ - public MedicationPrescription setDispense(MedicationPrescriptionDispenseComponent value) { - this.dispense = value; - return this; - } - - /** - * @return {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) - */ - public MedicationPrescriptionSubstitutionComponent getSubstitution() { - if (this.substitution == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPrescription.substitution"); - else if (Configuration.doAutoCreate()) - this.substitution = new MedicationPrescriptionSubstitutionComponent(); - return this.substitution; - } - - public boolean hasSubstitution() { - return this.substitution != null && !this.substitution.isEmpty(); - } - - /** - * @param value {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) - */ - public MedicationPrescription setSubstitution(MedicationPrescriptionSubstitutionComponent value) { - this.substitution = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); - childrenList.add(new Property("status", "code", "A code specifying the state of the order. Generally this will be active or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); - childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the order.", 0, java.lang.Integer.MAX_VALUE, dispense)); - childrenList.add(new Property("substitution", "", "Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.", 0, java.lang.Integer.MAX_VALUE, substitution)); - } - - public MedicationPrescription copy() { - MedicationPrescription dst = new MedicationPrescription(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.medication = medication == null ? null : medication.copy(); - if (dosageInstruction != null) { - dst.dosageInstruction = new ArrayList(); - for (MedicationPrescriptionDosageInstructionComponent i : dosageInstruction) - dst.dosageInstruction.add(i.copy()); - }; - dst.dispense = dispense == null ? null : dispense.copy(); - dst.substitution = substitution == null ? null : substitution.copy(); - return dst; - } - - protected MedicationPrescription typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) - && (status == null || status.isEmpty()) && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (medication == null || medication.isEmpty()) - && (dosageInstruction == null || dosageInstruction.isEmpty()) && (dispense == null || dispense.isEmpty()) - && (substitution == null || substitution.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationPrescription; - } - - @SearchParamDefinition(name="medication", path="MedicationPrescription.medication", description="Code for medicine or text in medicine name", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="datewritten", path="MedicationPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) - public static final String SP_DATEWRITTEN = "datewritten"; - @SearchParamDefinition(name="patient", path="MedicationPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="MedicationPrescription.status", description="Status of the prescription", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="encounter", path="MedicationPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="identifier", path="MedicationPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.) + */ + public MedicationPrescriptionDispenseComponent setExpectedSupplyDuration(Duration value) { + this.expectedSupplyDuration = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("validityPeriod", "Period", "Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) \nIt reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. \nRationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.", 0, java.lang.Integer.MAX_VALUE, validityPeriod)); + childrenList.add(new Property("numberOfRepeatsAllowed", "integer", "An integer indicating the number of repeats of the Dispense. \nUsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill.", 0, java.lang.Integer.MAX_VALUE, numberOfRepeatsAllowed)); + childrenList.add(new Property("quantity", "Quantity", "The amount that is to be dispensed.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("expectedSupplyDuration", "Duration", "Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. \nIn some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.", 0, java.lang.Integer.MAX_VALUE, expectedSupplyDuration)); + } + + public MedicationPrescriptionDispenseComponent copy() { + MedicationPrescriptionDispenseComponent dst = new MedicationPrescriptionDispenseComponent(); + copyValues(dst); + dst.medication = medication == null ? null : medication.copy(); + dst.validityPeriod = validityPeriod == null ? null : validityPeriod.copy(); + dst.numberOfRepeatsAllowed = numberOfRepeatsAllowed == null ? null : numberOfRepeatsAllowed.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.expectedSupplyDuration = expectedSupplyDuration == null ? null : expectedSupplyDuration.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (medication == null || medication.isEmpty()) && (validityPeriod == null || validityPeriod.isEmpty()) + && (numberOfRepeatsAllowed == null || numberOfRepeatsAllowed.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (expectedSupplyDuration == null || expectedSupplyDuration.isEmpty()); + } + + } + + @Block() + public static class MedicationPrescriptionSubstitutionComponent extends BackboneElement { + /** + * A code signifying whether a different drug should be dispensed from what was prescribed. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) + protected CodeableConcept type; + + /** + * Indicates the reason for the substitution, or why substitution must or must not be performed. + */ + @Child(name="reason", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Why should substitution (not) be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) + protected CodeableConcept reason; + + private static final long serialVersionUID = 1693602518L; + + public MedicationPrescriptionSubstitutionComponent() { + super(); + } + + public MedicationPrescriptionSubstitutionComponent(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) + */ + public MedicationPrescriptionSubstitutionComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescriptionSubstitutionComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) + */ + public MedicationPrescriptionSubstitutionComponent setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug should be dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution, or why substitution must or must not be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); + } + + public MedicationPrescriptionSubstitutionComponent copy() { + MedicationPrescriptionSubstitutionComponent dst = new MedicationPrescriptionSubstitutionComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + } + + /** + * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External identifier", formalDefinition="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system." ) + protected List identifier; + + /** + * The date (and perhaps time) when the prescription was written. + */ + @Child(name="dateWritten", type={DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) + protected DateTimeType dateWritten; + + /** + * A code specifying the state of the order. Generally this will be active or completed state. + */ + @Child(name="status", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="active | on hold | completed | entered in error | stopped | superceded", formalDefinition="A code specifying the state of the order. Generally this will be active or completed state." ) + protected Enumeration status; + + /** + * A link to a resource representing the person to whom the medication will be given. + */ + @Child(name="patient", type={Patient.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) + */ + protected Patient patientTarget; + + /** + * The healthcare professional responsible for authorizing the prescription. + */ + @Child(name="prescriber", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who ordered the medication(s)", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) + protected Reference prescriber; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) + */ + protected Practitioner prescriberTarget; + + /** + * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + */ + @Child(name="encounter", type={Encounter.class}, order=4, min=0, max=1) + @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + protected Encounter encounterTarget; + + /** + * Can be the reason or the indication for writing the prescription. + */ + @Child(name="reason", type={CodeableConcept.class, Condition.class}, order=5, min=0, max=1) + @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) + protected Type reason; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name="medication", type={Medication.class}, order=6, min=0, max=1) + @Description(shortDefinition="Medication to be taken", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Reference medication; + + /** + * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + protected Medication medicationTarget; + + /** + * Indicates how the medication is to be used by the patient. + */ + @Child(name="dosageInstruction", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="How medication should be taken", formalDefinition="Indicates how the medication is to be used by the patient." ) + protected List dosageInstruction; + + /** + * Deals with details of the dispense part of the order. + */ + @Child(name="dispense", type={}, order=8, min=0, max=1) + @Description(shortDefinition="Medication supply authorization", formalDefinition="Deals with details of the dispense part of the order." ) + protected MedicationPrescriptionDispenseComponent dispense; + + /** + * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. + */ + @Child(name="substitution", type={}, order=9, min=0, max=1) + @Description(shortDefinition="Any restrictions on medication substitution?", formalDefinition="Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done." ) + protected MedicationPrescriptionSubstitutionComponent substitution; + + private static final long serialVersionUID = 609335905L; + + public MedicationPrescription() { + super(); + } + + /** + * @return {@link #identifier} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public DateTimeType getDateWrittenElement() { + if (this.dateWritten == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.dateWritten"); + else if (Configuration.doAutoCreate()) + this.dateWritten = new DateTimeType(); + return this.dateWritten; + } + + public boolean hasDateWrittenElement() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + public boolean hasDateWritten() { + return this.dateWritten != null && !this.dateWritten.isEmpty(); + } + + /** + * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value + */ + public MedicationPrescription setDateWrittenElement(DateTimeType value) { + this.dateWritten = value; + return this; + } + + /** + * @return The date (and perhaps time) when the prescription was written. + */ + 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(Date value) { + if (value == null) + this.dateWritten = null; + else { + if (this.dateWritten == null) + this.dateWritten = new DateTimeType(); + this.dateWritten.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public MedicationPrescription setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the order. Generally this will be active or completed state. + */ + public MedicationPrescriptionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the order. Generally this will be active or completed state. + */ + public MedicationPrescription setStatus(MedicationPrescriptionStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(MedicationPrescriptionStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.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} (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationPrescription 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. (A link to a resource representing the person to whom the medication will be given.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.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. (A link to a resource representing the person to whom the medication will be given.) + */ + public MedicationPrescription setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public Reference getPrescriber() { + if (this.prescriber == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriber = new Reference(); + return this.prescriber; + } + + public boolean hasPrescriber() { + return this.prescriber != null && !this.prescriber.isEmpty(); + } + + /** + * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) + */ + public MedicationPrescription setPrescriber(Reference value) { + this.prescriber = value; + return this; + } + + /** + * @return {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) + */ + public Practitioner getPrescriberTarget() { + if (this.prescriberTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.prescriber"); + else if (Configuration.doAutoCreate()) + this.prescriberTarget = new Practitioner(); + return this.prescriberTarget; + } + + /** + * @param value {@link #prescriber} 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 healthcare professional responsible for authorizing the prescription.) + */ + public MedicationPrescription setPrescriberTarget(Practitioner value) { + this.prescriberTarget = value; + return this; + } + + /** + * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.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} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public MedicationPrescription 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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.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. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) + */ + public MedicationPrescription setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public CodeableConcept getReasonCodeableConcept() throws Exception { + if (!(this.reason instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + /** + * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public Reference getReasonReference() throws Exception { + if (!(this.reason instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) + */ + public MedicationPrescription setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedication() { + if (this.medication == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.medication"); + else if (Configuration.doAutoCreate()) + this.medication = new Reference(); + return this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationPrescription setMedication(Reference value) { + this.medication = value; + return this; + } + + /** + * @return {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Medication getMedicationTarget() { + if (this.medicationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.medication"); + else if (Configuration.doAutoCreate()) + this.medicationTarget = new Medication(); + return this.medicationTarget; + } + + /** + * @param value {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationPrescription setMedicationTarget(Medication value) { + this.medicationTarget = value; + return this; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + public List getDosageInstruction() { + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + return this.dosageInstruction; + } + + public boolean hasDosageInstruction() { + if (this.dosageInstruction == null) + return false; + for (MedicationPrescriptionDosageInstructionComponent item : this.dosageInstruction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) + */ + // syntactic sugar + public MedicationPrescriptionDosageInstructionComponent addDosageInstruction() { //3 + MedicationPrescriptionDosageInstructionComponent t = new MedicationPrescriptionDosageInstructionComponent(); + if (this.dosageInstruction == null) + this.dosageInstruction = new ArrayList(); + this.dosageInstruction.add(t); + return t; + } + + /** + * @return {@link #dispense} (Deals with details of the dispense part of the order.) + */ + public MedicationPrescriptionDispenseComponent getDispense() { + if (this.dispense == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.dispense"); + else if (Configuration.doAutoCreate()) + this.dispense = new MedicationPrescriptionDispenseComponent(); + return this.dispense; + } + + public boolean hasDispense() { + return this.dispense != null && !this.dispense.isEmpty(); + } + + /** + * @param value {@link #dispense} (Deals with details of the dispense part of the order.) + */ + public MedicationPrescription setDispense(MedicationPrescriptionDispenseComponent value) { + this.dispense = value; + return this; + } + + /** + * @return {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) + */ + public MedicationPrescriptionSubstitutionComponent getSubstitution() { + if (this.substitution == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationPrescription.substitution"); + else if (Configuration.doAutoCreate()) + this.substitution = new MedicationPrescriptionSubstitutionComponent(); + return this.substitution; + } + + public boolean hasSubstitution() { + return this.substitution != null && !this.substitution.isEmpty(); + } + + /** + * @param value {@link #substitution} (Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.) + */ + public MedicationPrescription setSubstitution(MedicationPrescriptionSubstitutionComponent value) { + this.substitution = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); + childrenList.add(new Property("status", "code", "A code specifying the state of the order. Generally this will be active or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); + childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the order.", 0, java.lang.Integer.MAX_VALUE, dispense)); + childrenList.add(new Property("substitution", "", "Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done.", 0, java.lang.Integer.MAX_VALUE, substitution)); + } + + public MedicationPrescription copy() { + MedicationPrescription dst = new MedicationPrescription(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); + dst.status = status == null ? null : status.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.prescriber = prescriber == null ? null : prescriber.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.medication = medication == null ? null : medication.copy(); + if (dosageInstruction != null) { + dst.dosageInstruction = new ArrayList(); + for (MedicationPrescriptionDosageInstructionComponent i : dosageInstruction) + dst.dosageInstruction.add(i.copy()); + }; + dst.dispense = dispense == null ? null : dispense.copy(); + dst.substitution = substitution == null ? null : substitution.copy(); + return dst; + } + + protected MedicationPrescription typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) + && (status == null || status.isEmpty()) && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (medication == null || medication.isEmpty()) + && (dosageInstruction == null || dosageInstruction.isEmpty()) && (dispense == null || dispense.isEmpty()) + && (substitution == null || substitution.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationPrescription; + } + + @SearchParamDefinition(name="medication", path="MedicationPrescription.medication", description="Code for medicine or text in medicine name", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="datewritten", path="MedicationPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) + public static final String SP_DATEWRITTEN = "datewritten"; + @SearchParamDefinition(name="patient", path="MedicationPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="MedicationPrescription.status", description="Status of the prescription", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="encounter", path="MedicationPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="identifier", path="MedicationPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java index fa8d45e18e4..c5a2c9f4787 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java @@ -20,808 +20,808 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. - */ -@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/Profile/MedicationStatement") -public class MedicationStatement extends DomainResource { - - @Block() - public static class MedicationStatementDosageComponent extends BackboneElement { - /** - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name="schedule", type={Timing.class}, order=1, min=0, max=1) - @Description(shortDefinition="When/how often was medication taken?", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Timing schedule; - - /** - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. - */ - @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name="site", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Where on body was medication administered?", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected CodeableConcept site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - */ - @Child(name="route", type={CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="How did the medication enter the body?", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) - protected CodeableConcept route; - - /** + +/* + 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.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; +/** + * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + */ +@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/Profile/MedicationStatement") +public class MedicationStatement extends DomainResource { + + @Block() + public static class MedicationStatementDosageComponent extends BackboneElement { + /** + * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name="schedule", type={Timing.class}, order=1, min=0, max=1) + @Description(shortDefinition="When/how often was medication taken?", formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Timing schedule; + + /** + * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + */ + @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Take 'as needed' f(or x)", formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication." ) + protected Type asNeeded; + + /** + * A coded specification of the anatomic site where the medication first enters the body. + */ + @Child(name="site", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Where on body was medication administered?", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) + protected CodeableConcept site; + + /** + * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + */ + @Child(name="route", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="How did the medication enter the body?", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) + protected CodeableConcept route; + + /** * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration. - */ - @Child(name="method", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Technique used to administer medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name="quantity", type={Quantity.class}, order=6, min=0, max=1) - @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Quantity quantity; - - /** - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - */ - @Child(name="rate", type={Ratio.class}, order=7, min=0, max=1) - @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) - protected Ratio rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - */ - @Child(name="maxDosePerPeriod", type={Ratio.class}, order=8, min=0, max=1) - @Description(shortDefinition="Maximum dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -176713299L; - - public MedicationStatementDosageComponent() { - super(); - } - - /** - * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public MedicationStatementDosageComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) - */ - public MedicationStatementDosageComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationStatementDosageComponent setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public MedicationStatementDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration. + */ + @Child(name="method", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Technique used to administer medication", formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration." ) + protected CodeableConcept method; + + /** + * The amount of therapeutic or other substance given at one administration event. + */ + @Child(name="quantity", type={Quantity.class}, order=6, min=0, max=1) + @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + */ + @Child(name="rate", type={Ratio.class}, order=7, min=0, max=1) + @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." ) + protected Ratio rate; + + /** + * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. + */ + @Child(name="maxDosePerPeriod", type={Ratio.class}, order=8, min=0, max=1) + @Description(shortDefinition="Maximum dose that was consumed per unit of time", formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." ) + protected Ratio maxDosePerPeriod; + + private static final long serialVersionUID = -176713299L; + + public MedicationStatementDosageComponent() { + super(); + } + + /** + * @return {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public MedicationStatementDosageComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.) + */ + public MedicationStatementDosageComponent setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public CodeableConcept getSite() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new CodeableConcept(); + return this.site; + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) + */ + public MedicationStatementDosageComponent setSite(CodeableConcept value) { + this.site = value; + return this; + } + + /** + * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public CodeableConcept getRoute() { + if (this.route == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.route"); + else if (Configuration.doAutoCreate()) + this.route = new CodeableConcept(); + return this.route; + } + + public boolean hasRoute() { + return this.route != null && !this.route.isEmpty(); + } + + /** + * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) + */ + public MedicationStatementDosageComponent setRoute(CodeableConcept value) { + this.route = value; + return this; + } + + /** * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. -Terminologies used often pre-coordinate this term with the route and or form of administration.) - */ - public MedicationStatementDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationStatementDosageComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) - */ - public MedicationStatementDosageComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) - */ - public MedicationStatementDosageComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("schedule", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - public MedicationStatementDosageComponent copy() { - MedicationStatementDosageComponent dst = new MedicationStatementDosageComponent(); - copyValues(dst); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (schedule == null || schedule.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) - && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - } - - /** - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) - protected List identifier; - - /** - * The person or animal who is /was taking the medication. - */ - @Child(name="patient", type={Patient.class}, order=0, min=0, max=1) - @Description(shortDefinition="Who was/is taking medication", formalDefinition="The person or animal who is /was taking the medication." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person or animal who is /was taking the medication.) - */ - protected Patient patientTarget; - - /** - * Set this to true if the record is saying that the medication was NOT taken. - */ - @Child(name="wasNotGiven", type={BooleanType.class}, order=1, min=0, max=1) - @Description(shortDefinition="True if medication is/was not being taken", formalDefinition="Set this to true if the record is saying that the medication was NOT taken." ) - protected BooleanType wasNotGiven; - - /** - * A code indicating why the medication was not taken. - */ - @Child(name="reasonNotGiven", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) - protected List reasonNotGiven; - - /** - * The interval of time during which it is being asserted that the patient was taking the medication. - */ - @Child(name="whenGiven", type={Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Over what period was medication consumed?", formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication." ) - protected Period whenGiven; - - /** - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name="medication", type={Medication.class}, order=4, min=0, max=1) - @Description(shortDefinition="What medication was taken?", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) - protected Reference medication; - - /** - * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - protected Medication medicationTarget; - - /** - * An identifier or a link to a resource that identifies a device used in administering the medication to the patient. - */ - @Child(name="device", type={Device.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="E.g. infusion pump", formalDefinition="An identifier or a link to a resource that identifies a device used in administering the medication to the patient." ) - protected List device; - /** - * The actual objects that are the target of the reference (An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) - */ - protected List deviceTarget; - - - /** - * Indicates how the medication is/was used by the patient. - */ - @Child(name="dosage", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) - protected List dosage; - - private static final long serialVersionUID = 2037057925L; - - public MedicationStatement() { - super(); - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #patient} (The person or animal who is /was taking the medication.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.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} (The person or animal who is /was taking the medication.) - */ - public MedicationStatement 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. (The person or animal who is /was taking the medication.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.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. (The person or animal who is /was taking the medication.) - */ - public MedicationStatement setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public MedicationStatement setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the medication was NOT taken. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the medication was NOT taken. - */ - public MedicationStatement setWasNotGiven(boolean value) { - if (value == false) - this.wasNotGiven = null; - else { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - } - return this; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the medication was not taken.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the medication was not taken.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - /** - * @return {@link #whenGiven} (The interval of time during which it is being asserted that the patient was taking the medication.) - */ - public Period getWhenGiven() { - if (this.whenGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.whenGiven"); - else if (Configuration.doAutoCreate()) - this.whenGiven = new Period(); - return this.whenGiven; - } - - public boolean hasWhenGiven() { - return this.whenGiven != null && !this.whenGiven.isEmpty(); - } - - /** - * @param value {@link #whenGiven} (The interval of time during which it is being asserted that the patient was taking the medication.) - */ - public MedicationStatement setWhenGiven(Period value) { - this.whenGiven = value; - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedication() { - if (this.medication == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.medication"); - else if (Configuration.doAutoCreate()) - this.medication = new Reference(); - return this.medication; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationStatement setMedication(Reference value) { - this.medication = value; - return this; - } - - /** - * @return {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Medication getMedicationTarget() { - if (this.medicationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.medication"); - else if (Configuration.doAutoCreate()) - this.medicationTarget = new Medication(); - return this.medicationTarget; - } - - /** - * @param value {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationStatement setMedicationTarget(Medication value) { - this.medicationTarget = value; - return this; - } - - /** - * @return {@link #device} (An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) - */ - public List getDevice() { - if (this.device == null) - this.device = new ArrayList(); - return this.device; - } - - public boolean hasDevice() { - if (this.device == null) - return false; - for (Reference item : this.device) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #device} (An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) - */ - // syntactic sugar - public Reference addDevice() { //3 - Reference t = new Reference(); - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return t; - } - - /** - * @return {@link #device} (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. An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) - */ - public List getDeviceTarget() { - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - return this.deviceTarget; - } - - // syntactic sugar - /** - * @return {@link #device} (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. An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) - */ - public Device addDeviceTarget() { - Device r = new Device(); - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - this.deviceTarget.add(r); - return r; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - public List getDosage() { - if (this.dosage == null) - this.dosage = new ArrayList(); - return this.dosage; - } - - public boolean hasDosage() { - if (this.dosage == null) - return false; - for (MedicationStatementDosageComponent item : this.dosage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - // syntactic sugar - public MedicationStatementDosageComponent addDosage() { //3 - MedicationStatementDosageComponent t = new MedicationStatementDosageComponent(); - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is /was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT taken.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - childrenList.add(new Property("whenGiven", "Period", "The interval of time during which it is being asserted that the patient was taking the medication.", 0, java.lang.Integer.MAX_VALUE, whenGiven)); - childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("device", "Reference(Device)", "An identifier or a link to a resource that identifies a device used in administering the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - public MedicationStatement copy() { - MedicationStatement dst = new MedicationStatement(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - dst.whenGiven = whenGiven == null ? null : whenGiven.copy(); - dst.medication = medication == null ? null : medication.copy(); - if (device != null) { - dst.device = new ArrayList(); - for (Reference i : device) - dst.device.add(i.copy()); - }; - if (dosage != null) { - dst.dosage = new ArrayList(); - for (MedicationStatementDosageComponent i : dosage) - dst.dosage.add(i.copy()); - }; - return dst; - } - - protected MedicationStatement typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) - && (whenGiven == null || whenGiven.isEmpty()) && (medication == null || medication.isEmpty()) - && (device == null || device.isEmpty()) && (dosage == null || dosage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationStatement; - } - - @SearchParamDefinition(name="medication", path="MedicationStatement.medication", description="Code for medicine or text in medicine name", type="reference" ) - public static final String SP_MEDICATION = "medication"; - @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list administrations for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="device", path="MedicationStatement.device", description="Return administrations with this administration device identity", type="reference" ) - public static final String SP_DEVICE = "device"; - @SearchParamDefinition(name="when-given", path="MedicationStatement.whenGiven", description="Date of administration", type="date" ) - public static final String SP_WHENGIVEN = "when-given"; - @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return administrations with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - +Terminologies used often pre-coordinate this term with the route and or form of administration.) + */ + public MedicationStatementDosageComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) + */ + public MedicationStatementDosageComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.) + */ + public MedicationStatementDosageComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public Ratio getMaxDosePerPeriod() { + if (this.maxDosePerPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatementDosageComponent.maxDosePerPeriod"); + else if (Configuration.doAutoCreate()) + this.maxDosePerPeriod = new Ratio(); + return this.maxDosePerPeriod; + } + + public boolean hasMaxDosePerPeriod() { + return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); + } + + /** + * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.) + */ + public MedicationStatementDosageComponent setMaxDosePerPeriod(Ratio value) { + this.maxDosePerPeriod = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("schedule", "Timing", "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, schedule)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.\n\nTerminologies used often pre-coordinate this term with the route and or form of administration.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("quantity", "Quantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); + } + + public MedicationStatementDosageComponent copy() { + MedicationStatementDosageComponent dst = new MedicationStatementDosageComponent(); + copyValues(dst); + dst.schedule = schedule == null ? null : schedule.copy(); + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.site = site == null ? null : site.copy(); + dst.route = route == null ? null : route.copy(); + dst.method = method == null ? null : method.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (schedule == null || schedule.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) + && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) + ; + } + + } + + /** + * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Identifier", formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." ) + protected List identifier; + + /** + * The person or animal who is /was taking the medication. + */ + @Child(name="patient", type={Patient.class}, order=0, min=0, max=1) + @Description(shortDefinition="Who was/is taking medication", formalDefinition="The person or animal who is /was taking the medication." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person or animal who is /was taking the medication.) + */ + protected Patient patientTarget; + + /** + * Set this to true if the record is saying that the medication was NOT taken. + */ + @Child(name="wasNotGiven", type={BooleanType.class}, order=1, min=0, max=1) + @Description(shortDefinition="True if medication is/was not being taken", formalDefinition="Set this to true if the record is saying that the medication was NOT taken." ) + protected BooleanType wasNotGiven; + + /** + * A code indicating why the medication was not taken. + */ + @Child(name="reasonNotGiven", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) + protected List reasonNotGiven; + + /** + * The interval of time during which it is being asserted that the patient was taking the medication. + */ + @Child(name="whenGiven", type={Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Over what period was medication consumed?", formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication." ) + protected Period whenGiven; + + /** + * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + */ + @Child(name="medication", type={Medication.class}, order=4, min=0, max=1) + @Description(shortDefinition="What medication was taken?", formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." ) + protected Reference medication; + + /** + * The actual object that is the target of the reference (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + protected Medication medicationTarget; + + /** + * An identifier or a link to a resource that identifies a device used in administering the medication to the patient. + */ + @Child(name="device", type={Device.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="E.g. infusion pump", formalDefinition="An identifier or a link to a resource that identifies a device used in administering the medication to the patient." ) + protected List device; + /** + * The actual objects that are the target of the reference (An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) + */ + protected List deviceTarget; + + + /** + * Indicates how the medication is/was used by the patient. + */ + @Child(name="dosage", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) + protected List dosage; + + private static final long serialVersionUID = 2037057925L; + + public MedicationStatement() { + super(); + } + + /** + * @return {@link #identifier} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (The person or animal who is /was taking the medication.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.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} (The person or animal who is /was taking the medication.) + */ + public MedicationStatement 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. (The person or animal who is /was taking the medication.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.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. (The person or animal who is /was taking the medication.) + */ + public MedicationStatement setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public BooleanType getWasNotGivenElement() { + if (this.wasNotGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.wasNotGiven"); + else if (Configuration.doAutoCreate()) + this.wasNotGiven = new BooleanType(); + return this.wasNotGiven; + } + + public boolean hasWasNotGivenElement() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + public boolean hasWasNotGiven() { + return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); + } + + /** + * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value + */ + public MedicationStatement setWasNotGivenElement(BooleanType value) { + this.wasNotGiven = value; + return this; + } + + /** + * @return Set this to true if the record is saying that the medication was NOT taken. + */ + public boolean getWasNotGiven() { + return this.wasNotGiven == null ? false : this.wasNotGiven.getValue(); + } + + /** + * @param value Set this to true if the record is saying that the medication was NOT taken. + */ + public MedicationStatement setWasNotGiven(boolean value) { + if (value == false) + this.wasNotGiven = null; + else { + if (this.wasNotGiven == null) + this.wasNotGiven = new BooleanType(); + this.wasNotGiven.setValue(value); + } + return this; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the medication was not taken.) + */ + public List getReasonNotGiven() { + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + return this.reasonNotGiven; + } + + public boolean hasReasonNotGiven() { + if (this.reasonNotGiven == null) + return false; + for (CodeableConcept item : this.reasonNotGiven) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #reasonNotGiven} (A code indicating why the medication was not taken.) + */ + // syntactic sugar + public CodeableConcept addReasonNotGiven() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.reasonNotGiven == null) + this.reasonNotGiven = new ArrayList(); + this.reasonNotGiven.add(t); + return t; + } + + /** + * @return {@link #whenGiven} (The interval of time during which it is being asserted that the patient was taking the medication.) + */ + public Period getWhenGiven() { + if (this.whenGiven == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.whenGiven"); + else if (Configuration.doAutoCreate()) + this.whenGiven = new Period(); + return this.whenGiven; + } + + public boolean hasWhenGiven() { + return this.whenGiven != null && !this.whenGiven.isEmpty(); + } + + /** + * @param value {@link #whenGiven} (The interval of time during which it is being asserted that the patient was taking the medication.) + */ + public MedicationStatement setWhenGiven(Period value) { + this.whenGiven = value; + return this; + } + + /** + * @return {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Reference getMedication() { + if (this.medication == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.medication"); + else if (Configuration.doAutoCreate()) + this.medication = new Reference(); + return this.medication; + } + + public boolean hasMedication() { + return this.medication != null && !this.medication.isEmpty(); + } + + /** + * @param value {@link #medication} (Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationStatement setMedication(Reference value) { + this.medication = value; + return this; + } + + /** + * @return {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public Medication getMedicationTarget() { + if (this.medicationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MedicationStatement.medication"); + else if (Configuration.doAutoCreate()) + this.medicationTarget = new Medication(); + return this.medicationTarget; + } + + /** + * @param value {@link #medication} 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 medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.) + */ + public MedicationStatement setMedicationTarget(Medication value) { + this.medicationTarget = value; + return this; + } + + /** + * @return {@link #device} (An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) + */ + public List getDevice() { + if (this.device == null) + this.device = new ArrayList(); + return this.device; + } + + public boolean hasDevice() { + if (this.device == null) + return false; + for (Reference item : this.device) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #device} (An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) + */ + // syntactic sugar + public Reference addDevice() { //3 + Reference t = new Reference(); + if (this.device == null) + this.device = new ArrayList(); + this.device.add(t); + return t; + } + + /** + * @return {@link #device} (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. An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) + */ + public List getDeviceTarget() { + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + return this.deviceTarget; + } + + // syntactic sugar + /** + * @return {@link #device} (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. An identifier or a link to a resource that identifies a device used in administering the medication to the patient.) + */ + public Device addDeviceTarget() { + Device r = new Device(); + if (this.deviceTarget == null) + this.deviceTarget = new ArrayList(); + this.deviceTarget.add(r); + return r; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + public List getDosage() { + if (this.dosage == null) + this.dosage = new ArrayList(); + return this.dosage; + } + + public boolean hasDosage() { + if (this.dosage == null) + return false; + for (MedicationStatementDosageComponent item : this.dosage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) + */ + // syntactic sugar + public MedicationStatementDosageComponent addDosage() { //3 + MedicationStatementDosageComponent t = new MedicationStatementDosageComponent(); + if (this.dosage == null) + this.dosage = new ArrayList(); + this.dosage.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is /was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT taken.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); + childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); + childrenList.add(new Property("whenGiven", "Period", "The interval of time during which it is being asserted that the patient was taking the medication.", 0, java.lang.Integer.MAX_VALUE, whenGiven)); + childrenList.add(new Property("medication", "Reference(Medication)", "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); + childrenList.add(new Property("device", "Reference(Device)", "An identifier or a link to a resource that identifies a device used in administering the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, device)); + childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); + } + + public MedicationStatement copy() { + MedicationStatement dst = new MedicationStatement(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); + if (reasonNotGiven != null) { + dst.reasonNotGiven = new ArrayList(); + for (CodeableConcept i : reasonNotGiven) + dst.reasonNotGiven.add(i.copy()); + }; + dst.whenGiven = whenGiven == null ? null : whenGiven.copy(); + dst.medication = medication == null ? null : medication.copy(); + if (device != null) { + dst.device = new ArrayList(); + for (Reference i : device) + dst.device.add(i.copy()); + }; + if (dosage != null) { + dst.dosage = new ArrayList(); + for (MedicationStatementDosageComponent i : dosage) + dst.dosage.add(i.copy()); + }; + return dst; + } + + protected MedicationStatement typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) + && (whenGiven == null || whenGiven.isEmpty()) && (medication == null || medication.isEmpty()) + && (device == null || device.isEmpty()) && (dosage == null || dosage.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MedicationStatement; + } + + @SearchParamDefinition(name="medication", path="MedicationStatement.medication", description="Code for medicine or text in medicine name", type="reference" ) + public static final String SP_MEDICATION = "medication"; + @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list administrations for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="device", path="MedicationStatement.device", description="Return administrations with this administration device identity", type="reference" ) + public static final String SP_DEVICE = "device"; + @SearchParamDefinition(name="when-given", path="MedicationStatement.whenGiven", description="Date of administration", type="date" ) + public static final String SP_WHENGIVEN = "when-given"; + @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return administrations with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java index 072e4bb4c83..916df5f6ecd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java @@ -20,1456 +20,1456 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. - */ -@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") -public class MessageHeader extends DomainResource { - - public enum ResponseCode implements FhirEnum { - /** - * The message was accepted and processed without error. - */ - OK, - /** - * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required. - */ - TRANSIENTERROR, - /** - * The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is. - */ - FATALERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return OK; - if ("transient-error".equals(codeString)) - return TRANSIENTERROR; - if ("fatal-error".equals(codeString)) - return FATALERROR; - throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case OK: return "ok"; - case TRANSIENTERROR: return "transient-error"; - case FATALERROR: return "fatal-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OK: return ""; - case TRANSIENTERROR: return ""; - case FATALERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OK: return "The message was accepted and processed without error."; - case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required."; - case FATALERROR: return "The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OK: return "ok"; - case TRANSIENTERROR: return "transient-error"; - case FATALERROR: return "fatal-error"; - default: return "?"; - } - } - } - - public static class ResponseCodeEnumFactory implements EnumFactory { - public ResponseCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return ResponseCode.OK; - if ("transient-error".equals(codeString)) - return ResponseCode.TRANSIENTERROR; - if ("fatal-error".equals(codeString)) - return ResponseCode.FATALERROR; - throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); - } - public String toCode(ResponseCode code) throws IllegalArgumentException { - if (code == ResponseCode.OK) - return "ok"; - if (code == ResponseCode.TRANSIENTERROR) - return "transient-error"; - if (code == ResponseCode.FATALERROR) - return "fatal-error"; - return "?"; - } - } - - @Block() - public static class MessageHeaderResponseComponent extends BackboneElement { - /** - * The id of the message that this message is a response to. - */ - @Child(name="identifier", type={IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Id of original message", formalDefinition="The id of the message that this message is a response to." ) - protected IdType identifier; - - /** - * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - @Child(name="code", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="ok | transient-error | fatal-error", formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not." ) - protected Enumeration code; - - /** - * Full details of any issues found in the message. - */ - @Child(name="details", type={OperationOutcome.class}, order=3, min=0, max=1) - @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." ) - protected Reference details; - - /** - * The actual object that is the target of the reference (Full details of any issues found in the message.) - */ - protected OperationOutcome detailsTarget; - - private static final long serialVersionUID = 1419103693L; - - public MessageHeaderResponseComponent() { - super(); - } - - public MessageHeaderResponseComponent(IdType identifier, Enumeration code) { - super(); - this.identifier = identifier; - this.code = code; - } - - /** - * @return {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public IdType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new IdType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public MessageHeaderResponseComponent setIdentifierElement(IdType value) { - this.identifier = value; - return this; - } - - /** - * @return The id of the message that this message is a response to. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The id of the message that this message is a response to. - */ - public MessageHeaderResponseComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new IdType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public MessageHeaderResponseComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - public ResponseCode getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - public MessageHeaderResponseComponent setCode(ResponseCode value) { - if (this.code == null) - this.code = new Enumeration(ResponseCode.ENUM_FACTORY); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #details} (Full details of any issues found in the message.) - */ - public Reference getDetails() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new Reference(); - return this.details; - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (Full details of any issues found in the message.) - */ - public MessageHeaderResponseComponent setDetails(Reference value) { - this.details = value; - return this; - } - - /** - * @return {@link #details} 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. (Full details of any issues found in the message.) - */ - public OperationOutcome getDetailsTarget() { - if (this.detailsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); - else if (Configuration.doAutoCreate()) - this.detailsTarget = new OperationOutcome(); - return this.detailsTarget; - } - - /** - * @param value {@link #details} 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. (Full details of any issues found in the message.) - */ - public MessageHeaderResponseComponent setDetailsTarget(OperationOutcome value) { - this.detailsTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "id", "The id of the message that this message is a response to.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, java.lang.Integer.MAX_VALUE, details)); - } - - public MessageHeaderResponseComponent copy() { - MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.code = code == null ? null : code.copy(); - dst.details = details == null ? null : details.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (details == null || details.isEmpty()); - } - - } - - @Block() - public static class MessageSourceComponent extends BackboneElement { - /** - * Human-readable name for the source system. - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." ) - protected StringType name; - - /** - * May include configuration or other information useful in debugging. - */ - @Child(name="software", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." ) - protected StringType software; - - /** - * Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - @Child(name="version", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." ) - protected StringType version; - - /** - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - */ - @Child(name="contact", type={ContactPoint.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." ) - protected ContactPoint contact; - - /** - * Identifies the routing target to send acknowledgements to. - */ - @Child(name="endpoint", type={UriType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Actual message source address or id", formalDefinition="Identifies the routing target to send acknowledgements to." ) - protected UriType endpoint; - - private static final long serialVersionUID = -115878196L; - - public MessageSourceComponent() { - super(); - } - - public MessageSourceComponent(UriType endpoint) { - super(); - this.endpoint = endpoint; - } - - /** - * @return {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MessageSourceComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-readable name for the source system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-readable name for the source system. - */ - public MessageSourceComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value - */ - public StringType getSoftwareElement() { - if (this.software == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.software"); - else if (Configuration.doAutoCreate()) - this.software = new StringType(); - return this.software; - } - - public boolean hasSoftwareElement() { - return this.software != null && !this.software.isEmpty(); - } - - public boolean hasSoftware() { - return this.software != null && !this.software.isEmpty(); - } - - /** - * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value - */ - public MessageSourceComponent setSoftwareElement(StringType value) { - this.software = value; - return this; - } - - /** - * @return May include configuration or other information useful in debugging. - */ - public String getSoftware() { - return this.software == null ? null : this.software.getValue(); - } - - /** - * @param value May include configuration or other information useful in debugging. - */ - public MessageSourceComponent setSoftware(String value) { - if (Utilities.noString(value)) - this.software = null; - else { - if (this.software == null) - this.software = new StringType(); - this.software.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public MessageSourceComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - public MessageSourceComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) - */ - public ContactPoint getContact() { - if (this.contact == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.contact"); - else if (Configuration.doAutoCreate()) - this.contact = new ContactPoint(); - return this.contact; - } - - public boolean hasContact() { - return this.contact != null && !this.contact.isEmpty(); - } - - /** - * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) - */ - public MessageSourceComponent setContact(ContactPoint value) { - this.contact = value; - return this; - } - - /** - * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public MessageSourceComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return Identifies the routing target to send acknowledgements to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value Identifies the routing target to send acknowledgements to. - */ - public MessageSourceComponent setEndpoint(String value) { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Human-readable name for the source system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, java.lang.Integer.MAX_VALUE, software)); - childrenList.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("endpoint", "uri", "Identifies the routing target to send acknowledgements to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - } - - public MessageSourceComponent copy() { - MessageSourceComponent dst = new MessageSourceComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.software = software == null ? null : software.copy(); - dst.version = version == null ? null : version.copy(); - dst.contact = contact == null ? null : contact.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (software == null || software.isEmpty()) - && (version == null || version.isEmpty()) && (contact == null || contact.isEmpty()) && (endpoint == null || endpoint.isEmpty()) - ; - } - - } - - @Block() - public static class MessageDestinationComponent extends BackboneElement { - /** - * Human-readable name for the target system. - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." ) - protected StringType name; - - /** - * Identifies the target end system in situations where the initial message transmission is to an intermediary system. - */ - @Child(name="target", type={Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Particular delivery destination within the destination", formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - protected Device targetTarget; - - /** - * Indicates where the message should be routed to. - */ - @Child(name="endpoint", type={UriType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Actual destination address or id", formalDefinition="Indicates where the message should be routed to." ) - protected UriType endpoint; - - private static final long serialVersionUID = -2097633309L; - - public MessageDestinationComponent() { - super(); - } - - public MessageDestinationComponent(UriType endpoint) { - super(); - this.endpoint = endpoint; - } - - /** - * @return {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MessageDestinationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-readable name for the target system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-readable name for the target system. - */ - public MessageDestinationComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public MessageDestinationComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 target end system in situations where the initial message transmission is to an intermediary system.) - */ - public Device getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Device(); - return this.targetTarget; - } - - /** - * @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. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public MessageDestinationComponent setTargetTarget(Device value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public MessageDestinationComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return Indicates where the message should be routed to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value Indicates where the message should be routed to. - */ - public MessageDestinationComponent setEndpoint(String value) { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Human-readable name for the target system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("endpoint", "uri", "Indicates where the message should be routed to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - } - - public MessageDestinationComponent copy() { - MessageDestinationComponent dst = new MessageDestinationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.target = target == null ? null : target.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (target == null || target.isEmpty()) - && (endpoint == null || endpoint.isEmpty()); - } - - } - - /** - * The identifier of this message. - */ - @Child(name="identifier", type={IdType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Id of this message", formalDefinition="The identifier of this message." ) - protected IdType identifier; - - /** - * The time that the message was sent. - */ - @Child(name="timestamp", type={InstantType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Time that the message was sent", formalDefinition="The time that the message was sent." ) - protected InstantType timestamp; - - /** - * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type". - */ - @Child(name="event", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code for the event this message represents", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'." ) - protected Coding event; - - /** - * Information about the message that this message is a response to. Only present if this message is a response. - */ - @Child(name="response", type={}, order=2, min=0, max=1) - @Description(shortDefinition="If this is a reply to prior message", formalDefinition="Information about the message that this message is a response to. Only present if this message is a response." ) - protected MessageHeaderResponseComponent response; - - /** - * The source application from which this message originated. - */ - @Child(name="source", type={}, order=3, min=1, max=1) - @Description(shortDefinition="Message Source Application", formalDefinition="The source application from which this message originated." ) - protected MessageSourceComponent source; - - /** - * The destination application which the message is intended for. - */ - @Child(name="destination", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Message Destination Application(s)", formalDefinition="The destination application which the message is intended for." ) - protected List destination; - - /** - * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. - */ - @Child(name="enterer", type={Practitioner.class}, order=5, min=0, max=1) - @Description(shortDefinition="The source of the data entry", formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - protected Practitioner entererTarget; - - /** - * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. - */ - @Child(name="author", type={Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="The source of the decision", formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - protected Practitioner authorTarget; - - /** - * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. - */ - @Child(name="receiver", type={Practitioner.class, Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Intended 'real-world' recipient for the data", formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." ) - protected Reference receiver; - - /** - * The actual object that is the target of the reference (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - protected Resource receiverTarget; - - /** - * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. - */ - @Child(name="responsible", type={Practitioner.class, Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Final responsibility for event", formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party." ) - protected Reference responsible; - - /** - * The actual object that is the target of the reference (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - protected Resource responsibleTarget; - - /** - * Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message. - */ - @Child(name="reason", type={CodeableConcept.class}, order=9, min=0, max=1) - @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message." ) - protected CodeableConcept reason; - - /** - * The actual data of the message - a reference to the root/focus class of the event. - */ - @Child(name="data", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The actual content of the message", formalDefinition="The actual data of the message - a reference to the root/focus class of the event." ) - protected List data; - /** - * The actual objects that are the target of the reference (The actual data of the message - a reference to the root/focus class of the event.) - */ - protected List dataTarget; - - - private static final long serialVersionUID = 1866986127L; - - public MessageHeader() { - super(); - } - - public MessageHeader(IdType identifier, InstantType timestamp, Coding event, MessageSourceComponent source) { - super(); - this.identifier = identifier; - this.timestamp = timestamp; - this.event = event; - this.source = source; - } - - /** - * @return {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public IdType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new IdType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public MessageHeader setIdentifierElement(IdType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier of this message. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier of this message. - */ - public MessageHeader setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new IdType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public InstantType getTimestampElement() { - if (this.timestamp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.timestamp"); - else if (Configuration.doAutoCreate()) - this.timestamp = new InstantType(); - return this.timestamp; - } - - public boolean hasTimestampElement() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - public boolean hasTimestamp() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - /** - * @param value {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public MessageHeader setTimestampElement(InstantType value) { - this.timestamp = value; - return this; - } - - /** - * @return The time that the message was sent. - */ - public Date getTimestamp() { - return this.timestamp == null ? null : this.timestamp.getValue(); - } - - /** - * @param value The time that the message was sent. - */ - public MessageHeader setTimestamp(Date value) { - if (this.timestamp == null) - this.timestamp = new InstantType(); - this.timestamp.setValue(value); - return this; - } - - /** - * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) - */ - public Coding getEvent() { - if (this.event == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.event"); - else if (Configuration.doAutoCreate()) - this.event = new Coding(); - return this.event; - } - - public boolean hasEvent() { - return this.event != null && !this.event.isEmpty(); - } - - /** - * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) - */ - public MessageHeader setEvent(Coding value) { - this.event = value; - return this; - } - - /** - * @return {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) - */ - public MessageHeaderResponseComponent getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.response"); - else if (Configuration.doAutoCreate()) - this.response = new MessageHeaderResponseComponent(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) - */ - public MessageHeader setResponse(MessageHeaderResponseComponent value) { - this.response = value; - return this; - } - - /** - * @return {@link #source} (The source application from which this message originated.) - */ - public MessageSourceComponent getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.source"); - else if (Configuration.doAutoCreate()) - this.source = new MessageSourceComponent(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source application from which this message originated.) - */ - public MessageHeader setSource(MessageSourceComponent value) { - this.source = value; - return this; - } - - /** - * @return {@link #destination} (The destination application which the message is intended for.) - */ - public List getDestination() { - if (this.destination == null) - this.destination = new ArrayList(); - return this.destination; - } - - public boolean hasDestination() { - if (this.destination == null) - return false; - for (MessageDestinationComponent item : this.destination) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #destination} (The destination application which the message is intended for.) - */ - // syntactic sugar - public MessageDestinationComponent addDestination() { //3 - MessageDestinationComponent t = new MessageDestinationComponent(); - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return t; - } - - /** - * @return {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public MessageHeader setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); - return this.entererTarget; - } - - /** - * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) - */ - public MessageHeader setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public MessageHeader setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) - */ - public MessageHeader setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public Reference getReceiver() { - if (this.receiver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.receiver"); - else if (Configuration.doAutoCreate()) - this.receiver = new Reference(); - return this.receiver; - } - - public boolean hasReceiver() { - return this.receiver != null && !this.receiver.isEmpty(); - } - - /** - * @param value {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public MessageHeader setReceiver(Reference value) { - this.receiver = value; - return this; - } - - /** - * @return {@link #receiver} 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. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public Resource getReceiverTarget() { - return this.receiverTarget; - } - - /** - * @param value {@link #receiver} 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. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - public MessageHeader setReceiverTarget(Resource value) { - this.receiverTarget = value; - return this; - } - - /** - * @return {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public Reference getResponsible() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new Reference(); - return this.responsible; - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public MessageHeader setResponsible(Reference value) { - this.responsible = value; - return this; - } - - /** - * @return {@link #responsible} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public Resource getResponsibleTarget() { - return this.responsibleTarget; - } - - /** - * @param value {@link #responsible} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) - */ - public MessageHeader setResponsibleTarget(Resource value) { - this.responsibleTarget = value; - return this; - } - - /** - * @return {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) - */ - public MessageHeader setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) - */ - public List getData() { - if (this.data == null) - this.data = new ArrayList(); - return this.data; - } - - public boolean hasData() { - if (this.data == null) - return false; - for (Reference item : this.data) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) - */ - // syntactic sugar - public Reference addData() { //3 - Reference t = new Reference(); - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return t; - } - - /** - * @return {@link #data} (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 actual data of the message - a reference to the root/focus class of the event.) - */ - public List getDataTarget() { - if (this.dataTarget == null) - this.dataTarget = new ArrayList(); - return this.dataTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "id", "The identifier of this message.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("timestamp", "instant", "The time that the message was sent.", 0, java.lang.Integer.MAX_VALUE, timestamp)); - childrenList.add(new Property("event", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("response", "", "Information about the message that this message is a response to. Only present if this message is a response.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("source", "", "The source application from which this message originated.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("author", "Reference(Practitioner)", "The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("receiver", "Reference(Practitioner|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, java.lang.Integer.MAX_VALUE, receiver)); - childrenList.add(new Property("responsible", "Reference(Practitioner|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("data", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - public MessageHeader copy() { - MessageHeader dst = new MessageHeader(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.timestamp = timestamp == null ? null : timestamp.copy(); - dst.event = event == null ? null : event.copy(); - dst.response = response == null ? null : response.copy(); - dst.source = source == null ? null : source.copy(); - if (destination != null) { - dst.destination = new ArrayList(); - for (MessageDestinationComponent i : destination) - dst.destination.add(i.copy()); - }; - dst.enterer = enterer == null ? null : enterer.copy(); - dst.author = author == null ? null : author.copy(); - dst.receiver = receiver == null ? null : receiver.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.reason = reason == null ? null : reason.copy(); - if (data != null) { - dst.data = new ArrayList(); - for (Reference i : data) - dst.data.add(i.copy()); - }; - return dst; - } - - protected MessageHeader typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) - && (event == null || event.isEmpty()) && (response == null || response.isEmpty()) && (source == null || source.isEmpty()) - && (destination == null || destination.isEmpty()) && (enterer == null || enterer.isEmpty()) - && (author == null || author.isEmpty()) && (receiver == null || receiver.isEmpty()) && (responsible == null || responsible.isEmpty()) - && (reason == null || reason.isEmpty()) && (data == null || data.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MessageHeader; - } - - @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="Actual destination address or id", type="token" ) - public static final String SP_DESTINATIONURI = "destination-uri"; - @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="Time that the message was sent", type="date" ) - public static final String SP_TIMESTAMP = "timestamp"; - @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="Actual message source address or id", type="token" ) - public static final String SP_SOURCEURI = "source-uri"; - @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="Intended 'real-world' recipient for the data", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="event", path="MessageHeader.event", description="Code for the event this message represents", type="token" ) - public static final String SP_EVENT = "event"; - @SearchParamDefinition(name="data", path="MessageHeader.data", description="The actual content of the message", type="reference" ) - public static final String SP_DATA = "data"; - @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" ) - public static final String SP_RESPONSEID = "response-id"; - @SearchParamDefinition(name="src-id", path="MessageHeader.identifier", description="Id of this message", type="token" ) - public static final String SP_SRCID = "src-id"; - @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" ) - public static final String SP_DESTINATION = "destination"; - -} - + +/* + 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; +/** + * The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + */ +@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") +public class MessageHeader extends DomainResource { + + public enum ResponseCode implements FhirEnum { + /** + * The message was accepted and processed without error. + */ + OK, + /** + * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required. + */ + TRANSIENTERROR, + /** + * The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is. + */ + FATALERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return OK; + if ("transient-error".equals(codeString)) + return TRANSIENTERROR; + if ("fatal-error".equals(codeString)) + return FATALERROR; + throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case OK: return "ok"; + case TRANSIENTERROR: return "transient-error"; + case FATALERROR: return "fatal-error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OK: return ""; + case TRANSIENTERROR: return ""; + case FATALERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OK: return "The message was accepted and processed without error."; + case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required."; + case FATALERROR: return "The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OK: return "ok"; + case TRANSIENTERROR: return "transient-error"; + case FATALERROR: return "fatal-error"; + default: return "?"; + } + } + } + + public static class ResponseCodeEnumFactory implements EnumFactory { + public ResponseCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return ResponseCode.OK; + if ("transient-error".equals(codeString)) + return ResponseCode.TRANSIENTERROR; + if ("fatal-error".equals(codeString)) + return ResponseCode.FATALERROR; + throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); + } + public String toCode(ResponseCode code) throws IllegalArgumentException { + if (code == ResponseCode.OK) + return "ok"; + if (code == ResponseCode.TRANSIENTERROR) + return "transient-error"; + if (code == ResponseCode.FATALERROR) + return "fatal-error"; + return "?"; + } + } + + @Block() + public static class MessageHeaderResponseComponent extends BackboneElement { + /** + * The id of the message that this message is a response to. + */ + @Child(name="identifier", type={IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Id of original message", formalDefinition="The id of the message that this message is a response to." ) + protected IdType identifier; + + /** + * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + @Child(name="code", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="ok | transient-error | fatal-error", formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not." ) + protected Enumeration code; + + /** + * Full details of any issues found in the message. + */ + @Child(name="details", type={OperationOutcome.class}, order=3, min=0, max=1) + @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." ) + protected Reference details; + + /** + * The actual object that is the target of the reference (Full details of any issues found in the message.) + */ + protected OperationOutcome detailsTarget; + + private static final long serialVersionUID = 1419103693L; + + public MessageHeaderResponseComponent() { + super(); + } + + public MessageHeaderResponseComponent(IdType identifier, Enumeration code) { + super(); + this.identifier = identifier; + this.code = code; + } + + /** + * @return {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public IdType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new IdType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public MessageHeaderResponseComponent setIdentifierElement(IdType value) { + this.identifier = value; + return this; + } + + /** + * @return The id of the message that this message is a response to. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The id of the message that this message is a response to. + */ + public MessageHeaderResponseComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new IdType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public MessageHeaderResponseComponent setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + public ResponseCode getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + */ + public MessageHeaderResponseComponent setCode(ResponseCode value) { + if (this.code == null) + this.code = new Enumeration(ResponseCode.ENUM_FACTORY); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #details} (Full details of any issues found in the message.) + */ + public Reference getDetails() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new Reference(); + return this.details; + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (Full details of any issues found in the message.) + */ + public MessageHeaderResponseComponent setDetails(Reference value) { + this.details = value; + return this; + } + + /** + * @return {@link #details} 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. (Full details of any issues found in the message.) + */ + public OperationOutcome getDetailsTarget() { + if (this.detailsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); + else if (Configuration.doAutoCreate()) + this.detailsTarget = new OperationOutcome(); + return this.detailsTarget; + } + + /** + * @param value {@link #details} 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. (Full details of any issues found in the message.) + */ + public MessageHeaderResponseComponent setDetailsTarget(OperationOutcome value) { + this.detailsTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "id", "The id of the message that this message is a response to.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, java.lang.Integer.MAX_VALUE, details)); + } + + public MessageHeaderResponseComponent copy() { + MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.code = code == null ? null : code.copy(); + dst.details = details == null ? null : details.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (details == null || details.isEmpty()); + } + + } + + @Block() + public static class MessageSourceComponent extends BackboneElement { + /** + * Human-readable name for the source system. + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." ) + protected StringType name; + + /** + * May include configuration or other information useful in debugging. + */ + @Child(name="software", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." ) + protected StringType software; + + /** + * Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + @Child(name="version", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." ) + protected StringType version; + + /** + * An e-mail, phone, website or other contact point to use to resolve issues with message communications. + */ + @Child(name="contact", type={ContactPoint.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." ) + protected ContactPoint contact; + + /** + * Identifies the routing target to send acknowledgements to. + */ + @Child(name="endpoint", type={UriType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Actual message source address or id", formalDefinition="Identifies the routing target to send acknowledgements to." ) + protected UriType endpoint; + + private static final long serialVersionUID = -115878196L; + + public MessageSourceComponent() { + super(); + } + + public MessageSourceComponent(UriType endpoint) { + super(); + this.endpoint = endpoint; + } + + /** + * @return {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageSourceComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-readable name for the source system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-readable name for the source system. + */ + public MessageSourceComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value + */ + public StringType getSoftwareElement() { + if (this.software == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.software"); + else if (Configuration.doAutoCreate()) + this.software = new StringType(); + return this.software; + } + + public boolean hasSoftwareElement() { + return this.software != null && !this.software.isEmpty(); + } + + public boolean hasSoftware() { + return this.software != null && !this.software.isEmpty(); + } + + /** + * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value + */ + public MessageSourceComponent setSoftwareElement(StringType value) { + this.software = value; + return this; + } + + /** + * @return May include configuration or other information useful in debugging. + */ + public String getSoftware() { + return this.software == null ? null : this.software.getValue(); + } + + /** + * @param value May include configuration or other information useful in debugging. + */ + public MessageSourceComponent setSoftware(String value) { + if (Utilities.noString(value)) + this.software = null; + else { + if (this.software == null) + this.software = new StringType(); + this.software.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public MessageSourceComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands. + */ + public MessageSourceComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) + */ + public ContactPoint getContact() { + if (this.contact == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.contact"); + else if (Configuration.doAutoCreate()) + this.contact = new ContactPoint(); + return this.contact; + } + + public boolean hasContact() { + return this.contact != null && !this.contact.isEmpty(); + } + + /** + * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) + */ + public MessageSourceComponent setContact(ContactPoint value) { + this.contact = value; + return this; + } + + /** + * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageSourceComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public MessageSourceComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return Identifies the routing target to send acknowledgements to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value Identifies the routing target to send acknowledgements to. + */ + public MessageSourceComponent setEndpoint(String value) { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Human-readable name for the source system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, java.lang.Integer.MAX_VALUE, software)); + childrenList.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("endpoint", "uri", "Identifies the routing target to send acknowledgements to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + } + + public MessageSourceComponent copy() { + MessageSourceComponent dst = new MessageSourceComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.software = software == null ? null : software.copy(); + dst.version = version == null ? null : version.copy(); + dst.contact = contact == null ? null : contact.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (software == null || software.isEmpty()) + && (version == null || version.isEmpty()) && (contact == null || contact.isEmpty()) && (endpoint == null || endpoint.isEmpty()) + ; + } + + } + + @Block() + public static class MessageDestinationComponent extends BackboneElement { + /** + * Human-readable name for the target system. + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." ) + protected StringType name; + + /** + * Identifies the target end system in situations where the initial message transmission is to an intermediary system. + */ + @Child(name="target", type={Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Particular delivery destination within the destination", formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + protected Device targetTarget; + + /** + * Indicates where the message should be routed to. + */ + @Child(name="endpoint", type={UriType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Actual destination address or id", formalDefinition="Indicates where the message should be routed to." ) + protected UriType endpoint; + + private static final long serialVersionUID = -2097633309L; + + public MessageDestinationComponent() { + super(); + } + + public MessageDestinationComponent(UriType endpoint) { + super(); + this.endpoint = endpoint; + } + + /** + * @return {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public MessageDestinationComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-readable name for the target system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-readable name for the target system. + */ + public MessageDestinationComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public MessageDestinationComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 target end system in situations where the initial message transmission is to an intermediary system.) + */ + public Device getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Device(); + return this.targetTarget; + } + + /** + * @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. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) + */ + public MessageDestinationComponent setTargetTarget(Device value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public UriType getEndpointElement() { + if (this.endpoint == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageDestinationComponent.endpoint"); + else if (Configuration.doAutoCreate()) + this.endpoint = new UriType(); + return this.endpoint; + } + + public boolean hasEndpointElement() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + public boolean hasEndpoint() { + return this.endpoint != null && !this.endpoint.isEmpty(); + } + + /** + * @param value {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value + */ + public MessageDestinationComponent setEndpointElement(UriType value) { + this.endpoint = value; + return this; + } + + /** + * @return Indicates where the message should be routed to. + */ + public String getEndpoint() { + return this.endpoint == null ? null : this.endpoint.getValue(); + } + + /** + * @param value Indicates where the message should be routed to. + */ + public MessageDestinationComponent setEndpoint(String value) { + if (this.endpoint == null) + this.endpoint = new UriType(); + this.endpoint.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "Human-readable name for the target system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("endpoint", "uri", "Indicates where the message should be routed to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); + } + + public MessageDestinationComponent copy() { + MessageDestinationComponent dst = new MessageDestinationComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.target = target == null ? null : target.copy(); + dst.endpoint = endpoint == null ? null : endpoint.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (target == null || target.isEmpty()) + && (endpoint == null || endpoint.isEmpty()); + } + + } + + /** + * The identifier of this message. + */ + @Child(name="identifier", type={IdType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Id of this message", formalDefinition="The identifier of this message." ) + protected IdType identifier; + + /** + * The time that the message was sent. + */ + @Child(name="timestamp", type={InstantType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Time that the message was sent", formalDefinition="The time that the message was sent." ) + protected InstantType timestamp; + + /** + * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type". + */ + @Child(name="event", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code for the event this message represents", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'." ) + protected Coding event; + + /** + * Information about the message that this message is a response to. Only present if this message is a response. + */ + @Child(name="response", type={}, order=2, min=0, max=1) + @Description(shortDefinition="If this is a reply to prior message", formalDefinition="Information about the message that this message is a response to. Only present if this message is a response." ) + protected MessageHeaderResponseComponent response; + + /** + * The source application from which this message originated. + */ + @Child(name="source", type={}, order=3, min=1, max=1) + @Description(shortDefinition="Message Source Application", formalDefinition="The source application from which this message originated." ) + protected MessageSourceComponent source; + + /** + * The destination application which the message is intended for. + */ + @Child(name="destination", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message Destination Application(s)", formalDefinition="The destination application which the message is intended for." ) + protected List destination; + + /** + * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. + */ + @Child(name="enterer", type={Practitioner.class}, order=5, min=0, max=1) + @Description(shortDefinition="The source of the data entry", formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + protected Practitioner entererTarget; + + /** + * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. + */ + @Child(name="author", type={Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="The source of the decision", formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + protected Practitioner authorTarget; + + /** + * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. + */ + @Child(name="receiver", type={Practitioner.class, Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Intended 'real-world' recipient for the data", formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." ) + protected Reference receiver; + + /** + * The actual object that is the target of the reference (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + protected Resource receiverTarget; + + /** + * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. + */ + @Child(name="responsible", type={Practitioner.class, Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Final responsibility for event", formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party." ) + protected Reference responsible; + + /** + * The actual object that is the target of the reference (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + protected Resource responsibleTarget; + + /** + * Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message. + */ + @Child(name="reason", type={CodeableConcept.class}, order=9, min=0, max=1) + @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message." ) + protected CodeableConcept reason; + + /** + * The actual data of the message - a reference to the root/focus class of the event. + */ + @Child(name="data", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The actual content of the message", formalDefinition="The actual data of the message - a reference to the root/focus class of the event." ) + protected List data; + /** + * The actual objects that are the target of the reference (The actual data of the message - a reference to the root/focus class of the event.) + */ + protected List dataTarget; + + + private static final long serialVersionUID = 1866986127L; + + public MessageHeader() { + super(); + } + + public MessageHeader(IdType identifier, InstantType timestamp, Coding event, MessageSourceComponent source) { + super(); + this.identifier = identifier; + this.timestamp = timestamp; + this.event = event; + this.source = source; + } + + /** + * @return {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public IdType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new IdType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier of this message.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public MessageHeader setIdentifierElement(IdType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier of this message. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier of this message. + */ + public MessageHeader setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new IdType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public InstantType getTimestampElement() { + if (this.timestamp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.timestamp"); + else if (Configuration.doAutoCreate()) + this.timestamp = new InstantType(); + return this.timestamp; + } + + public boolean hasTimestampElement() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + public boolean hasTimestamp() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + /** + * @param value {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public MessageHeader setTimestampElement(InstantType value) { + this.timestamp = value; + return this; + } + + /** + * @return The time that the message was sent. + */ + public Date getTimestamp() { + return this.timestamp == null ? null : this.timestamp.getValue(); + } + + /** + * @param value The time that the message was sent. + */ + public MessageHeader setTimestamp(Date value) { + if (this.timestamp == null) + this.timestamp = new InstantType(); + this.timestamp.setValue(value); + return this; + } + + /** + * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) + */ + public Coding getEvent() { + if (this.event == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.event"); + else if (Configuration.doAutoCreate()) + this.event = new Coding(); + return this.event; + } + + public boolean hasEvent() { + return this.event != null && !this.event.isEmpty(); + } + + /** + * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type".) + */ + public MessageHeader setEvent(Coding value) { + this.event = value; + return this; + } + + /** + * @return {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) + */ + public MessageHeaderResponseComponent getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.response"); + else if (Configuration.doAutoCreate()) + this.response = new MessageHeaderResponseComponent(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) + */ + public MessageHeader setResponse(MessageHeaderResponseComponent value) { + this.response = value; + return this; + } + + /** + * @return {@link #source} (The source application from which this message originated.) + */ + public MessageSourceComponent getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.source"); + else if (Configuration.doAutoCreate()) + this.source = new MessageSourceComponent(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The source application from which this message originated.) + */ + public MessageHeader setSource(MessageSourceComponent value) { + this.source = value; + return this; + } + + /** + * @return {@link #destination} (The destination application which the message is intended for.) + */ + public List getDestination() { + if (this.destination == null) + this.destination = new ArrayList(); + return this.destination; + } + + public boolean hasDestination() { + if (this.destination == null) + return false; + for (MessageDestinationComponent item : this.destination) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #destination} (The destination application which the message is intended for.) + */ + // syntactic sugar + public MessageDestinationComponent addDestination() { //3 + MessageDestinationComponent t = new MessageDestinationComponent(); + if (this.destination == null) + this.destination = new ArrayList(); + this.destination.add(t); + return t; + } + + /** + * @return {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public MessageHeader setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.) + */ + public MessageHeader setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public MessageHeader setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.) + */ + public MessageHeader setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public Reference getReceiver() { + if (this.receiver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.receiver"); + else if (Configuration.doAutoCreate()) + this.receiver = new Reference(); + return this.receiver; + } + + public boolean hasReceiver() { + return this.receiver != null && !this.receiver.isEmpty(); + } + + /** + * @param value {@link #receiver} (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public MessageHeader setReceiver(Reference value) { + this.receiver = value; + return this; + } + + /** + * @return {@link #receiver} 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. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public Resource getReceiverTarget() { + return this.receiverTarget; + } + + /** + * @param value {@link #receiver} 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. (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) + */ + public MessageHeader setReceiverTarget(Resource value) { + this.receiverTarget = value; + return this; + } + + /** + * @return {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public Reference getResponsible() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new Reference(); + return this.responsible; + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public MessageHeader setResponsible(Reference value) { + this.responsible = value; + return this; + } + + /** + * @return {@link #responsible} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public Resource getResponsibleTarget() { + return this.responsibleTarget; + } + + /** + * @param value {@link #responsible} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.) + */ + public MessageHeader setResponsibleTarget(Resource value) { + this.responsibleTarget = value; + return this; + } + + /** + * @return {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MessageHeader.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.) + */ + public MessageHeader setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) + */ + public List getData() { + if (this.data == null) + this.data = new ArrayList(); + return this.data; + } + + public boolean hasData() { + if (this.data == null) + return false; + for (Reference item : this.data) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) + */ + // syntactic sugar + public Reference addData() { //3 + Reference t = new Reference(); + if (this.data == null) + this.data = new ArrayList(); + this.data.add(t); + return t; + } + + /** + * @return {@link #data} (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 actual data of the message - a reference to the root/focus class of the event.) + */ + public List getDataTarget() { + if (this.dataTarget == null) + this.dataTarget = new ArrayList(); + return this.dataTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "id", "The identifier of this message.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("timestamp", "instant", "The time that the message was sent.", 0, java.lang.Integer.MAX_VALUE, timestamp)); + childrenList.add(new Property("event", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value 'http://hl7.org/fhir/message-type'.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("response", "", "Information about the message that this message is a response to. Only present if this message is a response.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("source", "", "The source application from which this message originated.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("author", "Reference(Practitioner)", "The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("receiver", "Reference(Practitioner|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, java.lang.Integer.MAX_VALUE, receiver)); + childrenList.add(new Property("responsible", "Reference(Practitioner|Organization)", "The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("data", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + public MessageHeader copy() { + MessageHeader dst = new MessageHeader(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.timestamp = timestamp == null ? null : timestamp.copy(); + dst.event = event == null ? null : event.copy(); + dst.response = response == null ? null : response.copy(); + dst.source = source == null ? null : source.copy(); + if (destination != null) { + dst.destination = new ArrayList(); + for (MessageDestinationComponent i : destination) + dst.destination.add(i.copy()); + }; + dst.enterer = enterer == null ? null : enterer.copy(); + dst.author = author == null ? null : author.copy(); + dst.receiver = receiver == null ? null : receiver.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.reason = reason == null ? null : reason.copy(); + if (data != null) { + dst.data = new ArrayList(); + for (Reference i : data) + dst.data.add(i.copy()); + }; + return dst; + } + + protected MessageHeader typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) + && (event == null || event.isEmpty()) && (response == null || response.isEmpty()) && (source == null || source.isEmpty()) + && (destination == null || destination.isEmpty()) && (enterer == null || enterer.isEmpty()) + && (author == null || author.isEmpty()) && (receiver == null || receiver.isEmpty()) && (responsible == null || responsible.isEmpty()) + && (reason == null || reason.isEmpty()) && (data == null || data.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.MessageHeader; + } + + @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="Actual destination address or id", type="token" ) + public static final String SP_DESTINATIONURI = "destination-uri"; + @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="Time that the message was sent", type="date" ) + public static final String SP_TIMESTAMP = "timestamp"; + @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="Actual message source address or id", type="token" ) + public static final String SP_SOURCEURI = "source-uri"; + @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="Intended 'real-world' recipient for the data", type="reference" ) + public static final String SP_RECEIVER = "receiver"; + @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="event", path="MessageHeader.event", description="Code for the event this message represents", type="token" ) + public static final String SP_EVENT = "event"; + @SearchParamDefinition(name="data", path="MessageHeader.data", description="The actual content of the message", type="reference" ) + public static final String SP_DATA = "data"; + @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" ) + public static final String SP_RESPONSEID = "response-id"; + @SearchParamDefinition(name="src-id", path="MessageHeader.identifier", description="Id of this message", type="token" ) + public static final String SP_SRCID = "src-id"; + @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" ) + public static final String SP_DESTINATION = "destination"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java index 2462612c418..3eb199e0aba 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java @@ -20,68 +20,68 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Money") -public class Money extends Quantity { - - private static final long serialVersionUID = -483422721L; - - public Money copy() { - Money dst = new Money(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.units = units == null ? null : units.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Money typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - + +/* + 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 org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Money") +public class Money extends Quantity { + + private static final long serialVersionUID = -483422721L; + + public Money copy() { + Money dst = new Money(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.units = units == null ? null : units.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Money typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java index 280b30ef85d..79fe4fe7c34 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java @@ -20,1268 +20,1268 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ -@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") -public class NamingSystem extends DomainResource { - - 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. - */ - CODESYSTEM, - /** - * The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.). - */ - IDENTIFIER, - /** - * The namingsystem is used as the root for other identifiers and namingsystems. - */ - ROOT, - /** - * added to help the parsers - */ - NULL; - - 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)) - return CODESYSTEM; - if ("identifier".equals(codeString)) - return IDENTIFIER; - if ("root".equals(codeString)) - return ROOT; - throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CODESYSTEM: return "codesystem"; - case IDENTIFIER: return "identifier"; - case ROOT: return "root"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CODESYSTEM: return ""; - case IDENTIFIER: return ""; - case ROOT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CODESYSTEM: return "The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc."; - case IDENTIFIER: return "The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.)."; - case ROOT: return "The namingsystem is used as the root for other identifiers and namingsystems."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CODESYSTEM: return "codesystem"; - case IDENTIFIER: return "identifier"; - case ROOT: return "root"; - default: return "?"; - } - } - } - - public static class NamingsystemTypeEnumFactory implements EnumFactory { - public NamingsystemType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("codesystem".equals(codeString)) - return NamingsystemType.CODESYSTEM; - if ("identifier".equals(codeString)) - return NamingsystemType.IDENTIFIER; - if ("root".equals(codeString)) - return NamingsystemType.ROOT; - throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); - } - public String toCode(NamingsystemType code) throws IllegalArgumentException { - if (code == NamingsystemType.CODESYSTEM) - return "codesystem"; - if (code == NamingsystemType.IDENTIFIER) - return "identifier"; - if (code == NamingsystemType.ROOT) - return "root"; - return "?"; - } - } - - public enum NamingsystemStatus implements FhirEnum { - /** - * System has been submitted but not yet approved. - */ - PROPOSED, - /** - * System is valid for use. - */ - ACTIVE, - /** - * System should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return PROPOSED; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "System has been submitted but not yet approved."; - case ACTIVE: return "System is valid for use."; - case RETIRED: return "System should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "proposed"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class NamingsystemStatusEnumFactory implements EnumFactory { - public NamingsystemStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return NamingsystemStatus.PROPOSED; - if ("active".equals(codeString)) - return NamingsystemStatus.ACTIVE; - if ("retired".equals(codeString)) - return NamingsystemStatus.RETIRED; - throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'"); - } - public String toCode(NamingsystemStatus code) throws IllegalArgumentException { - if (code == NamingsystemStatus.PROPOSED) - return "proposed"; - if (code == NamingsystemStatus.ACTIVE) - return "active"; - if (code == NamingsystemStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum NamingsystemIdentifierType implements FhirEnum { - /** - * An ISO object identifier. E.g. 1.2.3.4.5. - */ - OID, - /** - * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. - */ - UUID, - /** - * A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org. - */ - URI, - /** - * Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return OID; - if ("uuid".equals(codeString)) - return UUID; - if ("uri".equals(codeString)) - return URI; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case OID: return "oid"; - case UUID: return "uuid"; - case URI: return "uri"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OID: return ""; - case UUID: return ""; - case URI: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OID: return "An ISO object identifier. E.g. 1.2.3.4.5."; - case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11."; - case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org."; - case OTHER: return "Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OID: return "oid"; - case UUID: return "uuid"; - case URI: return "uri"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory { - public NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("oid".equals(codeString)) - return NamingsystemIdentifierType.OID; - if ("uuid".equals(codeString)) - return NamingsystemIdentifierType.UUID; - if ("uri".equals(codeString)) - return NamingsystemIdentifierType.URI; - if ("other".equals(codeString)) - return NamingsystemIdentifierType.OTHER; - throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); - } - public String toCode(NamingsystemIdentifierType code) throws IllegalArgumentException { - if (code == NamingsystemIdentifierType.OID) - return "oid"; - if (code == NamingsystemIdentifierType.UUID) - return "uuid"; - if (code == NamingsystemIdentifierType.URI) - return "uri"; - if (code == NamingsystemIdentifierType.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class NamingSystemUniqueIdComponent extends BackboneElement { - /** - * Identifies the unique identifier scheme used for this particular identifier. - */ - @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." ) - protected Enumeration type; - - /** - * The string that should be sent over the wire to identify the code system or identifier system. - */ - @Child(name="value", type={StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." ) - protected StringType value; - - /** - * Indicates whether this identifier is the "preferred" identifier of this type. - */ - @Child(name="preferred", type={BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the 'preferred' identifier of this type." ) - protected BooleanType preferred; - - /** - * Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic. - */ - @Child(name="period", type={Period.class}, order=4, min=0, max=1) - @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic." ) - protected Period period; - - private static final long serialVersionUID = -250649344L; - - public NamingSystemUniqueIdComponent() { - super(); - } - - public NamingSystemUniqueIdComponent(Enumeration type, StringType value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the unique identifier scheme used for this particular identifier. - */ - public NamingsystemIdentifierType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the unique identifier scheme used for this particular identifier. - */ - public NamingSystemUniqueIdComponent setType(NamingsystemIdentifierType value) { - if (this.type == null) - this.type = new Enumeration(NamingsystemIdentifierType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The string that should be sent over the wire to identify the code system or identifier system. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The string that should be sent over the wire to identify the code system or identifier system. - */ - public NamingSystemUniqueIdComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - /** - * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public BooleanType getPreferredElement() { - if (this.preferred == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred"); - else if (Configuration.doAutoCreate()) - this.preferred = new BooleanType(); - return this.preferred; - } - - public boolean hasPreferredElement() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - public boolean hasPreferred() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - /** - * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { - this.preferred = value; - return this; - } - - /** - * @return Indicates whether this identifier is the "preferred" identifier of this type. - */ - public boolean getPreferred() { - return this.preferred == null ? false : this.preferred.getValue(); - } - - /** - * @param value Indicates whether this identifier is the "preferred" identifier of this type. - */ - public NamingSystemUniqueIdComponent setPreferred(boolean value) { - if (value == false) - this.preferred = null; - else { - if (this.preferred == null) - this.preferred = new BooleanType(); - this.preferred.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.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} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) - */ - public NamingSystemUniqueIdComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("preferred", "boolean", "Indicates whether this identifier is the 'preferred' identifier of this type.", 0, java.lang.Integer.MAX_VALUE, preferred)); - childrenList.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public NamingSystemUniqueIdComponent copy() { - NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - dst.preferred = preferred == null ? null : preferred.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - && (preferred == null || preferred.isEmpty()) && (period == null || period.isEmpty()); - } - - } - - @Block() - public static class NamingSystemContactComponent extends BackboneElement { - /** - * Names of the person who can be contacted. - */ - @Child(name="name", type={HumanName.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of person", formalDefinition="Names of the person who can be contacted." ) - protected HumanName name; - - /** - * Identifies the mechanism(s) by which they can be contacted. - */ - @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Phone, email, etc.", formalDefinition="Identifies the mechanism(s) by which they can be contacted." ) - protected List telecom; - - private static final long serialVersionUID = -888464692L; - - public NamingSystemContactComponent() { - super(); - } - - /** - * @return {@link #name} (Names of the person who can be contacted.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Names of the person who can be contacted.) - */ - public NamingSystemContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (Identifies the mechanism(s) by which they can be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Identifies the mechanism(s) by which they can be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "HumanName", "Names of the person who can be contacted.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Identifies the mechanism(s) by which they can be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - public NamingSystemContactComponent copy() { - NamingSystemContactComponent dst = new NamingSystemContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - } - - /** - * Indicates the purpose for the namingsystem - what kinds of things does it make unique?. - */ - @Child(name="type", type={CodeType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the namingsystem - what kinds of things does it make unique?." ) - protected Enumeration type; - - /** - * The descriptive name of this particular identifier type or code system. - */ - @Child(name="name", type={StringType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Human-readable label", formalDefinition="The descriptive name of this particular identifier type or code system." ) - protected StringType name; - - /** - * Indicates whether the namingsystem is "ready for use" or not. - */ - @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="proposed | active | retired", formalDefinition="Indicates whether the namingsystem is 'ready for use' or not." ) - protected Enumeration status; - - /** - * If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. - */ - @Child(name="country", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="ISO 3-char country code", formalDefinition="If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system." ) - protected CodeType country; - - /** - * Categorizes a namingsystem for easier search by grouping related namingsystems. - */ - @Child(name="category", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="driver | provider | patient | bank", formalDefinition="Categorizes a namingsystem for easier search by grouping related namingsystems." ) - protected CodeableConcept category; - - /** - * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - @Child(name="responsible", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." ) - protected StringType responsible; - - /** - * Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - @Child(name="description", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="What does namingsystem identify?", formalDefinition="Details about what the namespace identifies including scope, granularity, version labeling, etc." ) - protected StringType description; - - /** - * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - @Child(name="usage", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." ) - protected StringType usage; - - /** - * Indicates how the system may be identified when referenced in electronic exchange. - */ - @Child(name="uniqueId", type={}, order=7, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." ) - protected List uniqueId; - - /** - * The person who can be contacted about this system registration entry. - */ - @Child(name="contact", type={}, order=8, min=0, max=1) - @Description(shortDefinition="Who should be contacted for questions about namingsystem", formalDefinition="The person who can be contacted about this system registration entry." ) - protected NamingSystemContactComponent contact; - - /** - * For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any). - */ - @Child(name="replacedBy", type={NamingSystem.class}, order=9, min=0, max=1) - @Description(shortDefinition="Use this instead", formalDefinition="For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any)." ) - protected Reference replacedBy; - - /** - * The actual object that is the target of the reference (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - protected NamingSystem replacedByTarget; - - private static final long serialVersionUID = -797915837L; - - public NamingSystem() { - super(); - } - - public NamingSystem(Enumeration type, StringType name, Enumeration status) { - super(); - this.type = type; - this.name = name; - this.status = status; - } - - /** - * @return {@link #type} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public NamingSystem setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Indicates the purpose for the namingsystem - what kinds of things does it make unique?. - */ - public NamingsystemType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Indicates the purpose for the namingsystem - what kinds of things does it make unique?. - */ - public NamingSystem setType(NamingsystemType value) { - if (this.type == null) - this.type = new Enumeration(NamingsystemType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public NamingSystem setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The descriptive name of this particular identifier type or code system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The descriptive name of this particular identifier type or code system. - */ - public NamingSystem setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (Indicates whether the namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public NamingSystem setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the namingsystem is "ready for use" or not. - */ - public NamingsystemStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the namingsystem is "ready for use" or not. - */ - public NamingSystem setStatus(NamingsystemStatus value) { - if (this.status == null) - this.status = new Enumeration(NamingsystemStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public CodeType getCountryElement() { - if (this.country == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.country"); - else if (Configuration.doAutoCreate()) - this.country = new CodeType(); - return this.country; - } - - public boolean hasCountryElement() { - return this.country != null && !this.country.isEmpty(); - } - - public boolean hasCountry() { - return this.country != null && !this.country.isEmpty(); - } - - /** - * @param value {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public NamingSystem setCountryElement(CodeType value) { - this.country = value; - return this; - } - - /** - * @return If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. - */ - public String getCountry() { - return this.country == null ? null : this.country.getValue(); - } - - /** - * @param value If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. - */ - public NamingSystem setCountry(String value) { - if (Utilities.noString(value)) - this.country = null; - else { - if (this.country == null) - this.country = new CodeType(); - this.country.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Categorizes a namingsystem for easier search by grouping related namingsystems.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.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} (Categorizes a namingsystem for easier search by grouping related namingsystems.) - */ - public NamingSystem setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public StringType getResponsibleElement() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new StringType(); - return this.responsible; - } - - public boolean hasResponsibleElement() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public NamingSystem setResponsibleElement(StringType value) { - this.responsible = value; - return this; - } - - /** - * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - public String getResponsible() { - return this.responsible == null ? null : this.responsible.getValue(); - } - - /** - * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - public NamingSystem setResponsible(String value) { - if (Utilities.noString(value)) - this.responsible = null; - else { - if (this.responsible == null) - this.responsible = new StringType(); - this.responsible.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). 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 NamingSystem.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} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public NamingSystem setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - public NamingSystem setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public StringType getUsageElement() { - if (this.usage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.usage"); - else if (Configuration.doAutoCreate()) - this.usage = new StringType(); - return this.usage; - } - - public boolean hasUsageElement() { - return this.usage != null && !this.usage.isEmpty(); - } - - public boolean hasUsage() { - return this.usage != null && !this.usage.isEmpty(); - } - - /** - * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public NamingSystem setUsageElement(StringType value) { - this.usage = value; - return this; - } - - /** - * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - public String getUsage() { - return this.usage == null ? null : this.usage.getValue(); - } - - /** - * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - public NamingSystem setUsage(String value) { - if (Utilities.noString(value)) - this.usage = null; - else { - if (this.usage == null) - this.usage = new StringType(); - this.usage.setValue(value); - } - return this; - } - - /** - * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) - */ - public List getUniqueId() { - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - return this.uniqueId; - } - - public boolean hasUniqueId() { - if (this.uniqueId == null) - return false; - for (NamingSystemUniqueIdComponent item : this.uniqueId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) - */ - // syntactic sugar - public NamingSystemUniqueIdComponent addUniqueId() { //3 - NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent(); - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - this.uniqueId.add(t); - return t; - } - - /** - * @return {@link #contact} (The person who can be contacted about this system registration entry.) - */ - public NamingSystemContactComponent getContact() { - if (this.contact == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.contact"); - else if (Configuration.doAutoCreate()) - this.contact = new NamingSystemContactComponent(); - return this.contact; - } - - public boolean hasContact() { - return this.contact != null && !this.contact.isEmpty(); - } - - /** - * @param value {@link #contact} (The person who can be contacted about this system registration entry.) - */ - public NamingSystem setContact(NamingSystemContactComponent value) { - this.contact = value; - return this; - } - - /** - * @return {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public Reference getReplacedBy() { - if (this.replacedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.replacedBy"); - else if (Configuration.doAutoCreate()) - this.replacedBy = new Reference(); - return this.replacedBy; - } - - public boolean hasReplacedBy() { - return this.replacedBy != null && !this.replacedBy.isEmpty(); - } - - /** - * @param value {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public NamingSystem setReplacedBy(Reference value) { - this.replacedBy = value; - return this; - } - - /** - * @return {@link #replacedBy} 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. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public NamingSystem getReplacedByTarget() { - if (this.replacedByTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.replacedBy"); - else if (Configuration.doAutoCreate()) - this.replacedByTarget = new NamingSystem(); - return this.replacedByTarget; - } - - /** - * @param value {@link #replacedBy} 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. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) - */ - public NamingSystem setReplacedByTarget(NamingSystem value) { - this.replacedByTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Indicates the purpose for the namingsystem - what kinds of things does it make unique?.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("name", "string", "The descriptive name of this particular identifier type or code system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "Indicates whether the namingsystem is 'ready for use' or not.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("country", "code", "If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.", 0, java.lang.Integer.MAX_VALUE, country)); - childrenList.add(new Property("category", "CodeableConcept", "Categorizes a namingsystem for easier search by grouping related namingsystems.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("description", "string", "Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, java.lang.Integer.MAX_VALUE, usage)); - childrenList.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId)); - childrenList.add(new Property("contact", "", "The person who can be contacted about this system registration entry.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("replacedBy", "Reference(NamingSystem)", "For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).", 0, java.lang.Integer.MAX_VALUE, replacedBy)); - } - - public NamingSystem copy() { - NamingSystem dst = new NamingSystem(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.country = country == null ? null : country.copy(); - dst.category = category == null ? null : category.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.description = description == null ? null : description.copy(); - dst.usage = usage == null ? null : usage.copy(); - if (uniqueId != null) { - dst.uniqueId = new ArrayList(); - for (NamingSystemUniqueIdComponent i : uniqueId) - dst.uniqueId.add(i.copy()); - }; - dst.contact = contact == null ? null : contact.copy(); - dst.replacedBy = replacedBy == null ? null : replacedBy.copy(); - return dst; - } - - protected NamingSystem typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) - && (status == null || status.isEmpty()) && (country == null || country.isEmpty()) && (category == null || category.isEmpty()) - && (responsible == null || responsible.isEmpty()) && (description == null || description.isEmpty()) - && (usage == null || usage.isEmpty()) && (uniqueId == null || uniqueId.isEmpty()) && (contact == null || contact.isEmpty()) - && (replacedBy == null || replacedBy.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.NamingSystem; - } - - -} - + +/* + 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; +/** + * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + */ +@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") +public class NamingSystem extends DomainResource { + + 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. + */ + CODESYSTEM, + /** + * The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.). + */ + IDENTIFIER, + /** + * The namingsystem is used as the root for other identifiers and namingsystems. + */ + ROOT, + /** + * added to help the parsers + */ + NULL; + + 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)) + return CODESYSTEM; + if ("identifier".equals(codeString)) + return IDENTIFIER; + if ("root".equals(codeString)) + return ROOT; + throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CODESYSTEM: return "codesystem"; + case IDENTIFIER: return "identifier"; + case ROOT: return "root"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CODESYSTEM: return ""; + case IDENTIFIER: return ""; + case ROOT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CODESYSTEM: return "The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc."; + case IDENTIFIER: return "The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.)."; + case ROOT: return "The namingsystem is used as the root for other identifiers and namingsystems."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CODESYSTEM: return "codesystem"; + case IDENTIFIER: return "identifier"; + case ROOT: return "root"; + default: return "?"; + } + } + } + + public static class NamingsystemTypeEnumFactory implements EnumFactory { + public NamingsystemType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("codesystem".equals(codeString)) + return NamingsystemType.CODESYSTEM; + if ("identifier".equals(codeString)) + return NamingsystemType.IDENTIFIER; + if ("root".equals(codeString)) + return NamingsystemType.ROOT; + throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); + } + public String toCode(NamingsystemType code) throws IllegalArgumentException { + if (code == NamingsystemType.CODESYSTEM) + return "codesystem"; + if (code == NamingsystemType.IDENTIFIER) + return "identifier"; + if (code == NamingsystemType.ROOT) + return "root"; + return "?"; + } + } + + public enum NamingsystemStatus implements FhirEnum { + /** + * System has been submitted but not yet approved. + */ + PROPOSED, + /** + * System is valid for use. + */ + ACTIVE, + /** + * System should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return PROPOSED; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PROPOSED: return "proposed"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PROPOSED: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PROPOSED: return "System has been submitted but not yet approved."; + case ACTIVE: return "System is valid for use."; + case RETIRED: return "System should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PROPOSED: return "proposed"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class NamingsystemStatusEnumFactory implements EnumFactory { + public NamingsystemStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("proposed".equals(codeString)) + return NamingsystemStatus.PROPOSED; + if ("active".equals(codeString)) + return NamingsystemStatus.ACTIVE; + if ("retired".equals(codeString)) + return NamingsystemStatus.RETIRED; + throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'"); + } + public String toCode(NamingsystemStatus code) throws IllegalArgumentException { + if (code == NamingsystemStatus.PROPOSED) + return "proposed"; + if (code == NamingsystemStatus.ACTIVE) + return "active"; + if (code == NamingsystemStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum NamingsystemIdentifierType implements FhirEnum { + /** + * An ISO object identifier. E.g. 1.2.3.4.5. + */ + OID, + /** + * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. + */ + UUID, + /** + * A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org. + */ + URI, + /** + * Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return OID; + if ("uuid".equals(codeString)) + return UUID; + if ("uri".equals(codeString)) + return URI; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case OID: return "oid"; + case UUID: return "uuid"; + case URI: return "uri"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OID: return ""; + case UUID: return ""; + case URI: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OID: return "An ISO object identifier. E.g. 1.2.3.4.5."; + case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11."; + case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org."; + case OTHER: return "Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OID: return "oid"; + case UUID: return "uuid"; + case URI: return "uri"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory { + public NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("oid".equals(codeString)) + return NamingsystemIdentifierType.OID; + if ("uuid".equals(codeString)) + return NamingsystemIdentifierType.UUID; + if ("uri".equals(codeString)) + return NamingsystemIdentifierType.URI; + if ("other".equals(codeString)) + return NamingsystemIdentifierType.OTHER; + throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); + } + public String toCode(NamingsystemIdentifierType code) throws IllegalArgumentException { + if (code == NamingsystemIdentifierType.OID) + return "oid"; + if (code == NamingsystemIdentifierType.UUID) + return "uuid"; + if (code == NamingsystemIdentifierType.URI) + return "uri"; + if (code == NamingsystemIdentifierType.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class NamingSystemUniqueIdComponent extends BackboneElement { + /** + * Identifies the unique identifier scheme used for this particular identifier. + */ + @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." ) + protected Enumeration type; + + /** + * The string that should be sent over the wire to identify the code system or identifier system. + */ + @Child(name="value", type={StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." ) + protected StringType value; + + /** + * Indicates whether this identifier is the "preferred" identifier of this type. + */ + @Child(name="preferred", type={BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the 'preferred' identifier of this type." ) + protected BooleanType preferred; + + /** + * Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic. + */ + @Child(name="period", type={Period.class}, order=4, min=0, max=1) + @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic." ) + protected Period period; + + private static final long serialVersionUID = -250649344L; + + public NamingSystemUniqueIdComponent() { + super(); + } + + public NamingSystemUniqueIdComponent(Enumeration type, StringType value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Identifies the unique identifier scheme used for this particular identifier. + */ + public NamingsystemIdentifierType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Identifies the unique identifier scheme used for this particular identifier. + */ + public NamingSystemUniqueIdComponent setType(NamingsystemIdentifierType value) { + if (this.type == null) + this.type = new Enumeration(NamingsystemIdentifierType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The string that should be sent over the wire to identify the code system or identifier system. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The string that should be sent over the wire to identify the code system or identifier system. + */ + public NamingSystemUniqueIdComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + /** + * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public BooleanType getPreferredElement() { + if (this.preferred == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred"); + else if (Configuration.doAutoCreate()) + this.preferred = new BooleanType(); + return this.preferred; + } + + public boolean hasPreferredElement() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + public boolean hasPreferred() { + return this.preferred != null && !this.preferred.isEmpty(); + } + + /** + * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value + */ + public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { + this.preferred = value; + return this; + } + + /** + * @return Indicates whether this identifier is the "preferred" identifier of this type. + */ + public boolean getPreferred() { + return this.preferred == null ? false : this.preferred.getValue(); + } + + /** + * @param value Indicates whether this identifier is the "preferred" identifier of this type. + */ + public NamingSystemUniqueIdComponent setPreferred(boolean value) { + if (value == false) + this.preferred = null; + else { + if (this.preferred == null) + this.preferred = new BooleanType(); + this.preferred.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.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} (Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.) + */ + public NamingSystemUniqueIdComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("preferred", "boolean", "Indicates whether this identifier is the 'preferred' identifier of this type.", 0, java.lang.Integer.MAX_VALUE, preferred)); + childrenList.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public NamingSystemUniqueIdComponent copy() { + NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + dst.preferred = preferred == null ? null : preferred.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + && (preferred == null || preferred.isEmpty()) && (period == null || period.isEmpty()); + } + + } + + @Block() + public static class NamingSystemContactComponent extends BackboneElement { + /** + * Names of the person who can be contacted. + */ + @Child(name="name", type={HumanName.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of person", formalDefinition="Names of the person who can be contacted." ) + protected HumanName name; + + /** + * Identifies the mechanism(s) by which they can be contacted. + */ + @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Phone, email, etc.", formalDefinition="Identifies the mechanism(s) by which they can be contacted." ) + protected List telecom; + + private static final long serialVersionUID = -888464692L; + + public NamingSystemContactComponent() { + super(); + } + + /** + * @return {@link #name} (Names of the person who can be contacted.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystemContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Names of the person who can be contacted.) + */ + public NamingSystemContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (Identifies the mechanism(s) by which they can be contacted.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Identifies the mechanism(s) by which they can be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "HumanName", "Names of the person who can be contacted.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "Identifies the mechanism(s) by which they can be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + } + + public NamingSystemContactComponent copy() { + NamingSystemContactComponent dst = new NamingSystemContactComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + ; + } + + } + + /** + * Indicates the purpose for the namingsystem - what kinds of things does it make unique?. + */ + @Child(name="type", type={CodeType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the namingsystem - what kinds of things does it make unique?." ) + protected Enumeration type; + + /** + * The descriptive name of this particular identifier type or code system. + */ + @Child(name="name", type={StringType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Human-readable label", formalDefinition="The descriptive name of this particular identifier type or code system." ) + protected StringType name; + + /** + * Indicates whether the namingsystem is "ready for use" or not. + */ + @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="proposed | active | retired", formalDefinition="Indicates whether the namingsystem is 'ready for use' or not." ) + protected Enumeration status; + + /** + * If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + */ + @Child(name="country", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="ISO 3-char country code", formalDefinition="If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system." ) + protected CodeType country; + + /** + * Categorizes a namingsystem for easier search by grouping related namingsystems. + */ + @Child(name="category", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="driver | provider | patient | bank", formalDefinition="Categorizes a namingsystem for easier search by grouping related namingsystems." ) + protected CodeableConcept category; + + /** + * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + @Child(name="responsible", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." ) + protected StringType responsible; + + /** + * Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + @Child(name="description", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="What does namingsystem identify?", formalDefinition="Details about what the namespace identifies including scope, granularity, version labeling, etc." ) + protected StringType description; + + /** + * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + @Child(name="usage", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." ) + protected StringType usage; + + /** + * Indicates how the system may be identified when referenced in electronic exchange. + */ + @Child(name="uniqueId", type={}, order=7, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." ) + protected List uniqueId; + + /** + * The person who can be contacted about this system registration entry. + */ + @Child(name="contact", type={}, order=8, min=0, max=1) + @Description(shortDefinition="Who should be contacted for questions about namingsystem", formalDefinition="The person who can be contacted about this system registration entry." ) + protected NamingSystemContactComponent contact; + + /** + * For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any). + */ + @Child(name="replacedBy", type={NamingSystem.class}, order=9, min=0, max=1) + @Description(shortDefinition="Use this instead", formalDefinition="For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any)." ) + protected Reference replacedBy; + + /** + * The actual object that is the target of the reference (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + protected NamingSystem replacedByTarget; + + private static final long serialVersionUID = -797915837L; + + public NamingSystem() { + super(); + } + + public NamingSystem(Enumeration type, StringType name, Enumeration status) { + super(); + this.type = type; + this.name = name; + this.status = status; + } + + /** + * @return {@link #type} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Indicates the purpose for the namingsystem - what kinds of things does it make unique?.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public NamingSystem setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Indicates the purpose for the namingsystem - what kinds of things does it make unique?. + */ + public NamingsystemType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Indicates the purpose for the namingsystem - what kinds of things does it make unique?. + */ + public NamingSystem setType(NamingsystemType value) { + if (this.type == null) + this.type = new Enumeration(NamingsystemType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public NamingSystem setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The descriptive name of this particular identifier type or code system. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The descriptive name of this particular identifier type or code system. + */ + public NamingSystem setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #status} (Indicates whether the namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 namingsystem is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public NamingSystem setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the namingsystem is "ready for use" or not. + */ + public NamingsystemStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the namingsystem is "ready for use" or not. + */ + public NamingSystem setStatus(NamingsystemStatus value) { + if (this.status == null) + this.status = new Enumeration(NamingsystemStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public CodeType getCountryElement() { + if (this.country == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.country"); + else if (Configuration.doAutoCreate()) + this.country = new CodeType(); + return this.country; + } + + public boolean hasCountryElement() { + return this.country != null && !this.country.isEmpty(); + } + + public boolean hasCountry() { + return this.country != null && !this.country.isEmpty(); + } + + /** + * @param value {@link #country} (If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value + */ + public NamingSystem setCountryElement(CodeType value) { + this.country = value; + return this; + } + + /** + * @return If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + */ + public String getCountry() { + return this.country == null ? null : this.country.getValue(); + } + + /** + * @param value If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + */ + public NamingSystem setCountry(String value) { + if (Utilities.noString(value)) + this.country = null; + else { + if (this.country == null) + this.country = new CodeType(); + this.country.setValue(value); + } + return this; + } + + /** + * @return {@link #category} (Categorizes a namingsystem for easier search by grouping related namingsystems.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.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} (Categorizes a namingsystem for easier search by grouping related namingsystems.) + */ + public NamingSystem setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public StringType getResponsibleElement() { + if (this.responsible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.responsible"); + else if (Configuration.doAutoCreate()) + this.responsible = new StringType(); + return this.responsible; + } + + public boolean hasResponsibleElement() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + public boolean hasResponsible() { + return this.responsible != null && !this.responsible.isEmpty(); + } + + /** + * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value + */ + public NamingSystem setResponsibleElement(StringType value) { + this.responsible = value; + return this; + } + + /** + * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + public String getResponsible() { + return this.responsible == null ? null : this.responsible.getValue(); + } + + /** + * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + */ + public NamingSystem setResponsible(String value) { + if (Utilities.noString(value)) + this.responsible = null; + else { + if (this.responsible == null) + this.responsible = new StringType(); + this.responsible.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). 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 NamingSystem.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} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public NamingSystem setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Details about what the namespace identifies including scope, granularity, version labeling, etc. + */ + public NamingSystem setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public StringType getUsageElement() { + if (this.usage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.usage"); + else if (Configuration.doAutoCreate()) + this.usage = new StringType(); + return this.usage; + } + + public boolean hasUsageElement() { + return this.usage != null && !this.usage.isEmpty(); + } + + public boolean hasUsage() { + return this.usage != null && !this.usage.isEmpty(); + } + + /** + * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value + */ + public NamingSystem setUsageElement(StringType value) { + this.usage = value; + return this; + } + + /** + * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + public String getUsage() { + return this.usage == null ? null : this.usage.getValue(); + } + + /** + * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + */ + public NamingSystem setUsage(String value) { + if (Utilities.noString(value)) + this.usage = null; + else { + if (this.usage == null) + this.usage = new StringType(); + this.usage.setValue(value); + } + return this; + } + + /** + * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) + */ + public List getUniqueId() { + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + return this.uniqueId; + } + + public boolean hasUniqueId() { + if (this.uniqueId == null) + return false; + for (NamingSystemUniqueIdComponent item : this.uniqueId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) + */ + // syntactic sugar + public NamingSystemUniqueIdComponent addUniqueId() { //3 + NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent(); + if (this.uniqueId == null) + this.uniqueId = new ArrayList(); + this.uniqueId.add(t); + return t; + } + + /** + * @return {@link #contact} (The person who can be contacted about this system registration entry.) + */ + public NamingSystemContactComponent getContact() { + if (this.contact == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.contact"); + else if (Configuration.doAutoCreate()) + this.contact = new NamingSystemContactComponent(); + return this.contact; + } + + public boolean hasContact() { + return this.contact != null && !this.contact.isEmpty(); + } + + /** + * @param value {@link #contact} (The person who can be contacted about this system registration entry.) + */ + public NamingSystem setContact(NamingSystemContactComponent value) { + this.contact = value; + return this; + } + + /** + * @return {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public Reference getReplacedBy() { + if (this.replacedBy == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.replacedBy"); + else if (Configuration.doAutoCreate()) + this.replacedBy = new Reference(); + return this.replacedBy; + } + + public boolean hasReplacedBy() { + return this.replacedBy != null && !this.replacedBy.isEmpty(); + } + + /** + * @param value {@link #replacedBy} (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public NamingSystem setReplacedBy(Reference value) { + this.replacedBy = value; + return this; + } + + /** + * @return {@link #replacedBy} 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. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public NamingSystem getReplacedByTarget() { + if (this.replacedByTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NamingSystem.replacedBy"); + else if (Configuration.doAutoCreate()) + this.replacedByTarget = new NamingSystem(); + return this.replacedByTarget; + } + + /** + * @param value {@link #replacedBy} 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. (For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).) + */ + public NamingSystem setReplacedByTarget(NamingSystem value) { + this.replacedByTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Indicates the purpose for the namingsystem - what kinds of things does it make unique?.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("name", "string", "The descriptive name of this particular identifier type or code system.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("status", "code", "Indicates whether the namingsystem is 'ready for use' or not.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("country", "code", "If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system.", 0, java.lang.Integer.MAX_VALUE, country)); + childrenList.add(new Property("category", "CodeableConcept", "Categorizes a namingsystem for easier search by grouping related namingsystems.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, java.lang.Integer.MAX_VALUE, responsible)); + childrenList.add(new Property("description", "string", "Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, java.lang.Integer.MAX_VALUE, usage)); + childrenList.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId)); + childrenList.add(new Property("contact", "", "The person who can be contacted about this system registration entry.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("replacedBy", "Reference(NamingSystem)", "For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any).", 0, java.lang.Integer.MAX_VALUE, replacedBy)); + } + + public NamingSystem copy() { + NamingSystem dst = new NamingSystem(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.name = name == null ? null : name.copy(); + dst.status = status == null ? null : status.copy(); + dst.country = country == null ? null : country.copy(); + dst.category = category == null ? null : category.copy(); + dst.responsible = responsible == null ? null : responsible.copy(); + dst.description = description == null ? null : description.copy(); + dst.usage = usage == null ? null : usage.copy(); + if (uniqueId != null) { + dst.uniqueId = new ArrayList(); + for (NamingSystemUniqueIdComponent i : uniqueId) + dst.uniqueId.add(i.copy()); + }; + dst.contact = contact == null ? null : contact.copy(); + dst.replacedBy = replacedBy == null ? null : replacedBy.copy(); + return dst; + } + + protected NamingSystem typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) + && (status == null || status.isEmpty()) && (country == null || country.isEmpty()) && (category == null || category.isEmpty()) + && (responsible == null || responsible.isEmpty()) && (description == null || description.isEmpty()) + && (usage == null || usage.isEmpty()) && (uniqueId == null || uniqueId.isEmpty()) && (contact == null || contact.isEmpty()) + && (replacedBy == null || replacedBy.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.NamingSystem; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java index b2ad54d2c7a..5e2e52bec68 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java @@ -20,272 +20,272 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.xhtml.XhtmlNode; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A human-readable formatted text, including images. - */ -@DatatypeDef(name="Narrative") -public class Narrative extends Element { - - public enum NarrativeStatus implements FhirEnum { - /** - * The contents of the narrative are entirely generated from the structured data in the resource. - */ - GENERATED, - /** - * The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions. - */ - EXTENSIONS, - /** - * The contents of the narrative contain additional information not found in the structured data. - */ - ADDITIONAL, - /** - * the contents of the narrative are some equivalent of "No human-readable text provided for this resource". - */ - EMPTY, - /** - * added to help the parsers - */ - NULL; - - 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)) - return GENERATED; - if ("extensions".equals(codeString)) - return EXTENSIONS; - if ("additional".equals(codeString)) - return ADDITIONAL; - if ("empty".equals(codeString)) - return EMPTY; - throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case GENERATED: return "generated"; - case EXTENSIONS: return "extensions"; - case ADDITIONAL: return "additional"; - case EMPTY: return "empty"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case GENERATED: return ""; - case EXTENSIONS: return ""; - case ADDITIONAL: return ""; - case EMPTY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case GENERATED: return "The contents of the narrative are entirely generated from the structured data in the resource."; - case EXTENSIONS: return "The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions."; - case ADDITIONAL: return "The contents of the narrative contain additional information not found in the structured data."; - case EMPTY: return "the contents of the narrative are some equivalent of 'No human-readable text provided for this resource'."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case GENERATED: return "generated"; - case EXTENSIONS: return "extensions"; - case ADDITIONAL: return "additional"; - case EMPTY: return "empty"; - default: return "?"; - } - } - } - - public static class NarrativeStatusEnumFactory implements EnumFactory { - public NarrativeStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("generated".equals(codeString)) - return NarrativeStatus.GENERATED; - if ("extensions".equals(codeString)) - return NarrativeStatus.EXTENSIONS; - if ("additional".equals(codeString)) - return NarrativeStatus.ADDITIONAL; - if ("empty".equals(codeString)) - return NarrativeStatus.EMPTY; - throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); - } - public String toCode(NarrativeStatus code) throws IllegalArgumentException { - if (code == NarrativeStatus.GENERATED) - return "generated"; - if (code == NarrativeStatus.EXTENSIONS) - return "extensions"; - if (code == NarrativeStatus.ADDITIONAL) - return "additional"; - if (code == NarrativeStatus.EMPTY) - return "empty"; - return "?"; - } - } - - /** - * The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - */ - @Child(name="status", type={CodeType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="generated | extensions | additional", formalDefinition="The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data." ) - protected Enumeration status; - - /** - * The actual narrative content, a stripped down version of XHTML. - */ - @Child(name="div", type={}, order=0, min=1, max=1) - @Description(shortDefinition="Limited xhtml content", formalDefinition="The actual narrative content, a stripped down version of XHTML." ) - protected XhtmlNode div; - - private static final long serialVersionUID = 1463852859L; - - public Narrative() { - super(); - } - - public Narrative(Enumeration status, XhtmlNode div) { - super(); - this.status = status; - this.div = div; - } - - /** - * @return {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Narrative.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Narrative setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - */ - public NarrativeStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. - */ - public Narrative setStatus(NarrativeStatus value) { - if (this.status == null) - this.status = new Enumeration(NarrativeStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #div} (The actual narrative content, a stripped down version of XHTML.) - */ - public XhtmlNode getDiv() { - if (this.div == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Narrative.div"); - else if (Configuration.doAutoCreate()) - this.div = new XhtmlNode(); - return this.div; - } - - public boolean hasDiv() { - return this.div != null && !this.div.isEmpty(); - } - - /** - * @param value {@link #div} (The actual narrative content, a stripped down version of XHTML.) - */ - public Narrative setDiv(XhtmlNode value) { - this.div = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - public Narrative copy() { - Narrative dst = new Narrative(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.div = div == null ? null : div.copy(); - return dst; - } - - protected Narrative typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty()) - ; - } - - -} - + +/* + 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.xhtml.XhtmlNode; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A human-readable formatted text, including images. + */ +@DatatypeDef(name="Narrative") +public class Narrative extends Element { + + public enum NarrativeStatus implements FhirEnum { + /** + * The contents of the narrative are entirely generated from the structured data in the resource. + */ + GENERATED, + /** + * The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions. + */ + EXTENSIONS, + /** + * The contents of the narrative contain additional information not found in the structured data. + */ + ADDITIONAL, + /** + * the contents of the narrative are some equivalent of "No human-readable text provided for this resource". + */ + EMPTY, + /** + * added to help the parsers + */ + NULL; + + 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)) + return GENERATED; + if ("extensions".equals(codeString)) + return EXTENSIONS; + if ("additional".equals(codeString)) + return ADDITIONAL; + if ("empty".equals(codeString)) + return EMPTY; + throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case GENERATED: return "generated"; + case EXTENSIONS: return "extensions"; + case ADDITIONAL: return "additional"; + case EMPTY: return "empty"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case GENERATED: return ""; + case EXTENSIONS: return ""; + case ADDITIONAL: return ""; + case EMPTY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case GENERATED: return "The contents of the narrative are entirely generated from the structured data in the resource."; + case EXTENSIONS: return "The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions."; + case ADDITIONAL: return "The contents of the narrative contain additional information not found in the structured data."; + case EMPTY: return "the contents of the narrative are some equivalent of 'No human-readable text provided for this resource'."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case GENERATED: return "generated"; + case EXTENSIONS: return "extensions"; + case ADDITIONAL: return "additional"; + case EMPTY: return "empty"; + default: return "?"; + } + } + } + + public static class NarrativeStatusEnumFactory implements EnumFactory { + public NarrativeStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("generated".equals(codeString)) + return NarrativeStatus.GENERATED; + if ("extensions".equals(codeString)) + return NarrativeStatus.EXTENSIONS; + if ("additional".equals(codeString)) + return NarrativeStatus.ADDITIONAL; + if ("empty".equals(codeString)) + return NarrativeStatus.EMPTY; + throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); + } + public String toCode(NarrativeStatus code) throws IllegalArgumentException { + if (code == NarrativeStatus.GENERATED) + return "generated"; + if (code == NarrativeStatus.EXTENSIONS) + return "extensions"; + if (code == NarrativeStatus.ADDITIONAL) + return "additional"; + if (code == NarrativeStatus.EMPTY) + return "empty"; + return "?"; + } + } + + /** + * The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + @Child(name="status", type={CodeType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="generated | extensions | additional", formalDefinition="The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data." ) + protected Enumeration status; + + /** + * The actual narrative content, a stripped down version of XHTML. + */ + @Child(name="div", type={}, order=0, min=1, max=1) + @Description(shortDefinition="Limited xhtml content", formalDefinition="The actual narrative content, a stripped down version of XHTML." ) + protected XhtmlNode div; + + private static final long serialVersionUID = 1463852859L; + + public Narrative() { + super(); + } + + public Narrative(Enumeration status, XhtmlNode div) { + super(); + this.status = status; + this.div = div; + } + + /** + * @return {@link #status} (The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Narrative.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Narrative setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + public NarrativeStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + */ + public Narrative setStatus(NarrativeStatus value) { + if (this.status == null) + this.status = new Enumeration(NarrativeStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #div} (The actual narrative content, a stripped down version of XHTML.) + */ + public XhtmlNode getDiv() { + if (this.div == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Narrative.div"); + else if (Configuration.doAutoCreate()) + this.div = new XhtmlNode(); + return this.div; + } + + public boolean hasDiv() { + return this.div != null && !this.div.isEmpty(); + } + + /** + * @param value {@link #div} (The actual narrative content, a stripped down version of XHTML.) + */ + public Narrative setDiv(XhtmlNode value) { + this.div = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + public Narrative copy() { + Narrative dst = new Narrative(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + dst.div = div == null ? null : div.copy(); + return dst; + } + + protected Narrative typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java index 3830dbba71c..55b5ce2c430 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java @@ -20,2055 +20,2055 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ -@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") -public class NutritionOrder extends DomainResource { - - public enum NutritionOrderStatus implements FhirEnum { - /** - * TODO. - */ - REQUESTED, - /** - * TODO. - */ - ACTIVE, - /** - * TODO. - */ - INACTIVE, - /** - * TODO. - */ - HELD, - /** - * TODO. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - - public static final NutritionOrderStatusEnumFactory ENUM_FACTORY = new NutritionOrderStatusEnumFactory(); - - public static NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("inactive".equals(codeString)) - return INACTIVE; - if ("held".equals(codeString)) - return HELD; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - case HELD: return "held"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case ACTIVE: return ""; - case INACTIVE: return ""; - case HELD: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "TODO."; - case ACTIVE: return "TODO."; - case INACTIVE: return "TODO."; - case HELD: return "TODO."; - case CANCELLED: return "TODO."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case ACTIVE: return "Active"; - case INACTIVE: return "Inactive"; - case HELD: return "Held"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class NutritionOrderStatusEnumFactory implements EnumFactory { - public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return NutritionOrderStatus.REQUESTED; - if ("active".equals(codeString)) - return NutritionOrderStatus.ACTIVE; - if ("inactive".equals(codeString)) - return NutritionOrderStatus.INACTIVE; - if ("held".equals(codeString)) - return NutritionOrderStatus.HELD; - if ("cancelled".equals(codeString)) - return NutritionOrderStatus.CANCELLED; - throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - public String toCode(NutritionOrderStatus code) throws IllegalArgumentException { - if (code == NutritionOrderStatus.REQUESTED) - return "requested"; - if (code == NutritionOrderStatus.ACTIVE) - return "active"; - if (code == NutritionOrderStatus.INACTIVE) - return "inactive"; - if (code == NutritionOrderStatus.HELD) - return "held"; - if (code == NutritionOrderStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - @Block() - public static class NutritionOrderItemComponent extends BackboneElement { - /** - * The frequency at which the diet, oral supplement or enteral formula should be given. - */ - @Child(name="scheduled", type={Timing.class, Period.class}, order=1, min=0, max=1) - @Description(shortDefinition="Frequency to offer nutrition item", formalDefinition="The frequency at which the diet, oral supplement or enteral formula should be given." ) - protected Type scheduled; - - /** - * Indicates whether the nutrition item is currently in effect for the patient. - */ - @Child(name="isInEffect", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Indicates whether the nutrition item is currently in effect", formalDefinition="Indicates whether the nutrition item is currently in effect for the patient." ) - protected BooleanType isInEffect; - - /** - * Class that defines the components of an oral diet order for the patient. - */ - @Child(name="oralDiet", type={}, order=3, min=0, max=1) - @Description(shortDefinition="Oral diet components", formalDefinition="Class that defines the components of an oral diet order for the patient." ) - protected NutritionOrderItemOralDietComponent oralDiet; - - /** - * Class that defines the components of a supplement order for the patient. - */ - @Child(name="supplement", type={}, order=4, min=0, max=1) - @Description(shortDefinition="Supplement components", formalDefinition="Class that defines the components of a supplement order for the patient." ) - protected NutritionOrderItemSupplementComponent supplement; - - /** - * Class that defines the components of an enteral formula order for the patient. - */ - @Child(name="enteralFormula", type={}, order=5, min=0, max=1) - @Description(shortDefinition="Enteral formula components", formalDefinition="Class that defines the components of an enteral formula order for the patient." ) - protected NutritionOrderItemEnteralFormulaComponent enteralFormula; - - private static final long serialVersionUID = 2064921337L; - - public NutritionOrderItemComponent() { - super(); - } - - public NutritionOrderItemComponent(BooleanType isInEffect) { - super(); - this.isInEffect = isInEffect; - } - - /** - * @return {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) - */ - public Timing getScheduledTiming() throws Exception { - if (!(this.scheduled instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - /** - * @return {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) - */ - public Period getScheduledPeriod() throws Exception { - if (!(this.scheduled instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) - */ - public NutritionOrderItemComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #isInEffect} (Indicates whether the nutrition item is currently in effect for the patient.). This is the underlying object with id, value and extensions. The accessor "getIsInEffect" gives direct access to the value - */ - public BooleanType getIsInEffectElement() { - if (this.isInEffect == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemComponent.isInEffect"); - else if (Configuration.doAutoCreate()) - this.isInEffect = new BooleanType(); - return this.isInEffect; - } - - public boolean hasIsInEffectElement() { - return this.isInEffect != null && !this.isInEffect.isEmpty(); - } - - public boolean hasIsInEffect() { - return this.isInEffect != null && !this.isInEffect.isEmpty(); - } - - /** - * @param value {@link #isInEffect} (Indicates whether the nutrition item is currently in effect for the patient.). This is the underlying object with id, value and extensions. The accessor "getIsInEffect" gives direct access to the value - */ - public NutritionOrderItemComponent setIsInEffectElement(BooleanType value) { - this.isInEffect = value; - return this; - } - - /** - * @return Indicates whether the nutrition item is currently in effect for the patient. - */ - public boolean getIsInEffect() { - return this.isInEffect == null ? false : this.isInEffect.getValue(); - } - - /** - * @param value Indicates whether the nutrition item is currently in effect for the patient. - */ - public NutritionOrderItemComponent setIsInEffect(boolean value) { - if (this.isInEffect == null) - this.isInEffect = new BooleanType(); - this.isInEffect.setValue(value); - return this; - } - - /** - * @return {@link #oralDiet} (Class that defines the components of an oral diet order for the patient.) - */ - public NutritionOrderItemOralDietComponent getOralDiet() { - if (this.oralDiet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemComponent.oralDiet"); - else if (Configuration.doAutoCreate()) - this.oralDiet = new NutritionOrderItemOralDietComponent(); - return this.oralDiet; - } - - public boolean hasOralDiet() { - return this.oralDiet != null && !this.oralDiet.isEmpty(); - } - - /** - * @param value {@link #oralDiet} (Class that defines the components of an oral diet order for the patient.) - */ - public NutritionOrderItemComponent setOralDiet(NutritionOrderItemOralDietComponent value) { - this.oralDiet = value; - return this; - } - - /** - * @return {@link #supplement} (Class that defines the components of a supplement order for the patient.) - */ - public NutritionOrderItemSupplementComponent getSupplement() { - if (this.supplement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemComponent.supplement"); - else if (Configuration.doAutoCreate()) - this.supplement = new NutritionOrderItemSupplementComponent(); - return this.supplement; - } - - public boolean hasSupplement() { - return this.supplement != null && !this.supplement.isEmpty(); - } - - /** - * @param value {@link #supplement} (Class that defines the components of a supplement order for the patient.) - */ - public NutritionOrderItemComponent setSupplement(NutritionOrderItemSupplementComponent value) { - this.supplement = value; - return this; - } - - /** - * @return {@link #enteralFormula} (Class that defines the components of an enteral formula order for the patient.) - */ - public NutritionOrderItemEnteralFormulaComponent getEnteralFormula() { - if (this.enteralFormula == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemComponent.enteralFormula"); - else if (Configuration.doAutoCreate()) - this.enteralFormula = new NutritionOrderItemEnteralFormulaComponent(); - return this.enteralFormula; - } - - public boolean hasEnteralFormula() { - return this.enteralFormula != null && !this.enteralFormula.isEmpty(); - } - - /** - * @param value {@link #enteralFormula} (Class that defines the components of an enteral formula order for the patient.) - */ - public NutritionOrderItemComponent setEnteralFormula(NutritionOrderItemEnteralFormulaComponent value) { - this.enteralFormula = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("scheduled[x]", "Timing|Period", "The frequency at which the diet, oral supplement or enteral formula should be given.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("isInEffect", "boolean", "Indicates whether the nutrition item is currently in effect for the patient.", 0, java.lang.Integer.MAX_VALUE, isInEffect)); - childrenList.add(new Property("oralDiet", "", "Class that defines the components of an oral diet order for the patient.", 0, java.lang.Integer.MAX_VALUE, oralDiet)); - childrenList.add(new Property("supplement", "", "Class that defines the components of a supplement order for the patient.", 0, java.lang.Integer.MAX_VALUE, supplement)); - childrenList.add(new Property("enteralFormula", "", "Class that defines the components of an enteral formula order for the patient.", 0, java.lang.Integer.MAX_VALUE, enteralFormula)); - } - - public NutritionOrderItemComponent copy() { - NutritionOrderItemComponent dst = new NutritionOrderItemComponent(); - copyValues(dst); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.isInEffect = isInEffect == null ? null : isInEffect.copy(); - dst.oralDiet = oralDiet == null ? null : oralDiet.copy(); - dst.supplement = supplement == null ? null : supplement.copy(); - dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (scheduled == null || scheduled.isEmpty()) && (isInEffect == null || isInEffect.isEmpty()) - && (oralDiet == null || oralDiet.isEmpty()) && (supplement == null || supplement.isEmpty()) - && (enteralFormula == null || enteralFormula.isEmpty()); - } - - } - - @Block() - public static class NutritionOrderItemOralDietComponent extends BackboneElement { - /** - * Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth). - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth)." ) - protected List type; - - /** - * Class that defines the details of any nutrient modifications required for the oral diet. - */ - @Child(name="nutrients", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Required nutrient modifications", formalDefinition="Class that defines the details of any nutrient modifications required for the oral diet." ) - protected List nutrients; - - /** - * Class that describes any texture modifications required for the patient to safely consume various types of solid foods. - */ - @Child(name="texture", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Required texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." ) - protected List texture; - - /** - * Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. - */ - @Child(name="fluidConsistencyType", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." ) - protected List fluidConsistencyType; - - /** - * Additional instructions or information pertaining to the oral diet. - */ - @Child(name="instruction", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Additional instructions or information pertaining to the oral diet." ) - protected StringType instruction; - - private static final long serialVersionUID = 1978112477L; - - public NutritionOrderItemOralDietComponent() { - super(); - } - - /** - * @return {@link #type} (Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @return {@link #nutrients} (Class that defines the details of any nutrient modifications required for the oral diet.) - */ - public List getNutrients() { - if (this.nutrients == null) - this.nutrients = new ArrayList(); - return this.nutrients; - } - - public boolean hasNutrients() { - if (this.nutrients == null) - return false; - for (NutritionOrderItemOralDietNutrientsComponent item : this.nutrients) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #nutrients} (Class that defines the details of any nutrient modifications required for the oral diet.) - */ - // syntactic sugar - public NutritionOrderItemOralDietNutrientsComponent addNutrients() { //3 - NutritionOrderItemOralDietNutrientsComponent t = new NutritionOrderItemOralDietNutrientsComponent(); - if (this.nutrients == null) - this.nutrients = new ArrayList(); - this.nutrients.add(t); - return t; - } - - /** - * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) - */ - public List getTexture() { - if (this.texture == null) - this.texture = new ArrayList(); - return this.texture; - } - - public boolean hasTexture() { - if (this.texture == null) - return false; - for (NutritionOrderItemOralDietTextureComponent item : this.texture) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) - */ - // syntactic sugar - public NutritionOrderItemOralDietTextureComponent addTexture() { //3 - NutritionOrderItemOralDietTextureComponent t = new NutritionOrderItemOralDietTextureComponent(); - if (this.texture == null) - this.texture = new ArrayList(); - this.texture.add(t); - return t; - } - - /** - * @return {@link #fluidConsistencyType} (Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) - */ - public List getFluidConsistencyType() { - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - return this.fluidConsistencyType; - } - - public boolean hasFluidConsistencyType() { - if (this.fluidConsistencyType == null) - return false; - for (CodeableConcept item : this.fluidConsistencyType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fluidConsistencyType} (Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) - */ - // syntactic sugar - public CodeableConcept addFluidConsistencyType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - this.fluidConsistencyType.add(t); - return t; - } - - /** - * @return {@link #instruction} (Additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public StringType getInstructionElement() { - if (this.instruction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemOralDietComponent.instruction"); - else if (Configuration.doAutoCreate()) - this.instruction = new StringType(); - return this.instruction; - } - - public boolean hasInstructionElement() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - public boolean hasInstruction() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - /** - * @param value {@link #instruction} (Additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public NutritionOrderItemOralDietComponent setInstructionElement(StringType value) { - this.instruction = value; - return this; - } - - /** - * @return Additional instructions or information pertaining to the oral diet. - */ - public String getInstruction() { - return this.instruction == null ? null : this.instruction.getValue(); - } - - /** - * @param value Additional instructions or information pertaining to the oral diet. - */ - public NutritionOrderItemOralDietComponent setInstruction(String value) { - if (Utilities.noString(value)) - this.instruction = null; - else { - if (this.instruction == null) - this.instruction = new StringType(); - this.instruction.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("nutrients", "", "Class that defines the details of any nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrients)); - childrenList.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture)); - childrenList.add(new Property("fluidConsistencyType", "CodeableConcept", "Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType)); - childrenList.add(new Property("instruction", "string", "Additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); - } - - public NutritionOrderItemOralDietComponent copy() { - NutritionOrderItemOralDietComponent dst = new NutritionOrderItemOralDietComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - if (nutrients != null) { - dst.nutrients = new ArrayList(); - for (NutritionOrderItemOralDietNutrientsComponent i : nutrients) - dst.nutrients.add(i.copy()); - }; - if (texture != null) { - dst.texture = new ArrayList(); - for (NutritionOrderItemOralDietTextureComponent i : texture) - dst.texture.add(i.copy()); - }; - if (fluidConsistencyType != null) { - dst.fluidConsistencyType = new ArrayList(); - for (CodeableConcept i : fluidConsistencyType) - dst.fluidConsistencyType.add(i.copy()); - }; - dst.instruction = instruction == null ? null : instruction.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (nutrients == null || nutrients.isEmpty()) - && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) - && (instruction == null || instruction.isEmpty()); - } - - } - - @Block() - public static class NutritionOrderItemOralDietNutrientsComponent extends BackboneElement { - /** - * Identifies the type of nutrient that is being modified such as cabohydrate or sodium. - */ - @Child(name="modifier", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="Identifies the type of nutrient that is being modified such as cabohydrate or sodium." ) - protected CodeableConcept modifier; - - /** - * The quantity or range of the specified nutrient to supply. - */ - @Child(name="amount", type={Quantity.class, Range.class}, order=2, min=0, max=1) - @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity or range of the specified nutrient to supply." ) - protected Type amount; - - private static final long serialVersionUID = -1359777156L; - - public NutritionOrderItemOralDietNutrientsComponent() { - super(); - } - - /** - * @return {@link #modifier} (Identifies the type of nutrient that is being modified such as cabohydrate or sodium.) - */ - public CodeableConcept getModifier() { - if (this.modifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemOralDietNutrientsComponent.modifier"); - else if (Configuration.doAutoCreate()) - this.modifier = new CodeableConcept(); - return this.modifier; - } - - public boolean hasModifier() { - return this.modifier != null && !this.modifier.isEmpty(); - } - - /** - * @param value {@link #modifier} (Identifies the type of nutrient that is being modified such as cabohydrate or sodium.) - */ - public NutritionOrderItemOralDietNutrientsComponent setModifier(CodeableConcept value) { - this.modifier = value; - return this; - } - - /** - * @return {@link #amount} (The quantity or range of the specified nutrient to supply.) - */ - public Type getAmount() { - return this.amount; - } - - /** - * @return {@link #amount} (The quantity or range of the specified nutrient to supply.) - */ - public Quantity getAmountQuantity() throws Exception { - if (!(this.amount instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.amount.getClass().getName()+" was encountered"); - return (Quantity) this.amount; - } - - /** - * @return {@link #amount} (The quantity or range of the specified nutrient to supply.) - */ - public Range getAmountRange() throws Exception { - if (!(this.amount instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.amount.getClass().getName()+" was encountered"); - return (Range) this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (The quantity or range of the specified nutrient to supply.) - */ - public NutritionOrderItemOralDietNutrientsComponent setAmount(Type value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("modifier", "CodeableConcept", "Identifies the type of nutrient that is being modified such as cabohydrate or sodium.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("amount[x]", "Quantity|Range", "The quantity or range of the specified nutrient to supply.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public NutritionOrderItemOralDietNutrientsComponent copy() { - NutritionOrderItemOralDietNutrientsComponent dst = new NutritionOrderItemOralDietNutrientsComponent(); - copyValues(dst); - dst.modifier = modifier == null ? null : modifier.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - @Block() - public static class NutritionOrderItemOralDietTextureComponent extends BackboneElement { - /** - * Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed. - */ - @Child(name="modifier", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g., pureed", formalDefinition="Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed." ) - protected CodeableConcept modifier; - - /** - * Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet. - */ - @Child(name="foodType", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet." ) - protected CodeableConcept foodType; - - private static final long serialVersionUID = -56402817L; - - public NutritionOrderItemOralDietTextureComponent() { - super(); - } - - /** - * @return {@link #modifier} (Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed.) - */ - public CodeableConcept getModifier() { - if (this.modifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemOralDietTextureComponent.modifier"); - else if (Configuration.doAutoCreate()) - this.modifier = new CodeableConcept(); - return this.modifier; - } - - public boolean hasModifier() { - return this.modifier != null && !this.modifier.isEmpty(); - } - - /** - * @param value {@link #modifier} (Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed.) - */ - public NutritionOrderItemOralDietTextureComponent setModifier(CodeableConcept value) { - this.modifier = value; - return this; - } - - /** - * @return {@link #foodType} (Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.) - */ - public CodeableConcept getFoodType() { - if (this.foodType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemOralDietTextureComponent.foodType"); - else if (Configuration.doAutoCreate()) - this.foodType = new CodeableConcept(); - return this.foodType; - } - - public boolean hasFoodType() { - return this.foodType != null && !this.foodType.isEmpty(); - } - - /** - * @param value {@link #foodType} (Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.) - */ - public NutritionOrderItemOralDietTextureComponent setFoodType(CodeableConcept value) { - this.foodType = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("modifier", "CodeableConcept", "Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("foodType", "CodeableConcept", "Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.", 0, java.lang.Integer.MAX_VALUE, foodType)); - } - - public NutritionOrderItemOralDietTextureComponent copy() { - NutritionOrderItemOralDietTextureComponent dst = new NutritionOrderItemOralDietTextureComponent(); - copyValues(dst); - dst.modifier = modifier == null ? null : modifier.copy(); - dst.foodType = foodType == null ? null : foodType.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (foodType == null || foodType.isEmpty()) - ; - } - - } - - @Block() - public static class NutritionOrderItemSupplementComponent extends BackboneElement { - /** - * Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of supplement product requested", formalDefinition="Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement." ) - protected CodeableConcept type; - - /** - * The amount of the nutritional supplement product to provide to the patient. - */ - @Child(name="quantity", type={Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement product to provide to the patient." ) - protected Quantity quantity; - - /** - * The product or brand name of the nutritional supplement product to be provided to the patient. - */ - @Child(name="name", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement product to be provided to the patient." ) - protected StringType name; - - private static final long serialVersionUID = 505308801L; - - public NutritionOrderItemSupplementComponent() { - super(); - } - - /** - * @return {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) - */ - public NutritionOrderItemSupplementComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of the nutritional supplement product to provide to the patient.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the nutritional supplement product to provide to the patient.) - */ - public NutritionOrderItemSupplementComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #name} (The product or brand name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 product or brand name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public NutritionOrderItemSupplementComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The product or brand name of the nutritional supplement product to be provided to the patient. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The product or brand name of the nutritional supplement product to be provided to the patient. - */ - public NutritionOrderItemSupplementComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "Quantity", "The amount of the nutritional supplement product to provide to the patient.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("name", "string", "The product or brand name of the nutritional supplement product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, name)); - } - - public NutritionOrderItemSupplementComponent copy() { - NutritionOrderItemSupplementComponent dst = new NutritionOrderItemSupplementComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.name = name == null ? null : name.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (name == null || name.isEmpty()); - } - - } - - @Block() - public static class NutritionOrderItemEnteralFormulaComponent extends BackboneElement { - /** - * Free text formula administration or feeding instructions for cases where the instructions are too complex to code. - */ - @Child(name="administrationInstructions", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration or feeding instructions for cases where the instructions are too complex to code." ) - protected StringType administrationInstructions; - - /** - * Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula. - */ - @Child(name="baseFormulaType", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula." ) - protected CodeableConcept baseFormulaType; - - /** - * The product or brand name of the enteral or infant formula product to be provided to the patient. - */ - @Child(name="baseFormulaName", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product to be provided to the patient." ) - protected StringType baseFormulaName; - - /** - * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. - */ - @Child(name="additiveType", type={CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." ) - protected CodeableConcept additiveType; - - /** - * The product or brand name of the type of modular component to be added to the formula. - */ - @Child(name="additiveName", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." ) - protected StringType additiveName; - - /** - * The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. - */ - @Child(name="caloricDensity", type={Quantity.class}, order=6, min=0, max=1) - @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) - protected Quantity caloricDensity; - - /** - * A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube. - */ - @Child(name="routeofAdministration", type={CodeableConcept.class}, order=7, min=0, max=1) - @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube." ) - protected CodeableConcept routeofAdministration; - - /** - * The volume of formula to provide to the patient per the specified administration schedule. - */ - @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) - @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) - protected Quantity quantity; - - /** - * Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule. - */ - @Child(name="rate", type={Ratio.class}, order=9, min=0, max=1) - @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule." ) - protected Ratio rate; - - /** - * The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours. - */ - @Child(name="rateAdjustment", type={Quantity.class}, order=10, min=0, max=1) - @Description(shortDefinition="Change in the rate of administration over a given time", formalDefinition="The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours." ) - protected Quantity rateAdjustment; - - /** - * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours. - */ - @Child(name="maxVolumeToDeliver", type={Quantity.class}, order=11, min=0, max=1) - @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours." ) - protected Quantity maxVolumeToDeliver; - - private static final long serialVersionUID = 1106347909L; - - public NutritionOrderItemEnteralFormulaComponent() { - super(); - } - - /** - * @return {@link #administrationInstructions} (Free text formula administration or feeding instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value - */ - public StringType getAdministrationInstructionsElement() { - if (this.administrationInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.administrationInstructions"); - else if (Configuration.doAutoCreate()) - this.administrationInstructions = new StringType(); - return this.administrationInstructions; - } - - public boolean hasAdministrationInstructionsElement() { - return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); - } - - public boolean hasAdministrationInstructions() { - return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); - } - - /** - * @param value {@link #administrationInstructions} (Free text formula administration or feeding instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value - */ - public NutritionOrderItemEnteralFormulaComponent setAdministrationInstructionsElement(StringType value) { - this.administrationInstructions = value; - return this; - } - - /** - * @return Free text formula administration or feeding instructions for cases where the instructions are too complex to code. - */ - public String getAdministrationInstructions() { - return this.administrationInstructions == null ? null : this.administrationInstructions.getValue(); - } - - /** - * @param value Free text formula administration or feeding instructions for cases where the instructions are too complex to code. - */ - public NutritionOrderItemEnteralFormulaComponent setAdministrationInstructions(String value) { - if (Utilities.noString(value)) - this.administrationInstructions = null; - else { - if (this.administrationInstructions == null) - this.administrationInstructions = new StringType(); - this.administrationInstructions.setValue(value); - } - return this; - } - - /** - * @return {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.) - */ - public CodeableConcept getBaseFormulaType() { - if (this.baseFormulaType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.baseFormulaType"); - else if (Configuration.doAutoCreate()) - this.baseFormulaType = new CodeableConcept(); - return this.baseFormulaType; - } - - public boolean hasBaseFormulaType() { - return this.baseFormulaType != null && !this.baseFormulaType.isEmpty(); - } - - /** - * @param value {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.) - */ - public NutritionOrderItemEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { - this.baseFormulaType = value; - return this; - } - - /** - * @return {@link #baseFormulaName} (The product or brand name of the enteral or infant formula product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value - */ - public StringType getBaseFormulaNameElement() { - if (this.baseFormulaName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.baseFormulaName"); - else if (Configuration.doAutoCreate()) - this.baseFormulaName = new StringType(); - return this.baseFormulaName; - } - - public boolean hasBaseFormulaNameElement() { - return this.baseFormulaName != null && !this.baseFormulaName.isEmpty(); - } - - public boolean hasBaseFormulaName() { - return this.baseFormulaName != null && !this.baseFormulaName.isEmpty(); - } - - /** - * @param value {@link #baseFormulaName} (The product or brand name of the enteral or infant formula product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value - */ - public NutritionOrderItemEnteralFormulaComponent setBaseFormulaNameElement(StringType value) { - this.baseFormulaName = value; - return this; - } - - /** - * @return The product or brand name of the enteral or infant formula product to be provided to the patient. - */ - public String getBaseFormulaName() { - return this.baseFormulaName == null ? null : this.baseFormulaName.getValue(); - } - - /** - * @param value The product or brand name of the enteral or infant formula product to be provided to the patient. - */ - public NutritionOrderItemEnteralFormulaComponent setBaseFormulaName(String value) { - if (Utilities.noString(value)) - this.baseFormulaName = null; - else { - if (this.baseFormulaName == null) - this.baseFormulaName = new StringType(); - this.baseFormulaName.setValue(value); - } - return this; - } - - /** - * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) - */ - public CodeableConcept getAdditiveType() { - if (this.additiveType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.additiveType"); - else if (Configuration.doAutoCreate()) - this.additiveType = new CodeableConcept(); - return this.additiveType; - } - - public boolean hasAdditiveType() { - return this.additiveType != null && !this.additiveType.isEmpty(); - } - - /** - * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) - */ - public NutritionOrderItemEnteralFormulaComponent setAdditiveType(CodeableConcept value) { - this.additiveType = value; - return this; - } - - /** - * @return {@link #additiveName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveName" gives direct access to the value - */ - public StringType getAdditiveNameElement() { - if (this.additiveName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.additiveName"); - else if (Configuration.doAutoCreate()) - this.additiveName = new StringType(); - return this.additiveName; - } - - public boolean hasAdditiveNameElement() { - return this.additiveName != null && !this.additiveName.isEmpty(); - } - - public boolean hasAdditiveName() { - return this.additiveName != null && !this.additiveName.isEmpty(); - } - - /** - * @param value {@link #additiveName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveName" gives direct access to the value - */ - public NutritionOrderItemEnteralFormulaComponent setAdditiveNameElement(StringType value) { - this.additiveName = value; - return this; - } - - /** - * @return The product or brand name of the type of modular component to be added to the formula. - */ - public String getAdditiveName() { - return this.additiveName == null ? null : this.additiveName.getValue(); - } - - /** - * @param value The product or brand name of the type of modular component to be added to the formula. - */ - public NutritionOrderItemEnteralFormulaComponent setAdditiveName(String value) { - if (Utilities.noString(value)) - this.additiveName = null; - else { - if (this.additiveName == null) - this.additiveName = new StringType(); - this.additiveName.setValue(value); - } - return this; - } - - /** - * @return {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) - */ - public Quantity getCaloricDensity() { - if (this.caloricDensity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.caloricDensity"); - else if (Configuration.doAutoCreate()) - this.caloricDensity = new Quantity(); - return this.caloricDensity; - } - - public boolean hasCaloricDensity() { - return this.caloricDensity != null && !this.caloricDensity.isEmpty(); - } - - /** - * @param value {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) - */ - public NutritionOrderItemEnteralFormulaComponent setCaloricDensity(Quantity value) { - this.caloricDensity = value; - return this; - } - - /** - * @return {@link #routeofAdministration} (A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) - */ - public CodeableConcept getRouteofAdministration() { - if (this.routeofAdministration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.routeofAdministration"); - else if (Configuration.doAutoCreate()) - this.routeofAdministration = new CodeableConcept(); - return this.routeofAdministration; - } - - public boolean hasRouteofAdministration() { - return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); - } - - /** - * @param value {@link #routeofAdministration} (A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) - */ - public NutritionOrderItemEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { - this.routeofAdministration = value; - return this; - } - - /** - * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) - */ - public NutritionOrderItemEnteralFormulaComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) - */ - public Ratio getRate() { - if (this.rate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.rate"); - else if (Configuration.doAutoCreate()) - this.rate = new Ratio(); - return this.rate; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) - */ - public NutritionOrderItemEnteralFormulaComponent setRate(Ratio value) { - this.rate = value; - return this; - } - - /** - * @return {@link #rateAdjustment} (The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.) - */ - public Quantity getRateAdjustment() { - if (this.rateAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.rateAdjustment"); - else if (Configuration.doAutoCreate()) - this.rateAdjustment = new Quantity(); - return this.rateAdjustment; - } - - public boolean hasRateAdjustment() { - return this.rateAdjustment != null && !this.rateAdjustment.isEmpty(); - } - - /** - * @param value {@link #rateAdjustment} (The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.) - */ - public NutritionOrderItemEnteralFormulaComponent setRateAdjustment(Quantity value) { - this.rateAdjustment = value; - return this; - } - - /** - * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) - */ - public Quantity getMaxVolumeToDeliver() { - if (this.maxVolumeToDeliver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.maxVolumeToDeliver"); - else if (Configuration.doAutoCreate()) - this.maxVolumeToDeliver = new Quantity(); - return this.maxVolumeToDeliver; - } - - public boolean hasMaxVolumeToDeliver() { - return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty(); - } - - /** - * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) - */ - public NutritionOrderItemEnteralFormulaComponent setMaxVolumeToDeliver(Quantity value) { - this.maxVolumeToDeliver = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("administrationInstructions", "string", "Free text formula administration or feeding instructions for cases where the instructions are too complex to code.", 0, java.lang.Integer.MAX_VALUE, administrationInstructions)); - childrenList.add(new Property("baseFormulaType", "CodeableConcept", "Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); - childrenList.add(new Property("baseFormulaName", "string", "The product or brand name of the enteral or infant formula product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, baseFormulaName)); - childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); - childrenList.add(new Property("additiveName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveName)); - childrenList.add(new Property("caloricDensity", "Quantity", "The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); - childrenList.add(new Property("routeofAdministration", "CodeableConcept", "A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); - childrenList.add(new Property("quantity", "Quantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("rateAdjustment", "Quantity", "The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.", 0, java.lang.Integer.MAX_VALUE, rateAdjustment)); - childrenList.add(new Property("maxVolumeToDeliver", "Quantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxVolumeToDeliver)); - } - - public NutritionOrderItemEnteralFormulaComponent copy() { - NutritionOrderItemEnteralFormulaComponent dst = new NutritionOrderItemEnteralFormulaComponent(); - copyValues(dst); - dst.administrationInstructions = administrationInstructions == null ? null : administrationInstructions.copy(); - dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); - dst.baseFormulaName = baseFormulaName == null ? null : baseFormulaName.copy(); - dst.additiveType = additiveType == null ? null : additiveType.copy(); - dst.additiveName = additiveName == null ? null : additiveName.copy(); - dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); - dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.rateAdjustment = rateAdjustment == null ? null : rateAdjustment.copy(); - dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (administrationInstructions == null || administrationInstructions.isEmpty()) - && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaName == null || baseFormulaName.isEmpty()) - && (additiveType == null || additiveType.isEmpty()) && (additiveName == null || additiveName.isEmpty()) - && (caloricDensity == null || caloricDensity.isEmpty()) && (routeofAdministration == null || routeofAdministration.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (rateAdjustment == null || rateAdjustment.isEmpty()) - && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()); - } - - } - - /** - * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. - */ - @Child(name="subject", type={Patient.class}, order=-1, min=1, max=1) - @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - protected Patient subjectTarget; - - /** - * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. - */ - @Child(name="orderer", type={Practitioner.class}, order=0, min=0, max=1) - @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - protected Practitioner ordererTarget; - - /** - * Identifiers assigned to this order by the order sender or by the order receiver. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." ) - protected List identifier; - - /** - * An encounter that provides additional informaton about the healthcare context in which this request is made. - */ - @Child(name="encounter", type={Encounter.class}, order=2, min=0, max=1) - @Description(shortDefinition="The encounter associated with that this nutrition order", formalDefinition="An encounter that provides additional informaton about the healthcare context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional informaton about the healthcare context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * The date and time that this nutrition order was requested. - */ - @Child(name="dateTime", type={DateTimeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." ) - protected DateTimeType dateTime; - - /** - * The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order. - */ - @Child(name="allergyIntolerance", type={AllergyIntolerance.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order." ) - protected List allergyIntolerance; - /** - * The actual objects that are the target of the reference (The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) - */ - protected List allergyIntoleranceTarget; - - - /** - * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. - */ - @Child(name="foodPreferenceModifier", type={CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) - protected List foodPreferenceModifier; - - /** - * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. - */ - @Child(name="excludeFoodModifier", type={CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) - protected List excludeFoodModifier; - - /** - * Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order. - */ - @Child(name="item", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Set of nutrition items or components that comprise the nutrition order", formalDefinition="Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order." ) - protected List item; - - /** - * The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. - */ - @Child(name="status", type={CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="requested | active | inactive | held | cancelled", formalDefinition="The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended." ) - protected Enumeration status; - - private static final long serialVersionUID = 1266509935L; - - public NutritionOrder() { - super(); - } - - public NutritionOrder(Reference subject, DateTimeType dateTime) { - super(); - this.subject = subject; - this.dateTime = dateTime; - } - - /** - * @return {@link #subject} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public NutritionOrder 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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public NutritionOrder setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public NutritionOrder setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} 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 practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public Practitioner getOrdererTarget() { - if (this.ordererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.ordererTarget = new Practitioner(); - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} 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 that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public NutritionOrder setOrdererTarget(Practitioner value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this order by the order sender or by the order receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #encounter} (An encounter that provides additional informaton about the healthcare context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.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} (An encounter that provides additional informaton about the healthcare context in which this request is made.) - */ - public NutritionOrder 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. (An encounter that provides additional informaton about the healthcare context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.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. (An encounter that provides additional informaton about the healthcare context in which this request is made.) - */ - public NutritionOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public NutritionOrder setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date and time that this nutrition order was requested. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date and time that this nutrition order was requested. - */ - public NutritionOrder setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #allergyIntolerance} (The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) - */ - public List getAllergyIntolerance() { - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - return this.allergyIntolerance; - } - - public boolean hasAllergyIntolerance() { - if (this.allergyIntolerance == null) - return false; - for (Reference item : this.allergyIntolerance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #allergyIntolerance} (The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) - */ - // syntactic sugar - public Reference addAllergyIntolerance() { //3 - Reference t = new Reference(); - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - this.allergyIntolerance.add(t); - return t; - } - - /** - * @return {@link #allergyIntolerance} (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 ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) - */ - public List getAllergyIntoleranceTarget() { - if (this.allergyIntoleranceTarget == null) - this.allergyIntoleranceTarget = new ArrayList(); - return this.allergyIntoleranceTarget; - } - - // syntactic sugar - /** - * @return {@link #allergyIntolerance} (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 ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) - */ - public AllergyIntolerance addAllergyIntoleranceTarget() { - AllergyIntolerance r = new AllergyIntolerance(); - if (this.allergyIntoleranceTarget == null) - this.allergyIntoleranceTarget = new ArrayList(); - this.allergyIntoleranceTarget.add(r); - return r; - } - - /** - * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - public List getFoodPreferenceModifier() { - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - return this.foodPreferenceModifier; - } - - public boolean hasFoodPreferenceModifier() { - if (this.foodPreferenceModifier == null) - return false; - for (CodeableConcept item : this.foodPreferenceModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - // syntactic sugar - public CodeableConcept addFoodPreferenceModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - this.foodPreferenceModifier.add(t); - return t; - } - - /** - * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - public List getExcludeFoodModifier() { - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - return this.excludeFoodModifier; - } - - public boolean hasExcludeFoodModifier() { - if (this.excludeFoodModifier == null) - return false; - for (CodeableConcept item : this.excludeFoodModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - // syntactic sugar - public CodeableConcept addExcludeFoodModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - this.excludeFoodModifier.add(t); - return t; - } - - /** - * @return {@link #item} (Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (NutritionOrderItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order.) - */ - // syntactic sugar - public NutritionOrderItemComponent addItem() { //3 - NutritionOrderItemComponent t = new NutritionOrderItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #status} (The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public NutritionOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. - */ - public NutritionOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. - */ - public NutritionOrder setStatus(NutritionOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(NutritionOrderStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("subject", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional informaton about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance)); - childrenList.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier)); - childrenList.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier)); - childrenList.add(new Property("item", "", "Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("status", "code", "The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - public NutritionOrder copy() { - NutritionOrder dst = new NutritionOrder(); - copyValues(dst); - dst.subject = subject == null ? null : subject.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - if (allergyIntolerance != null) { - dst.allergyIntolerance = new ArrayList(); - for (Reference i : allergyIntolerance) - dst.allergyIntolerance.add(i.copy()); - }; - if (foodPreferenceModifier != null) { - dst.foodPreferenceModifier = new ArrayList(); - for (CodeableConcept i : foodPreferenceModifier) - dst.foodPreferenceModifier.add(i.copy()); - }; - if (excludeFoodModifier != null) { - dst.excludeFoodModifier = new ArrayList(); - for (CodeableConcept i : excludeFoodModifier) - dst.excludeFoodModifier.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (NutritionOrderItemComponent i : item) - dst.item.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - return dst; - } - - protected NutritionOrder typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (subject == null || subject.isEmpty()) && (orderer == null || orderer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (dateTime == null || dateTime.isEmpty()) && (allergyIntolerance == null || allergyIntolerance.isEmpty()) - && (foodPreferenceModifier == null || foodPreferenceModifier.isEmpty()) && (excludeFoodModifier == null || excludeFoodModifier.isEmpty()) - && (item == null || item.isEmpty()) && (status == null || status.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.NutritionOrder; - } - - @SearchParamDefinition(name="patient", path="NutritionOrder.subject", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="NutritionOrder.status", description="Status of the nutrition order.", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="NutritionOrder.subject", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="supplement", path="NutritionOrder.item.supplement.type", description="Type of supplement product requested", type="token" ) - public static final String SP_SUPPLEMENT = "supplement"; - @SearchParamDefinition(name="oraldiet", path="NutritionOrder.item.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" ) - public static final String SP_ORALDIET = "oraldiet"; - @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference" ) - public static final String SP_PROVIDER = "provider"; - @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identity", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" ) - public static final String SP_DATETIME = "datetime"; - @SearchParamDefinition(name="additive", path="NutritionOrder.item.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" ) - public static final String SP_ADDITIVE = "additive"; - @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="formula", path="NutritionOrder.item.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" ) - public static final String SP_FORMULA = "formula"; - -} - + +/* + 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; +/** + * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + */ +@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") +public class NutritionOrder extends DomainResource { + + public enum NutritionOrderStatus implements FhirEnum { + /** + * TODO. + */ + REQUESTED, + /** + * TODO. + */ + ACTIVE, + /** + * TODO. + */ + INACTIVE, + /** + * TODO. + */ + HELD, + /** + * TODO. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + public static final NutritionOrderStatusEnumFactory ENUM_FACTORY = new NutritionOrderStatusEnumFactory(); + + public static NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("inactive".equals(codeString)) + return INACTIVE; + if ("held".equals(codeString)) + return HELD; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case INACTIVE: return "inactive"; + case HELD: return "held"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case ACTIVE: return ""; + case INACTIVE: return ""; + case HELD: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "TODO."; + case ACTIVE: return "TODO."; + case INACTIVE: return "TODO."; + case HELD: return "TODO."; + case CANCELLED: return "TODO."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case ACTIVE: return "Active"; + case INACTIVE: return "Inactive"; + case HELD: return "Held"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class NutritionOrderStatusEnumFactory implements EnumFactory { + public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return NutritionOrderStatus.REQUESTED; + if ("active".equals(codeString)) + return NutritionOrderStatus.ACTIVE; + if ("inactive".equals(codeString)) + return NutritionOrderStatus.INACTIVE; + if ("held".equals(codeString)) + return NutritionOrderStatus.HELD; + if ("cancelled".equals(codeString)) + return NutritionOrderStatus.CANCELLED; + throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); + } + public String toCode(NutritionOrderStatus code) throws IllegalArgumentException { + if (code == NutritionOrderStatus.REQUESTED) + return "requested"; + if (code == NutritionOrderStatus.ACTIVE) + return "active"; + if (code == NutritionOrderStatus.INACTIVE) + return "inactive"; + if (code == NutritionOrderStatus.HELD) + return "held"; + if (code == NutritionOrderStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + @Block() + public static class NutritionOrderItemComponent extends BackboneElement { + /** + * The frequency at which the diet, oral supplement or enteral formula should be given. + */ + @Child(name="scheduled", type={Timing.class, Period.class}, order=1, min=0, max=1) + @Description(shortDefinition="Frequency to offer nutrition item", formalDefinition="The frequency at which the diet, oral supplement or enteral formula should be given." ) + protected Type scheduled; + + /** + * Indicates whether the nutrition item is currently in effect for the patient. + */ + @Child(name="isInEffect", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Indicates whether the nutrition item is currently in effect", formalDefinition="Indicates whether the nutrition item is currently in effect for the patient." ) + protected BooleanType isInEffect; + + /** + * Class that defines the components of an oral diet order for the patient. + */ + @Child(name="oralDiet", type={}, order=3, min=0, max=1) + @Description(shortDefinition="Oral diet components", formalDefinition="Class that defines the components of an oral diet order for the patient." ) + protected NutritionOrderItemOralDietComponent oralDiet; + + /** + * Class that defines the components of a supplement order for the patient. + */ + @Child(name="supplement", type={}, order=4, min=0, max=1) + @Description(shortDefinition="Supplement components", formalDefinition="Class that defines the components of a supplement order for the patient." ) + protected NutritionOrderItemSupplementComponent supplement; + + /** + * Class that defines the components of an enteral formula order for the patient. + */ + @Child(name="enteralFormula", type={}, order=5, min=0, max=1) + @Description(shortDefinition="Enteral formula components", formalDefinition="Class that defines the components of an enteral formula order for the patient." ) + protected NutritionOrderItemEnteralFormulaComponent enteralFormula; + + private static final long serialVersionUID = 2064921337L; + + public NutritionOrderItemComponent() { + super(); + } + + public NutritionOrderItemComponent(BooleanType isInEffect) { + super(); + this.isInEffect = isInEffect; + } + + /** + * @return {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + /** + * @return {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The frequency at which the diet, oral supplement or enteral formula should be given.) + */ + public NutritionOrderItemComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #isInEffect} (Indicates whether the nutrition item is currently in effect for the patient.). This is the underlying object with id, value and extensions. The accessor "getIsInEffect" gives direct access to the value + */ + public BooleanType getIsInEffectElement() { + if (this.isInEffect == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemComponent.isInEffect"); + else if (Configuration.doAutoCreate()) + this.isInEffect = new BooleanType(); + return this.isInEffect; + } + + public boolean hasIsInEffectElement() { + return this.isInEffect != null && !this.isInEffect.isEmpty(); + } + + public boolean hasIsInEffect() { + return this.isInEffect != null && !this.isInEffect.isEmpty(); + } + + /** + * @param value {@link #isInEffect} (Indicates whether the nutrition item is currently in effect for the patient.). This is the underlying object with id, value and extensions. The accessor "getIsInEffect" gives direct access to the value + */ + public NutritionOrderItemComponent setIsInEffectElement(BooleanType value) { + this.isInEffect = value; + return this; + } + + /** + * @return Indicates whether the nutrition item is currently in effect for the patient. + */ + public boolean getIsInEffect() { + return this.isInEffect == null ? false : this.isInEffect.getValue(); + } + + /** + * @param value Indicates whether the nutrition item is currently in effect for the patient. + */ + public NutritionOrderItemComponent setIsInEffect(boolean value) { + if (this.isInEffect == null) + this.isInEffect = new BooleanType(); + this.isInEffect.setValue(value); + return this; + } + + /** + * @return {@link #oralDiet} (Class that defines the components of an oral diet order for the patient.) + */ + public NutritionOrderItemOralDietComponent getOralDiet() { + if (this.oralDiet == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemComponent.oralDiet"); + else if (Configuration.doAutoCreate()) + this.oralDiet = new NutritionOrderItemOralDietComponent(); + return this.oralDiet; + } + + public boolean hasOralDiet() { + return this.oralDiet != null && !this.oralDiet.isEmpty(); + } + + /** + * @param value {@link #oralDiet} (Class that defines the components of an oral diet order for the patient.) + */ + public NutritionOrderItemComponent setOralDiet(NutritionOrderItemOralDietComponent value) { + this.oralDiet = value; + return this; + } + + /** + * @return {@link #supplement} (Class that defines the components of a supplement order for the patient.) + */ + public NutritionOrderItemSupplementComponent getSupplement() { + if (this.supplement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemComponent.supplement"); + else if (Configuration.doAutoCreate()) + this.supplement = new NutritionOrderItemSupplementComponent(); + return this.supplement; + } + + public boolean hasSupplement() { + return this.supplement != null && !this.supplement.isEmpty(); + } + + /** + * @param value {@link #supplement} (Class that defines the components of a supplement order for the patient.) + */ + public NutritionOrderItemComponent setSupplement(NutritionOrderItemSupplementComponent value) { + this.supplement = value; + return this; + } + + /** + * @return {@link #enteralFormula} (Class that defines the components of an enteral formula order for the patient.) + */ + public NutritionOrderItemEnteralFormulaComponent getEnteralFormula() { + if (this.enteralFormula == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemComponent.enteralFormula"); + else if (Configuration.doAutoCreate()) + this.enteralFormula = new NutritionOrderItemEnteralFormulaComponent(); + return this.enteralFormula; + } + + public boolean hasEnteralFormula() { + return this.enteralFormula != null && !this.enteralFormula.isEmpty(); + } + + /** + * @param value {@link #enteralFormula} (Class that defines the components of an enteral formula order for the patient.) + */ + public NutritionOrderItemComponent setEnteralFormula(NutritionOrderItemEnteralFormulaComponent value) { + this.enteralFormula = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("scheduled[x]", "Timing|Period", "The frequency at which the diet, oral supplement or enteral formula should be given.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("isInEffect", "boolean", "Indicates whether the nutrition item is currently in effect for the patient.", 0, java.lang.Integer.MAX_VALUE, isInEffect)); + childrenList.add(new Property("oralDiet", "", "Class that defines the components of an oral diet order for the patient.", 0, java.lang.Integer.MAX_VALUE, oralDiet)); + childrenList.add(new Property("supplement", "", "Class that defines the components of a supplement order for the patient.", 0, java.lang.Integer.MAX_VALUE, supplement)); + childrenList.add(new Property("enteralFormula", "", "Class that defines the components of an enteral formula order for the patient.", 0, java.lang.Integer.MAX_VALUE, enteralFormula)); + } + + public NutritionOrderItemComponent copy() { + NutritionOrderItemComponent dst = new NutritionOrderItemComponent(); + copyValues(dst); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.isInEffect = isInEffect == null ? null : isInEffect.copy(); + dst.oralDiet = oralDiet == null ? null : oralDiet.copy(); + dst.supplement = supplement == null ? null : supplement.copy(); + dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (scheduled == null || scheduled.isEmpty()) && (isInEffect == null || isInEffect.isEmpty()) + && (oralDiet == null || oralDiet.isEmpty()) && (supplement == null || supplement.isEmpty()) + && (enteralFormula == null || enteralFormula.isEmpty()); + } + + } + + @Block() + public static class NutritionOrderItemOralDietComponent extends BackboneElement { + /** + * Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth). + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth)." ) + protected List type; + + /** + * Class that defines the details of any nutrient modifications required for the oral diet. + */ + @Child(name="nutrients", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Required nutrient modifications", formalDefinition="Class that defines the details of any nutrient modifications required for the oral diet." ) + protected List nutrients; + + /** + * Class that describes any texture modifications required for the patient to safely consume various types of solid foods. + */ + @Child(name="texture", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Required texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." ) + protected List texture; + + /** + * Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. + */ + @Child(name="fluidConsistencyType", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." ) + protected List fluidConsistencyType; + + /** + * Additional instructions or information pertaining to the oral diet. + */ + @Child(name="instruction", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Additional instructions or information pertaining to the oral diet." ) + protected StringType instruction; + + private static final long serialVersionUID = 1978112477L; + + public NutritionOrderItemOralDietComponent() { + super(); + } + + /** + * @return {@link #type} (Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeableConcept item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).) + */ + // syntactic sugar + public CodeableConcept addType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @return {@link #nutrients} (Class that defines the details of any nutrient modifications required for the oral diet.) + */ + public List getNutrients() { + if (this.nutrients == null) + this.nutrients = new ArrayList(); + return this.nutrients; + } + + public boolean hasNutrients() { + if (this.nutrients == null) + return false; + for (NutritionOrderItemOralDietNutrientsComponent item : this.nutrients) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #nutrients} (Class that defines the details of any nutrient modifications required for the oral diet.) + */ + // syntactic sugar + public NutritionOrderItemOralDietNutrientsComponent addNutrients() { //3 + NutritionOrderItemOralDietNutrientsComponent t = new NutritionOrderItemOralDietNutrientsComponent(); + if (this.nutrients == null) + this.nutrients = new ArrayList(); + this.nutrients.add(t); + return t; + } + + /** + * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) + */ + public List getTexture() { + if (this.texture == null) + this.texture = new ArrayList(); + return this.texture; + } + + public boolean hasTexture() { + if (this.texture == null) + return false; + for (NutritionOrderItemOralDietTextureComponent item : this.texture) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) + */ + // syntactic sugar + public NutritionOrderItemOralDietTextureComponent addTexture() { //3 + NutritionOrderItemOralDietTextureComponent t = new NutritionOrderItemOralDietTextureComponent(); + if (this.texture == null) + this.texture = new ArrayList(); + this.texture.add(t); + return t; + } + + /** + * @return {@link #fluidConsistencyType} (Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) + */ + public List getFluidConsistencyType() { + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + return this.fluidConsistencyType; + } + + public boolean hasFluidConsistencyType() { + if (this.fluidConsistencyType == null) + return false; + for (CodeableConcept item : this.fluidConsistencyType) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fluidConsistencyType} (Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) + */ + // syntactic sugar + public CodeableConcept addFluidConsistencyType() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.fluidConsistencyType == null) + this.fluidConsistencyType = new ArrayList(); + this.fluidConsistencyType.add(t); + return t; + } + + /** + * @return {@link #instruction} (Additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public StringType getInstructionElement() { + if (this.instruction == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemOralDietComponent.instruction"); + else if (Configuration.doAutoCreate()) + this.instruction = new StringType(); + return this.instruction; + } + + public boolean hasInstructionElement() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + public boolean hasInstruction() { + return this.instruction != null && !this.instruction.isEmpty(); + } + + /** + * @param value {@link #instruction} (Additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value + */ + public NutritionOrderItemOralDietComponent setInstructionElement(StringType value) { + this.instruction = value; + return this; + } + + /** + * @return Additional instructions or information pertaining to the oral diet. + */ + public String getInstruction() { + return this.instruction == null ? null : this.instruction.getValue(); + } + + /** + * @param value Additional instructions or information pertaining to the oral diet. + */ + public NutritionOrderItemOralDietComponent setInstruction(String value) { + if (Utilities.noString(value)) + this.instruction = null; + else { + if (this.instruction == null) + this.instruction = new StringType(); + this.instruction.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("nutrients", "", "Class that defines the details of any nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrients)); + childrenList.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture)); + childrenList.add(new Property("fluidConsistencyType", "CodeableConcept", "Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType)); + childrenList.add(new Property("instruction", "string", "Additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); + } + + public NutritionOrderItemOralDietComponent copy() { + NutritionOrderItemOralDietComponent dst = new NutritionOrderItemOralDietComponent(); + copyValues(dst); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); + }; + if (nutrients != null) { + dst.nutrients = new ArrayList(); + for (NutritionOrderItemOralDietNutrientsComponent i : nutrients) + dst.nutrients.add(i.copy()); + }; + if (texture != null) { + dst.texture = new ArrayList(); + for (NutritionOrderItemOralDietTextureComponent i : texture) + dst.texture.add(i.copy()); + }; + if (fluidConsistencyType != null) { + dst.fluidConsistencyType = new ArrayList(); + for (CodeableConcept i : fluidConsistencyType) + dst.fluidConsistencyType.add(i.copy()); + }; + dst.instruction = instruction == null ? null : instruction.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (nutrients == null || nutrients.isEmpty()) + && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) + && (instruction == null || instruction.isEmpty()); + } + + } + + @Block() + public static class NutritionOrderItemOralDietNutrientsComponent extends BackboneElement { + /** + * Identifies the type of nutrient that is being modified such as cabohydrate or sodium. + */ + @Child(name="modifier", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="Identifies the type of nutrient that is being modified such as cabohydrate or sodium." ) + protected CodeableConcept modifier; + + /** + * The quantity or range of the specified nutrient to supply. + */ + @Child(name="amount", type={Quantity.class, Range.class}, order=2, min=0, max=1) + @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity or range of the specified nutrient to supply." ) + protected Type amount; + + private static final long serialVersionUID = -1359777156L; + + public NutritionOrderItemOralDietNutrientsComponent() { + super(); + } + + /** + * @return {@link #modifier} (Identifies the type of nutrient that is being modified such as cabohydrate or sodium.) + */ + public CodeableConcept getModifier() { + if (this.modifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemOralDietNutrientsComponent.modifier"); + else if (Configuration.doAutoCreate()) + this.modifier = new CodeableConcept(); + return this.modifier; + } + + public boolean hasModifier() { + return this.modifier != null && !this.modifier.isEmpty(); + } + + /** + * @param value {@link #modifier} (Identifies the type of nutrient that is being modified such as cabohydrate or sodium.) + */ + public NutritionOrderItemOralDietNutrientsComponent setModifier(CodeableConcept value) { + this.modifier = value; + return this; + } + + /** + * @return {@link #amount} (The quantity or range of the specified nutrient to supply.) + */ + public Type getAmount() { + return this.amount; + } + + /** + * @return {@link #amount} (The quantity or range of the specified nutrient to supply.) + */ + public Quantity getAmountQuantity() throws Exception { + if (!(this.amount instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.amount.getClass().getName()+" was encountered"); + return (Quantity) this.amount; + } + + /** + * @return {@link #amount} (The quantity or range of the specified nutrient to supply.) + */ + public Range getAmountRange() throws Exception { + if (!(this.amount instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.amount.getClass().getName()+" was encountered"); + return (Range) this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (The quantity or range of the specified nutrient to supply.) + */ + public NutritionOrderItemOralDietNutrientsComponent setAmount(Type value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("modifier", "CodeableConcept", "Identifies the type of nutrient that is being modified such as cabohydrate or sodium.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("amount[x]", "Quantity|Range", "The quantity or range of the specified nutrient to supply.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public NutritionOrderItemOralDietNutrientsComponent copy() { + NutritionOrderItemOralDietNutrientsComponent dst = new NutritionOrderItemOralDietNutrientsComponent(); + copyValues(dst); + dst.modifier = modifier == null ? null : modifier.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + @Block() + public static class NutritionOrderItemOralDietTextureComponent extends BackboneElement { + /** + * Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed. + */ + @Child(name="modifier", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g., pureed", formalDefinition="Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed." ) + protected CodeableConcept modifier; + + /** + * Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet. + */ + @Child(name="foodType", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet." ) + protected CodeableConcept foodType; + + private static final long serialVersionUID = -56402817L; + + public NutritionOrderItemOralDietTextureComponent() { + super(); + } + + /** + * @return {@link #modifier} (Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed.) + */ + public CodeableConcept getModifier() { + if (this.modifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemOralDietTextureComponent.modifier"); + else if (Configuration.doAutoCreate()) + this.modifier = new CodeableConcept(); + return this.modifier; + } + + public boolean hasModifier() { + return this.modifier != null && !this.modifier.isEmpty(); + } + + /** + * @param value {@link #modifier} (Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed.) + */ + public NutritionOrderItemOralDietTextureComponent setModifier(CodeableConcept value) { + this.modifier = value; + return this; + } + + /** + * @return {@link #foodType} (Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.) + */ + public CodeableConcept getFoodType() { + if (this.foodType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemOralDietTextureComponent.foodType"); + else if (Configuration.doAutoCreate()) + this.foodType = new CodeableConcept(); + return this.foodType; + } + + public boolean hasFoodType() { + return this.foodType != null && !this.foodType.isEmpty(); + } + + /** + * @param value {@link #foodType} (Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.) + */ + public NutritionOrderItemOralDietTextureComponent setFoodType(CodeableConcept value) { + this.foodType = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("modifier", "CodeableConcept", "Identifies any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, pureed.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("foodType", "CodeableConcept", "Indicates what specific type of food (e.g., meats) the texture modification applies to or may apply to all foods in the diet.", 0, java.lang.Integer.MAX_VALUE, foodType)); + } + + public NutritionOrderItemOralDietTextureComponent copy() { + NutritionOrderItemOralDietTextureComponent dst = new NutritionOrderItemOralDietTextureComponent(); + copyValues(dst); + dst.modifier = modifier == null ? null : modifier.copy(); + dst.foodType = foodType == null ? null : foodType.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (foodType == null || foodType.isEmpty()) + ; + } + + } + + @Block() + public static class NutritionOrderItemSupplementComponent extends BackboneElement { + /** + * Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of supplement product requested", formalDefinition="Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement." ) + protected CodeableConcept type; + + /** + * The amount of the nutritional supplement product to provide to the patient. + */ + @Child(name="quantity", type={Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement product to provide to the patient." ) + protected Quantity quantity; + + /** + * The product or brand name of the nutritional supplement product to be provided to the patient. + */ + @Child(name="name", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement product to be provided to the patient." ) + protected StringType name; + + private static final long serialVersionUID = 505308801L; + + public NutritionOrderItemSupplementComponent() { + super(); + } + + /** + * @return {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) + */ + public NutritionOrderItemSupplementComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of the nutritional supplement product to provide to the patient.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the nutritional supplement product to provide to the patient.) + */ + public NutritionOrderItemSupplementComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #name} (The product or brand name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 product or brand name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public NutritionOrderItemSupplementComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The product or brand name of the nutritional supplement product to be provided to the patient. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The product or brand name of the nutritional supplement product to be provided to the patient. + */ + public NutritionOrderItemSupplementComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "Quantity", "The amount of the nutritional supplement product to provide to the patient.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("name", "string", "The product or brand name of the nutritional supplement product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, name)); + } + + public NutritionOrderItemSupplementComponent copy() { + NutritionOrderItemSupplementComponent dst = new NutritionOrderItemSupplementComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.name = name == null ? null : name.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (name == null || name.isEmpty()); + } + + } + + @Block() + public static class NutritionOrderItemEnteralFormulaComponent extends BackboneElement { + /** + * Free text formula administration or feeding instructions for cases where the instructions are too complex to code. + */ + @Child(name="administrationInstructions", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration or feeding instructions for cases where the instructions are too complex to code." ) + protected StringType administrationInstructions; + + /** + * Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula. + */ + @Child(name="baseFormulaType", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula." ) + protected CodeableConcept baseFormulaType; + + /** + * The product or brand name of the enteral or infant formula product to be provided to the patient. + */ + @Child(name="baseFormulaName", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product to be provided to the patient." ) + protected StringType baseFormulaName; + + /** + * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. + */ + @Child(name="additiveType", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." ) + protected CodeableConcept additiveType; + + /** + * The product or brand name of the type of modular component to be added to the formula. + */ + @Child(name="additiveName", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." ) + protected StringType additiveName; + + /** + * The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. + */ + @Child(name="caloricDensity", type={Quantity.class}, order=6, min=0, max=1) + @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) + protected Quantity caloricDensity; + + /** + * A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube. + */ + @Child(name="routeofAdministration", type={CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube." ) + protected CodeableConcept routeofAdministration; + + /** + * The volume of formula to provide to the patient per the specified administration schedule. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule. + */ + @Child(name="rate", type={Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule." ) + protected Ratio rate; + + /** + * The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours. + */ + @Child(name="rateAdjustment", type={Quantity.class}, order=10, min=0, max=1) + @Description(shortDefinition="Change in the rate of administration over a given time", formalDefinition="The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours." ) + protected Quantity rateAdjustment; + + /** + * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours. + */ + @Child(name="maxVolumeToDeliver", type={Quantity.class}, order=11, min=0, max=1) + @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours." ) + protected Quantity maxVolumeToDeliver; + + private static final long serialVersionUID = 1106347909L; + + public NutritionOrderItemEnteralFormulaComponent() { + super(); + } + + /** + * @return {@link #administrationInstructions} (Free text formula administration or feeding instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value + */ + public StringType getAdministrationInstructionsElement() { + if (this.administrationInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.administrationInstructions"); + else if (Configuration.doAutoCreate()) + this.administrationInstructions = new StringType(); + return this.administrationInstructions; + } + + public boolean hasAdministrationInstructionsElement() { + return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); + } + + public boolean hasAdministrationInstructions() { + return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); + } + + /** + * @param value {@link #administrationInstructions} (Free text formula administration or feeding instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value + */ + public NutritionOrderItemEnteralFormulaComponent setAdministrationInstructionsElement(StringType value) { + this.administrationInstructions = value; + return this; + } + + /** + * @return Free text formula administration or feeding instructions for cases where the instructions are too complex to code. + */ + public String getAdministrationInstructions() { + return this.administrationInstructions == null ? null : this.administrationInstructions.getValue(); + } + + /** + * @param value Free text formula administration or feeding instructions for cases where the instructions are too complex to code. + */ + public NutritionOrderItemEnteralFormulaComponent setAdministrationInstructions(String value) { + if (Utilities.noString(value)) + this.administrationInstructions = null; + else { + if (this.administrationInstructions == null) + this.administrationInstructions = new StringType(); + this.administrationInstructions.setValue(value); + } + return this; + } + + /** + * @return {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.) + */ + public CodeableConcept getBaseFormulaType() { + if (this.baseFormulaType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.baseFormulaType"); + else if (Configuration.doAutoCreate()) + this.baseFormulaType = new CodeableConcept(); + return this.baseFormulaType; + } + + public boolean hasBaseFormulaType() { + return this.baseFormulaType != null && !this.baseFormulaType.isEmpty(); + } + + /** + * @param value {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.) + */ + public NutritionOrderItemEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { + this.baseFormulaType = value; + return this; + } + + /** + * @return {@link #baseFormulaName} (The product or brand name of the enteral or infant formula product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value + */ + public StringType getBaseFormulaNameElement() { + if (this.baseFormulaName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.baseFormulaName"); + else if (Configuration.doAutoCreate()) + this.baseFormulaName = new StringType(); + return this.baseFormulaName; + } + + public boolean hasBaseFormulaNameElement() { + return this.baseFormulaName != null && !this.baseFormulaName.isEmpty(); + } + + public boolean hasBaseFormulaName() { + return this.baseFormulaName != null && !this.baseFormulaName.isEmpty(); + } + + /** + * @param value {@link #baseFormulaName} (The product or brand name of the enteral or infant formula product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value + */ + public NutritionOrderItemEnteralFormulaComponent setBaseFormulaNameElement(StringType value) { + this.baseFormulaName = value; + return this; + } + + /** + * @return The product or brand name of the enteral or infant formula product to be provided to the patient. + */ + public String getBaseFormulaName() { + return this.baseFormulaName == null ? null : this.baseFormulaName.getValue(); + } + + /** + * @param value The product or brand name of the enteral or infant formula product to be provided to the patient. + */ + public NutritionOrderItemEnteralFormulaComponent setBaseFormulaName(String value) { + if (Utilities.noString(value)) + this.baseFormulaName = null; + else { + if (this.baseFormulaName == null) + this.baseFormulaName = new StringType(); + this.baseFormulaName.setValue(value); + } + return this; + } + + /** + * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) + */ + public CodeableConcept getAdditiveType() { + if (this.additiveType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.additiveType"); + else if (Configuration.doAutoCreate()) + this.additiveType = new CodeableConcept(); + return this.additiveType; + } + + public boolean hasAdditiveType() { + return this.additiveType != null && !this.additiveType.isEmpty(); + } + + /** + * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) + */ + public NutritionOrderItemEnteralFormulaComponent setAdditiveType(CodeableConcept value) { + this.additiveType = value; + return this; + } + + /** + * @return {@link #additiveName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveName" gives direct access to the value + */ + public StringType getAdditiveNameElement() { + if (this.additiveName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.additiveName"); + else if (Configuration.doAutoCreate()) + this.additiveName = new StringType(); + return this.additiveName; + } + + public boolean hasAdditiveNameElement() { + return this.additiveName != null && !this.additiveName.isEmpty(); + } + + public boolean hasAdditiveName() { + return this.additiveName != null && !this.additiveName.isEmpty(); + } + + /** + * @param value {@link #additiveName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveName" gives direct access to the value + */ + public NutritionOrderItemEnteralFormulaComponent setAdditiveNameElement(StringType value) { + this.additiveName = value; + return this; + } + + /** + * @return The product or brand name of the type of modular component to be added to the formula. + */ + public String getAdditiveName() { + return this.additiveName == null ? null : this.additiveName.getValue(); + } + + /** + * @param value The product or brand name of the type of modular component to be added to the formula. + */ + public NutritionOrderItemEnteralFormulaComponent setAdditiveName(String value) { + if (Utilities.noString(value)) + this.additiveName = null; + else { + if (this.additiveName == null) + this.additiveName = new StringType(); + this.additiveName.setValue(value); + } + return this; + } + + /** + * @return {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public Quantity getCaloricDensity() { + if (this.caloricDensity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.caloricDensity"); + else if (Configuration.doAutoCreate()) + this.caloricDensity = new Quantity(); + return this.caloricDensity; + } + + public boolean hasCaloricDensity() { + return this.caloricDensity != null && !this.caloricDensity.isEmpty(); + } + + /** + * @param value {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public NutritionOrderItemEnteralFormulaComponent setCaloricDensity(Quantity value) { + this.caloricDensity = value; + return this; + } + + /** + * @return {@link #routeofAdministration} (A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) + */ + public CodeableConcept getRouteofAdministration() { + if (this.routeofAdministration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.routeofAdministration"); + else if (Configuration.doAutoCreate()) + this.routeofAdministration = new CodeableConcept(); + return this.routeofAdministration; + } + + public boolean hasRouteofAdministration() { + return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); + } + + /** + * @param value {@link #routeofAdministration} (A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) + */ + public NutritionOrderItemEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { + this.routeofAdministration = value; + return this; + } + + /** + * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public NutritionOrderItemEnteralFormulaComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public NutritionOrderItemEnteralFormulaComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #rateAdjustment} (The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.) + */ + public Quantity getRateAdjustment() { + if (this.rateAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.rateAdjustment"); + else if (Configuration.doAutoCreate()) + this.rateAdjustment = new Quantity(); + return this.rateAdjustment; + } + + public boolean hasRateAdjustment() { + return this.rateAdjustment != null && !this.rateAdjustment.isEmpty(); + } + + /** + * @param value {@link #rateAdjustment} (The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.) + */ + public NutritionOrderItemEnteralFormulaComponent setRateAdjustment(Quantity value) { + this.rateAdjustment = value; + return this; + } + + /** + * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) + */ + public Quantity getMaxVolumeToDeliver() { + if (this.maxVolumeToDeliver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.maxVolumeToDeliver"); + else if (Configuration.doAutoCreate()) + this.maxVolumeToDeliver = new Quantity(); + return this.maxVolumeToDeliver; + } + + public boolean hasMaxVolumeToDeliver() { + return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty(); + } + + /** + * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) + */ + public NutritionOrderItemEnteralFormulaComponent setMaxVolumeToDeliver(Quantity value) { + this.maxVolumeToDeliver = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("administrationInstructions", "string", "Free text formula administration or feeding instructions for cases where the instructions are too complex to code.", 0, java.lang.Integer.MAX_VALUE, administrationInstructions)); + childrenList.add(new Property("baseFormulaType", "CodeableConcept", "Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); + childrenList.add(new Property("baseFormulaName", "string", "The product or brand name of the enteral or infant formula product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, baseFormulaName)); + childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); + childrenList.add(new Property("additiveName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveName)); + childrenList.add(new Property("caloricDensity", "Quantity", "The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); + childrenList.add(new Property("routeofAdministration", "CodeableConcept", "A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); + childrenList.add(new Property("quantity", "Quantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("rateAdjustment", "Quantity", "The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.", 0, java.lang.Integer.MAX_VALUE, rateAdjustment)); + childrenList.add(new Property("maxVolumeToDeliver", "Quantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxVolumeToDeliver)); + } + + public NutritionOrderItemEnteralFormulaComponent copy() { + NutritionOrderItemEnteralFormulaComponent dst = new NutritionOrderItemEnteralFormulaComponent(); + copyValues(dst); + dst.administrationInstructions = administrationInstructions == null ? null : administrationInstructions.copy(); + dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); + dst.baseFormulaName = baseFormulaName == null ? null : baseFormulaName.copy(); + dst.additiveType = additiveType == null ? null : additiveType.copy(); + dst.additiveName = additiveName == null ? null : additiveName.copy(); + dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); + dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.rateAdjustment = rateAdjustment == null ? null : rateAdjustment.copy(); + dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (administrationInstructions == null || administrationInstructions.isEmpty()) + && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaName == null || baseFormulaName.isEmpty()) + && (additiveType == null || additiveType.isEmpty()) && (additiveName == null || additiveName.isEmpty()) + && (caloricDensity == null || caloricDensity.isEmpty()) && (routeofAdministration == null || routeofAdministration.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (rateAdjustment == null || rateAdjustment.isEmpty()) + && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()); + } + + } + + /** + * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. + */ + @Child(name="subject", type={Patient.class}, order=-1, min=1, max=1) + @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + protected Patient subjectTarget; + + /** + * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. + */ + @Child(name="orderer", type={Practitioner.class}, order=0, min=0, max=1) + @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + protected Practitioner ordererTarget; + + /** + * Identifiers assigned to this order by the order sender or by the order receiver. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." ) + protected List identifier; + + /** + * An encounter that provides additional informaton about the healthcare context in which this request is made. + */ + @Child(name="encounter", type={Encounter.class}, order=2, min=0, max=1) + @Description(shortDefinition="The encounter associated with that this nutrition order", formalDefinition="An encounter that provides additional informaton about the healthcare context in which this request is made." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (An encounter that provides additional informaton about the healthcare context in which this request is made.) + */ + protected Encounter encounterTarget; + + /** + * The date and time that this nutrition order was requested. + */ + @Child(name="dateTime", type={DateTimeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." ) + protected DateTimeType dateTime; + + /** + * The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order. + */ + @Child(name="allergyIntolerance", type={AllergyIntolerance.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order." ) + protected List allergyIntolerance; + /** + * The actual objects that are the target of the reference (The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) + */ + protected List allergyIntoleranceTarget; + + + /** + * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + */ + @Child(name="foodPreferenceModifier", type={CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) + protected List foodPreferenceModifier; + + /** + * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + */ + @Child(name="excludeFoodModifier", type={CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) + protected List excludeFoodModifier; + + /** + * Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order. + */ + @Child(name="item", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Set of nutrition items or components that comprise the nutrition order", formalDefinition="Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order." ) + protected List item; + + /** + * The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. + */ + @Child(name="status", type={CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="requested | active | inactive | held | cancelled", formalDefinition="The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended." ) + protected Enumeration status; + + private static final long serialVersionUID = 1266509935L; + + public NutritionOrder() { + super(); + } + + public NutritionOrder(Reference subject, DateTimeType dateTime) { + super(); + this.subject = subject; + this.dateTime = dateTime; + } + + /** + * @return {@link #subject} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public NutritionOrder 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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.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 person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) + */ + public NutritionOrder setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public NutritionOrder setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} 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 practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public Practitioner getOrdererTarget() { + if (this.ordererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.orderer"); + else if (Configuration.doAutoCreate()) + this.ordererTarget = new Practitioner(); + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} 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 that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) + */ + public NutritionOrder setOrdererTarget(Practitioner value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this order by the order sender or by the order receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #encounter} (An encounter that provides additional informaton about the healthcare context in which this request is made.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.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} (An encounter that provides additional informaton about the healthcare context in which this request is made.) + */ + public NutritionOrder 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. (An encounter that provides additional informaton about the healthcare context in which this request is made.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.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. (An encounter that provides additional informaton about the healthcare context in which this request is made.) + */ + public NutritionOrder setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public NutritionOrder setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date and time that this nutrition order was requested. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date and time that this nutrition order was requested. + */ + public NutritionOrder setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #allergyIntolerance} (The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) + */ + public List getAllergyIntolerance() { + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + return this.allergyIntolerance; + } + + public boolean hasAllergyIntolerance() { + if (this.allergyIntolerance == null) + return false; + for (Reference item : this.allergyIntolerance) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #allergyIntolerance} (The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) + */ + // syntactic sugar + public Reference addAllergyIntolerance() { //3 + Reference t = new Reference(); + if (this.allergyIntolerance == null) + this.allergyIntolerance = new ArrayList(); + this.allergyIntolerance.add(t); + return t; + } + + /** + * @return {@link #allergyIntolerance} (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 ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) + */ + public List getAllergyIntoleranceTarget() { + if (this.allergyIntoleranceTarget == null) + this.allergyIntoleranceTarget = new ArrayList(); + return this.allergyIntoleranceTarget; + } + + // syntactic sugar + /** + * @return {@link #allergyIntolerance} (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 ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.) + */ + public AllergyIntolerance addAllergyIntoleranceTarget() { + AllergyIntolerance r = new AllergyIntolerance(); + if (this.allergyIntoleranceTarget == null) + this.allergyIntoleranceTarget = new ArrayList(); + this.allergyIntoleranceTarget.add(r); + return r; + } + + /** + * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + public List getFoodPreferenceModifier() { + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + return this.foodPreferenceModifier; + } + + public boolean hasFoodPreferenceModifier() { + if (this.foodPreferenceModifier == null) + return false; + for (CodeableConcept item : this.foodPreferenceModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + // syntactic sugar + public CodeableConcept addFoodPreferenceModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.foodPreferenceModifier == null) + this.foodPreferenceModifier = new ArrayList(); + this.foodPreferenceModifier.add(t); + return t; + } + + /** + * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + public List getExcludeFoodModifier() { + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + return this.excludeFoodModifier; + } + + public boolean hasExcludeFoodModifier() { + if (this.excludeFoodModifier == null) + return false; + for (CodeableConcept item : this.excludeFoodModifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) + */ + // syntactic sugar + public CodeableConcept addExcludeFoodModifier() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.excludeFoodModifier == null) + this.excludeFoodModifier = new ArrayList(); + this.excludeFoodModifier.add(t); + return t; + } + + /** + * @return {@link #item} (Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (NutritionOrderItemComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order.) + */ + // syntactic sugar + public NutritionOrderItemComponent addItem() { //3 + NutritionOrderItemComponent t = new NutritionOrderItemComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #status} (The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrder.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public NutritionOrder setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. + */ + public NutritionOrderStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. + */ + public NutritionOrder setStatus(NutritionOrderStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(NutritionOrderStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("subject", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional informaton about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "The ability to list substances that may cause allergies or intolerances which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance)); + childrenList.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier)); + childrenList.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier)); + childrenList.add(new Property("item", "", "Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("status", "code", "The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended.", 0, java.lang.Integer.MAX_VALUE, status)); + } + + public NutritionOrder copy() { + NutritionOrder dst = new NutritionOrder(); + copyValues(dst); + dst.subject = subject == null ? null : subject.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + if (allergyIntolerance != null) { + dst.allergyIntolerance = new ArrayList(); + for (Reference i : allergyIntolerance) + dst.allergyIntolerance.add(i.copy()); + }; + if (foodPreferenceModifier != null) { + dst.foodPreferenceModifier = new ArrayList(); + for (CodeableConcept i : foodPreferenceModifier) + dst.foodPreferenceModifier.add(i.copy()); + }; + if (excludeFoodModifier != null) { + dst.excludeFoodModifier = new ArrayList(); + for (CodeableConcept i : excludeFoodModifier) + dst.excludeFoodModifier.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (NutritionOrderItemComponent i : item) + dst.item.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + return dst; + } + + protected NutritionOrder typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (subject == null || subject.isEmpty()) && (orderer == null || orderer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (dateTime == null || dateTime.isEmpty()) && (allergyIntolerance == null || allergyIntolerance.isEmpty()) + && (foodPreferenceModifier == null || foodPreferenceModifier.isEmpty()) && (excludeFoodModifier == null || excludeFoodModifier.isEmpty()) + && (item == null || item.isEmpty()) && (status == null || status.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.NutritionOrder; + } + + @SearchParamDefinition(name="patient", path="NutritionOrder.subject", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="NutritionOrder.status", description="Status of the nutrition order.", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="NutritionOrder.subject", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="supplement", path="NutritionOrder.item.supplement.type", description="Type of supplement product requested", type="token" ) + public static final String SP_SUPPLEMENT = "supplement"; + @SearchParamDefinition(name="oraldiet", path="NutritionOrder.item.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" ) + public static final String SP_ORALDIET = "oraldiet"; + @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference" ) + public static final String SP_PROVIDER = "provider"; + @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identity", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" ) + public static final String SP_DATETIME = "datetime"; + @SearchParamDefinition(name="additive", path="NutritionOrder.item.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" ) + public static final String SP_ADDITIVE = "additive"; + @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identity", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="formula", path="NutritionOrder.item.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" ) + public static final String SP_FORMULA = "formula"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java index 045200cf3f1..105f8ebe46d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java @@ -20,1996 +20,1996 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Measurements and simple assertions made about a patient, device or other subject. - */ -@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") -public class Observation extends DomainResource { - - public enum DataAbsentReason implements FhirEnum { - /** - * The value is not known - */ - UNKNOWN, - /** - * The source human does not know the value - */ - ASKED, - /** - * There is reason to expect (from the workflow) that the value may become known - */ - TEMP, - /** - * The workflow didn't lead to this value being known - */ - NOTASKED, - /** - * The information is not available due to security, privacy or related reasons - */ - MASKED, - /** - * The source system wasn't capable of supporting this element - */ - UNSUPPORTED, - /** - * The content of the data is represented in the resource narrative - */ - ASTEXT, - /** - * Some system or workflow process error means that the information is not available - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return UNKNOWN; - if ("asked".equals(codeString)) - return ASKED; - if ("temp".equals(codeString)) - return TEMP; - if ("notasked".equals(codeString)) - return NOTASKED; - if ("masked".equals(codeString)) - return MASKED; - if ("unsupported".equals(codeString)) - return UNSUPPORTED; - if ("astext".equals(codeString)) - return ASTEXT; - if ("error".equals(codeString)) - return ERROR; - throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case UNKNOWN: return "unknown"; - case ASKED: return "asked"; - case TEMP: return "temp"; - case NOTASKED: return "notasked"; - case MASKED: return "masked"; - case UNSUPPORTED: return "unsupported"; - case ASTEXT: return "astext"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNKNOWN: return ""; - case ASKED: return ""; - case TEMP: return ""; - case NOTASKED: return ""; - case MASKED: return ""; - case UNSUPPORTED: return ""; - case ASTEXT: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNKNOWN: return "The value is not known"; - case ASKED: return "The source human does not know the value"; - case TEMP: return "There is reason to expect (from the workflow) that the value may become known"; - case NOTASKED: return "The workflow didn't lead to this value being known"; - case MASKED: return "The information is not available due to security, privacy or related reasons"; - case UNSUPPORTED: return "The source system wasn't capable of supporting this element"; - case ASTEXT: return "The content of the data is represented in the resource narrative"; - case ERROR: return "Some system or workflow process error means that the information is not available"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNKNOWN: return "unknown"; - case ASKED: return "asked"; - case TEMP: return "temp"; - case NOTASKED: return "notasked"; - case MASKED: return "masked"; - case UNSUPPORTED: return "unsupported"; - case ASTEXT: return "astext"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class DataAbsentReasonEnumFactory implements EnumFactory { - public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unknown".equals(codeString)) - return DataAbsentReason.UNKNOWN; - if ("asked".equals(codeString)) - return DataAbsentReason.ASKED; - if ("temp".equals(codeString)) - return DataAbsentReason.TEMP; - if ("notasked".equals(codeString)) - return DataAbsentReason.NOTASKED; - if ("masked".equals(codeString)) - return DataAbsentReason.MASKED; - if ("unsupported".equals(codeString)) - return DataAbsentReason.UNSUPPORTED; - if ("astext".equals(codeString)) - return DataAbsentReason.ASTEXT; - if ("error".equals(codeString)) - return DataAbsentReason.ERROR; - throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); - } - public String toCode(DataAbsentReason code) throws IllegalArgumentException { - if (code == DataAbsentReason.UNKNOWN) - return "unknown"; - if (code == DataAbsentReason.ASKED) - return "asked"; - if (code == DataAbsentReason.TEMP) - return "temp"; - if (code == DataAbsentReason.NOTASKED) - return "notasked"; - if (code == DataAbsentReason.MASKED) - return "masked"; - if (code == DataAbsentReason.UNSUPPORTED) - return "unsupported"; - if (code == DataAbsentReason.ASTEXT) - return "astext"; - if (code == DataAbsentReason.ERROR) - return "error"; - return "?"; - } - } - - public enum ObservationStatus implements FhirEnum { - /** - * The existence of the observation is registered, but there is no result yet available. - */ - REGISTERED, - /** - * This is an initial or interim observation: data may be incomplete or unverified. - */ - PRELIMINARY, - /** - * The observation is complete and verified by an authorized person. - */ - FINAL, - /** - * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. - */ - AMENDED, - /** - * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). - */ - CANCELLED, - /** - * The observation has been withdrawn following previous Final release. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - - 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)) - return REGISTERED; - if ("preliminary".equals(codeString)) - return PRELIMINARY; - if ("final".equals(codeString)) - return FINAL; - if ("amended".equals(codeString)) - return AMENDED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered in error".equals(codeString)) - return ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REGISTERED: return "registered"; - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case AMENDED: return "amended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REGISTERED: return ""; - case PRELIMINARY: return ""; - case FINAL: return ""; - case AMENDED: return ""; - case CANCELLED: return ""; - case ENTEREDINERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REGISTERED: return "The existence of the observation is registered, but there is no result yet available."; - case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified."; - case FINAL: return "The observation is complete and verified by an authorized person."; - case AMENDED: return "The observation has been modified subsequent to being Final, and is complete and verified by an authorized person."; - case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; - case ENTEREDINERROR: return "The observation has been withdrawn following previous Final release."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REGISTERED: return "Registered"; - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case AMENDED: return "amended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered in error"; - default: return "?"; - } - } - } - - public static class ObservationStatusEnumFactory implements EnumFactory { - public ObservationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return ObservationStatus.REGISTERED; - if ("preliminary".equals(codeString)) - return ObservationStatus.PRELIMINARY; - if ("final".equals(codeString)) - return ObservationStatus.FINAL; - if ("amended".equals(codeString)) - return ObservationStatus.AMENDED; - if ("cancelled".equals(codeString)) - return ObservationStatus.CANCELLED; - if ("entered in error".equals(codeString)) - return ObservationStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); - } - public String toCode(ObservationStatus code) throws IllegalArgumentException { - if (code == ObservationStatus.REGISTERED) - return "registered"; - if (code == ObservationStatus.PRELIMINARY) - return "preliminary"; - if (code == ObservationStatus.FINAL) - return "final"; - if (code == ObservationStatus.AMENDED) - return "amended"; - if (code == ObservationStatus.CANCELLED) - return "cancelled"; - if (code == ObservationStatus.ENTEREDINERROR) - return "entered in error"; - return "?"; - } - } - - public enum ObservationReliability implements FhirEnum { - /** - * The result has no reliability concerns. - */ - OK, - /** - * An early estimate of value; measurement is still occurring. - */ - ONGOING, - /** - * An early estimate of value; processing is still occurring. - */ - EARLY, - /** - * The observation value should be treated with care. - */ - QUESTIONABLE, - /** - * The result has been generated while calibration is occurring. - */ - CALIBRATING, - /** - * The observation could not be completed because of an error. - */ - ERROR, - /** - * No observation reliability value was available. - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - - 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)) - return OK; - if ("ongoing".equals(codeString)) - return ONGOING; - if ("early".equals(codeString)) - return EARLY; - if ("questionable".equals(codeString)) - return QUESTIONABLE; - if ("calibrating".equals(codeString)) - return CALIBRATING; - if ("error".equals(codeString)) - return ERROR; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case OK: return "ok"; - case ONGOING: return "ongoing"; - case EARLY: return "early"; - case QUESTIONABLE: return "questionable"; - case CALIBRATING: return "calibrating"; - case ERROR: return "error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OK: return ""; - case ONGOING: return ""; - case EARLY: return ""; - case QUESTIONABLE: return ""; - case CALIBRATING: return ""; - case ERROR: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OK: return "The result has no reliability concerns."; - case ONGOING: return "An early estimate of value; measurement is still occurring."; - case EARLY: return "An early estimate of value; processing is still occurring."; - case QUESTIONABLE: return "The observation value should be treated with care."; - case CALIBRATING: return "The result has been generated while calibration is occurring."; - case ERROR: return "The observation could not be completed because of an error."; - case UNKNOWN: return "No observation reliability value was available."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OK: return "ok"; - case ONGOING: return "ongoing"; - case EARLY: return "early"; - case QUESTIONABLE: return "questionable"; - case CALIBRATING: return "calibrating"; - case ERROR: return "error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - } - - public static class ObservationReliabilityEnumFactory implements EnumFactory { - public ObservationReliability fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return ObservationReliability.OK; - if ("ongoing".equals(codeString)) - return ObservationReliability.ONGOING; - if ("early".equals(codeString)) - return ObservationReliability.EARLY; - if ("questionable".equals(codeString)) - return ObservationReliability.QUESTIONABLE; - if ("calibrating".equals(codeString)) - return ObservationReliability.CALIBRATING; - if ("error".equals(codeString)) - return ObservationReliability.ERROR; - if ("unknown".equals(codeString)) - return ObservationReliability.UNKNOWN; - throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); - } - public String toCode(ObservationReliability code) throws IllegalArgumentException { - if (code == ObservationReliability.OK) - return "ok"; - if (code == ObservationReliability.ONGOING) - return "ongoing"; - if (code == ObservationReliability.EARLY) - return "early"; - if (code == ObservationReliability.QUESTIONABLE) - return "questionable"; - if (code == ObservationReliability.CALIBRATING) - return "calibrating"; - if (code == ObservationReliability.ERROR) - return "error"; - if (code == ObservationReliability.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum ObservationRelationshiptypes implements FhirEnum { - /** - * The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure). - */ - HASCOMPONENT, - /** - * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. - */ - HASMEMBER, - /** - * The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score). - */ - DERIVEDFROM, - /** - * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). - */ - SEQUELTO, - /** - * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. - */ - REPLACES, - /** - * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure). - */ - QUALIFIEDBY, - /** - * The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). - */ - INTERFEREDBY, - /** - * added to help the parsers - */ - NULL; - - 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)) - return HASCOMPONENT; - if ("has-member".equals(codeString)) - return HASMEMBER; - if ("derived-from".equals(codeString)) - return DERIVEDFROM; - if ("sequel-to".equals(codeString)) - return SEQUELTO; - if ("replaces".equals(codeString)) - return REPLACES; - if ("qualified-by".equals(codeString)) - return QUALIFIEDBY; - if ("interfered-by".equals(codeString)) - return INTERFEREDBY; - throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case HASCOMPONENT: return "has-component"; - case HASMEMBER: return "has-member"; - case DERIVEDFROM: return "derived-from"; - case SEQUELTO: return "sequel-to"; - case REPLACES: return "replaces"; - case QUALIFIEDBY: return "qualified-by"; - case INTERFEREDBY: return "interfered-by"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HASCOMPONENT: return ""; - case HASMEMBER: return ""; - case DERIVEDFROM: return ""; - case SEQUELTO: return ""; - case REPLACES: return ""; - case QUALIFIEDBY: return ""; - case INTERFEREDBY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HASCOMPONENT: return "The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure)."; - case HASMEMBER: return "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."; - case DERIVEDFROM: return "The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score)."; - case SEQUELTO: return "This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test)."; - case REPLACES: return "This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete."; - case QUALIFIEDBY: return "The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure)."; - case INTERFEREDBY: return "The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HASCOMPONENT: return "has-component"; - case HASMEMBER: return "has-member"; - case DERIVEDFROM: return "derived-from"; - case SEQUELTO: return "sequel-to"; - case REPLACES: return "replaces"; - case QUALIFIEDBY: return "qualified-by"; - case INTERFEREDBY: return "interfered-by"; - default: return "?"; - } - } - } - - public static class ObservationRelationshiptypesEnumFactory implements EnumFactory { - public ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("has-component".equals(codeString)) - return ObservationRelationshiptypes.HASCOMPONENT; - if ("has-member".equals(codeString)) - return ObservationRelationshiptypes.HASMEMBER; - if ("derived-from".equals(codeString)) - return ObservationRelationshiptypes.DERIVEDFROM; - if ("sequel-to".equals(codeString)) - return ObservationRelationshiptypes.SEQUELTO; - if ("replaces".equals(codeString)) - return ObservationRelationshiptypes.REPLACES; - if ("qualified-by".equals(codeString)) - return ObservationRelationshiptypes.QUALIFIEDBY; - if ("interfered-by".equals(codeString)) - return ObservationRelationshiptypes.INTERFEREDBY; - throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); - } - public String toCode(ObservationRelationshiptypes code) throws IllegalArgumentException { - if (code == ObservationRelationshiptypes.HASCOMPONENT) - return "has-component"; - if (code == ObservationRelationshiptypes.HASMEMBER) - return "has-member"; - if (code == ObservationRelationshiptypes.DERIVEDFROM) - return "derived-from"; - if (code == ObservationRelationshiptypes.SEQUELTO) - return "sequel-to"; - if (code == ObservationRelationshiptypes.REPLACES) - return "replaces"; - if (code == ObservationRelationshiptypes.QUALIFIEDBY) - return "qualified-by"; - if (code == ObservationRelationshiptypes.INTERFEREDBY) - return "interfered-by"; - return "?"; - } - } - - @Block() - public static class ObservationReferenceRangeComponent extends BackboneElement { - /** - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3. - */ - @Child(name="low", type={Quantity.class}, order=1, min=0, max=1) - @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3." ) - protected Quantity low; - - /** - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5. - */ - @Child(name="high", type={Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5." ) - protected Quantity high; - - /** - * Code for the meaning of the reference range. - */ - @Child(name="meaning", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Indicates the meaning/use of this range of this range", formalDefinition="Code for the meaning of the reference range." ) - protected CodeableConcept meaning; - - /** - * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. - */ - @Child(name="age", type={Range.class}, order=4, min=0, max=1) - @Description(shortDefinition="Applicable age range, if relevant", formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so." ) - protected Range age; - - /** - * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - @Child(name="text", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'." ) - protected StringType text; - - private static final long serialVersionUID = 230621180L; - - public ObservationReferenceRangeComponent() { - super(); - } - - /** - * @return {@link #low} (The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3.) - */ - public Quantity getLow() { - if (this.low == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low"); - else if (Configuration.doAutoCreate()) - this.low = new Quantity(); - return this.low; - } - - public boolean hasLow() { - return this.low != null && !this.low.isEmpty(); - } - - /** - * @param value {@link #low} (The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3.) - */ - public ObservationReferenceRangeComponent setLow(Quantity value) { - this.low = value; - return this; - } - - /** - * @return {@link #high} (The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5.) - */ - public Quantity getHigh() { - if (this.high == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high"); - else if (Configuration.doAutoCreate()) - this.high = new Quantity(); - return this.high; - } - - public boolean hasHigh() { - return this.high != null && !this.high.isEmpty(); - } - - /** - * @param value {@link #high} (The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5.) - */ - public ObservationReferenceRangeComponent setHigh(Quantity value) { - this.high = value; - return this; - } - - /** - * @return {@link #meaning} (Code for the meaning of the reference range.) - */ - public CodeableConcept getMeaning() { - if (this.meaning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.meaning"); - else if (Configuration.doAutoCreate()) - this.meaning = new CodeableConcept(); - return this.meaning; - } - - public boolean hasMeaning() { - return this.meaning != null && !this.meaning.isEmpty(); - } - - /** - * @param value {@link #meaning} (Code for the meaning of the reference range.) - */ - public ObservationReferenceRangeComponent setMeaning(CodeableConcept value) { - this.meaning = value; - return this; - } - - /** - * @return {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) - */ - public Range getAge() { - if (this.age == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age"); - else if (Configuration.doAutoCreate()) - this.age = new Range(); - return this.age; - } - - public boolean hasAge() { - return this.age != null && !this.age.isEmpty(); - } - - /** - * @param value {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) - */ - public ObservationReferenceRangeComponent setAge(Range value) { - this.age = value; - return this; - } - - /** - * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public ObservationReferenceRangeComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - public ObservationReferenceRangeComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("low", "Quantity", "The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3.", 0, java.lang.Integer.MAX_VALUE, low)); - childrenList.add(new Property("high", "Quantity", "The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5.", 0, java.lang.Integer.MAX_VALUE, high)); - childrenList.add(new Property("meaning", "CodeableConcept", "Code for the meaning of the reference range.", 0, java.lang.Integer.MAX_VALUE, meaning)); - childrenList.add(new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, java.lang.Integer.MAX_VALUE, age)); - childrenList.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public ObservationReferenceRangeComponent copy() { - ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent(); - copyValues(dst); - dst.low = low == null ? null : low.copy(); - dst.high = high == null ? null : high.copy(); - dst.meaning = meaning == null ? null : meaning.copy(); - dst.age = age == null ? null : age.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) - && (meaning == null || meaning.isEmpty()) && (age == null || age.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - } - - @Block() - public static class ObservationRelatedComponent extends BackboneElement { - /** - * A code specifying the kind of relationship that exists with the target observation. - */ - @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", formalDefinition="A code specifying the kind of relationship that exists with the target observation." ) - protected Enumeration type; - - /** - * A reference to the observation that is related to this observation. - */ - @Child(name="target", type={Observation.class}, order=2, min=1, max=1) - @Description(shortDefinition="Observation that is related to this one", formalDefinition="A reference to the observation that is related to this observation." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (A reference to the observation that is related to this observation.) - */ - protected Observation targetTarget; - - private static final long serialVersionUID = 1078793488L; - - public ObservationRelatedComponent() { - super(); - } - - public ObservationRelatedComponent(Reference target) { - super(); - this.target = target; - } - - /** - * @return {@link #type} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ObservationRelatedComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return A code specifying the kind of relationship that exists with the target observation. - */ - public ObservationRelationshiptypes getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A code specifying the kind of relationship that exists with the target observation. - */ - public ObservationRelatedComponent setType(ObservationRelationshiptypes value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(ObservationRelationshiptypes.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (A reference to the observation that is related to this observation.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (A reference to the observation that is related to this observation.) - */ - public ObservationRelatedComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 reference to the observation that is related to this observation.) - */ - public Observation getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Observation(); - return this.targetTarget; - } - - /** - * @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. (A reference to the observation that is related to this observation.) - */ - public ObservationRelatedComponent setTargetTarget(Observation value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "A code specifying the kind of relationship that exists with the target observation.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "Reference(Observation)", "A reference to the observation that is related to this observation.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ObservationRelatedComponent copy() { - ObservationRelatedComponent dst = new ObservationRelatedComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - /** - * Describes what was observed. Sometimes this is called the observation "code". - */ - @Child(name="name", type={CodeableConcept.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation 'code'." ) - protected CodeableConcept name; - - /** - * The information determined as a result of making the observation, if the information has a simple value. - */ - @Child(name="value", type={Quantity.class, CodeableConcept.class, Attachment.class, Ratio.class, DateTimeType.class, Period.class, SampledData.class, StringType.class, TimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) - protected Type value; - - /** - * Provides a reason why the expected value in the element Observation.value[x] is missing. - */ - @Child(name="dataAbsentReason", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="unknown | asked | temp | notasked +", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) - protected Enumeration dataAbsentReason; - - /** - * The assessment made based on the result of the observation. - */ - @Child(name="interpretation", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation." ) - protected CodeableConcept interpretation; - - /** - * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - */ - @Child(name="comments", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Comments about result", formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." ) - protected StringType comments; - - /** - * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. - */ - @Child(name="applies", type={DateTimeType.class, Period.class}, order=4, min=0, max=1) - @Description(shortDefinition="Physiologically Relevant time/time-period for observation", formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself." ) - protected Type applies; - - /** - * The date and time this observation was made available. - */ - @Child(name="issued", type={InstantType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Date/Time this was made available", formalDefinition="The date and time this observation was made available." ) - protected InstantType issued; - - /** - * The status of the result value. - */ - @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) - @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." ) - protected Enumeration status; - - /** - * An estimate of the degree to which quality issues have impacted on the value reported. - */ - @Child(name="reliability", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="ok | ongoing | early | questionable | calibrating | error +", formalDefinition="An estimate of the degree to which quality issues have impacted on the value reported." ) - protected Enumeration reliability; - - /** - * Indicates the site on the subject's body where the observation was made ( i.e. the target site). - */ - @Child(name="bodySite", type={CodeableConcept.class}, order=8, min=0, max=1) - @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made ( i.e. the target site)." ) - protected CodeableConcept bodySite; - - /** - * Indicates the mechanism used to perform the observation. - */ - @Child(name="method", type={CodeableConcept.class}, order=9, min=0, max=1) - @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." ) - protected CodeableConcept method; - - /** - * A unique identifier for the simple observation. - */ - @Child(name="identifier", type={Identifier.class}, order=10, min=0, max=1) - @Description(shortDefinition="Unique Id for this particular observation", formalDefinition="A unique identifier for the simple observation." ) - protected Identifier identifier; - - /** - * The thing the observation is being made about. - */ - @Child(name="subject", type={Patient.class, Group.class, Device.class, Location.class}, order=11, min=0, max=1) - @Description(shortDefinition="Who and/or what this is about", formalDefinition="The thing the observation is being made about." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The thing the observation is being made about.) - */ - protected Resource subjectTarget; - - /** - * The specimen that was used when this observation was made. - */ - @Child(name="specimen", type={Specimen.class}, order=12, min=0, max=1) - @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." ) - protected Reference specimen; - - /** - * The actual object that is the target of the reference (The specimen that was used when this observation was made.) - */ - protected Specimen specimenTarget; - - /** - * Who was responsible for asserting the observed value as "true". - */ - @Child(name="performer", type={Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who did the observation", formalDefinition="Who was responsible for asserting the observed value as 'true'." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".) - */ - protected List performerTarget; - - - /** - * The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation. - */ - @Child(name="encounter", type={Encounter.class}, order=14, min=0, max=1) - @Description(shortDefinition="Healthcare event related to the observation", formalDefinition="The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) - */ - protected Encounter encounterTarget; - - /** - * Guidance on how to interpret the value by comparison to a normal or recommended range. - */ - @Child(name="referenceRange", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) - protected List referenceRange; - - /** - * Related observations - either components, or previous observations, or statements of derivation. - */ - @Child(name="related", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Observations related to this observation", formalDefinition="Related observations - either components, or previous observations, or statements of derivation." ) - protected List related; - - private static final long serialVersionUID = -700112511L; - - public Observation() { - super(); - } - - public Observation(CodeableConcept name, Enumeration status) { - super(); - this.name = name; - this.status = status; - } - - /** - * @return {@link #name} (Describes what was observed. Sometimes this is called the observation "code".) - */ - public CodeableConcept getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeableConcept(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Describes what was observed. Sometimes this is called the observation "code".) - */ - public Observation setName(CodeableConcept value) { - this.name = value; - return this; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Quantity getValueQuantity() throws Exception { - if (!(this.value instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public CodeableConcept getValueCodeableConcept() throws Exception { - if (!(this.value instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Attachment getValueAttachment() throws Exception { - if (!(this.value instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Ratio getValueRatio() throws Exception { - if (!(this.value instanceof Ratio)) - throw new Exception("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Ratio) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public DateTimeType getValueDateTimeType() throws Exception { - if (!(this.value instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Period getValuePeriod() throws Exception { - if (!(this.value instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Period) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public SampledData getValueSampledData() throws Exception { - if (!(this.value instanceof SampledData)) - throw new Exception("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); - return (SampledData) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public StringType getValueStringType() throws Exception { - if (!(this.value instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public TimeType getValueTimeType() throws Exception { - if (!(this.value instanceof TimeType)) - throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Observation setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.). This is the underlying object with id, value and extensions. The accessor "getDataAbsentReason" gives direct access to the value - */ - public Enumeration getDataAbsentReasonElement() { - if (this.dataAbsentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.dataAbsentReason"); - else if (Configuration.doAutoCreate()) - this.dataAbsentReason = new Enumeration(); - return this.dataAbsentReason; - } - - public boolean hasDataAbsentReasonElement() { - return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); - } - - public boolean hasDataAbsentReason() { - return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); - } - - /** - * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.). This is the underlying object with id, value and extensions. The accessor "getDataAbsentReason" gives direct access to the value - */ - public Observation setDataAbsentReasonElement(Enumeration value) { - this.dataAbsentReason = value; - return this; - } - - /** - * @return Provides a reason why the expected value in the element Observation.value[x] is missing. - */ - public DataAbsentReason getDataAbsentReason() { - return this.dataAbsentReason == null ? null : this.dataAbsentReason.getValue(); - } - - /** - * @param value Provides a reason why the expected value in the element Observation.value[x] is missing. - */ - public Observation setDataAbsentReason(DataAbsentReason value) { - if (value == null) - this.dataAbsentReason = null; - else { - if (this.dataAbsentReason == null) - this.dataAbsentReason = new Enumeration(DataAbsentReason.ENUM_FACTORY); - this.dataAbsentReason.setValue(value); - } - return this; - } - - /** - * @return {@link #interpretation} (The assessment made based on the result of the observation.) - */ - public CodeableConcept getInterpretation() { - if (this.interpretation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.interpretation"); - else if (Configuration.doAutoCreate()) - this.interpretation = new CodeableConcept(); - return this.interpretation; - } - - public boolean hasInterpretation() { - return this.interpretation != null && !this.interpretation.isEmpty(); - } - - /** - * @param value {@link #interpretation} (The assessment made based on the result of the observation.) - */ - public Observation setInterpretation(CodeableConcept value) { - this.interpretation = value; - return this; - } - - /** - * @return {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public Observation setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - */ - public Observation setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public Type getApplies() { - return this.applies; - } - - /** - * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public DateTimeType getAppliesDateTimeType() throws Exception { - if (!(this.applies instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.applies.getClass().getName()+" was encountered"); - return (DateTimeType) this.applies; - } - - /** - * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public Period getAppliesPeriod() throws Exception { - if (!(this.applies instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.applies.getClass().getName()+" was encountered"); - return (Period) this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) - */ - public Observation setApplies(Type value) { - this.applies = value; - return this; - } - - /** - * @return {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public InstantType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new InstantType(); - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public Observation setIssuedElement(InstantType value) { - this.issued = value; - return this; - } - - /** - * @return The date and time this observation was made available. - */ - 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(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new InstantType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Observation setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the result value. - */ - public ObservationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the result value. - */ - public Observation setStatus(ObservationStatus value) { - if (this.status == null) - this.status = new Enumeration(ObservationStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value - */ - public Enumeration getReliabilityElement() { - if (this.reliability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.reliability"); - else if (Configuration.doAutoCreate()) - this.reliability = new Enumeration(); - return this.reliability; - } - - public boolean hasReliabilityElement() { - return this.reliability != null && !this.reliability.isEmpty(); - } - - public boolean hasReliability() { - return this.reliability != null && !this.reliability.isEmpty(); - } - - /** - * @param value {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value - */ - public Observation setReliabilityElement(Enumeration value) { - this.reliability = value; - return this; - } - - /** - * @return An estimate of the degree to which quality issues have impacted on the value reported. - */ - public ObservationReliability getReliability() { - return this.reliability == null ? null : this.reliability.getValue(); - } - - /** - * @param value An estimate of the degree to which quality issues have impacted on the value reported. - */ - public Observation setReliability(ObservationReliability value) { - if (value == null) - this.reliability = null; - else { - if (this.reliability == null) - this.reliability = new Enumeration(ObservationReliability.ENUM_FACTORY); - this.reliability.setValue(value); - } - return this; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) - */ - public CodeableConcept getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) - */ - public Observation setBodySite(CodeableConcept value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #method} (Indicates the mechanism used to perform the observation.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (Indicates the mechanism used to perform the observation.) - */ - public Observation setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #identifier} (A unique identifier for the simple observation.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A unique identifier for the simple observation.) - */ - public Observation setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #subject} (The thing the observation is being made about.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.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 thing the observation is being made about.) - */ - public Observation 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 thing the observation is being made about.) - */ - public Resource getSubjectTarget() { - 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 thing the observation is being made about.) - */ - public Observation setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #specimen} (The specimen that was used when this observation was made.) - */ - public Reference getSpecimen() { - if (this.specimen == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.specimen"); - else if (Configuration.doAutoCreate()) - this.specimen = new Reference(); - return this.specimen; - } - - public boolean hasSpecimen() { - return this.specimen != null && !this.specimen.isEmpty(); - } - - /** - * @param value {@link #specimen} (The specimen that was used when this observation was made.) - */ - public Observation setSpecimen(Reference value) { - this.specimen = value; - return this; - } - - /** - * @return {@link #specimen} 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 specimen that was used when this observation was made.) - */ - public Specimen getSpecimenTarget() { - if (this.specimenTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.specimen"); - else if (Configuration.doAutoCreate()) - this.specimenTarget = new Specimen(); - return this.specimenTarget; - } - - /** - * @param value {@link #specimen} 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 specimen that was used when this observation was made.) - */ - public Observation setSpecimenTarget(Specimen value) { - this.specimenTarget = value; - return this; - } - - /** - * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - /** - * @return {@link #performer} (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. Who was responsible for asserting the observed value as "true".) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #encounter} (The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.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 healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) - */ - public Observation 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 healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.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 healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) - */ - public Observation setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - public List getReferenceRange() { - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - return this.referenceRange; - } - - public boolean hasReferenceRange() { - if (this.referenceRange == null) - return false; - for (ObservationReferenceRangeComponent item : this.referenceRange) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - // syntactic sugar - public ObservationReferenceRangeComponent addReferenceRange() { //3 - ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return t; - } - - /** - * @return {@link #related} (Related observations - either components, or previous observations, or statements of derivation.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (ObservationRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Related observations - either components, or previous observations, or statements of derivation.) - */ - // syntactic sugar - public ObservationRelatedComponent addRelated() { //3 - ObservationRelatedComponent t = new ObservationRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation 'code'.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|Attachment|Ratio|dateTime|Period|SampledData|string|time", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("dataAbsentReason", "code", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); - childrenList.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.", 0, java.lang.Integer.MAX_VALUE, interpretation)); - childrenList.add(new Property("comments", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("applies[x]", "dateTime|Period", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("issued", "instant", "The date and time this observation was made available.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("status", "code", "The status of the result value.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("reliability", "code", "An estimate of the degree to which quality issues have impacted on the value reported.", 0, java.lang.Integer.MAX_VALUE, reliability)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the observation was made ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the simple observation.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The thing the observation is being made about.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("performer", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as 'true'.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); - childrenList.add(new Property("related", "", "Related observations - either components, or previous observations, or statements of derivation.", 0, java.lang.Integer.MAX_VALUE, related)); - } - - public Observation copy() { - Observation dst = new Observation(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); - dst.interpretation = interpretation == null ? null : interpretation.copy(); - dst.comments = comments == null ? null : comments.copy(); - dst.applies = applies == null ? null : applies.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.status = status == null ? null : status.copy(); - dst.reliability = reliability == null ? null : reliability.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.method = method == null ? null : method.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.specimen = specimen == null ? null : specimen.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - if (referenceRange != null) { - dst.referenceRange = new ArrayList(); - for (ObservationReferenceRangeComponent i : referenceRange) - dst.referenceRange.add(i.copy()); - }; - if (related != null) { - dst.related = new ArrayList(); - for (ObservationRelatedComponent i : related) - dst.related.add(i.copy()); - }; - return dst; - } - - protected Observation typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (interpretation == null || interpretation.isEmpty()) - && (comments == null || comments.isEmpty()) && (applies == null || applies.isEmpty()) && (issued == null || issued.isEmpty()) - && (status == null || status.isEmpty()) && (reliability == null || reliability.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (method == null || method.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (specimen == null || specimen.isEmpty()) && (performer == null || performer.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) - && (related == null || related.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Observation; - } - - @SearchParamDefinition(name="value-string", path="Observation.valueString", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) - public static final String SP_VALUESTRING = "value-string"; - @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="value-concept", path="Observation.valueCodeableConcept", description="The value of the observation, if the value is a CodeableConcept", type="token" ) - public static final String SP_VALUECONCEPT = "value-concept"; - @SearchParamDefinition(name="reliability", path="Observation.reliability", description="The reliability of the observation", type="token" ) - public static final String SP_RELIABILITY = "reliability"; - @SearchParamDefinition(name="encounter", path="Observation.encounter", description="Healthcare event related to the observation", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - @SearchParamDefinition(name="date", path="Observation.applies[x]", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="name-value-[x]", path="", description="Both name and one of the value parameters", type="composite" ) - public static final String SP_NAMEVALUEX = "name-value-[x]"; - @SearchParamDefinition(name="related-target", path="Observation.related.target", description="Observation that is related to this one", type="reference" ) - public static final String SP_RELATEDTARGET = "related-target"; - @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" ) - public static final String SP_DATAABSENTREASON = "data-absent-reason"; - @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite" ) - public static final String SP_RELATED = "related"; - @SearchParamDefinition(name="patient", path="Observation.subject", description="The subject that the observation is about (if patient)", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="name", path="Observation.name", description="The name of the observation type", type="token" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - @SearchParamDefinition(name="related-type", path="Observation.related.type", description="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", type="token" ) - public static final String SP_RELATEDTYPE = "related-type"; - @SearchParamDefinition(name="performer", path="Observation.performer", description="Who and/or what performed the observation", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique Id for a particular observation", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="value-quantity", path="Observation.valueQuantity", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) - public static final String SP_VALUEQUANTITY = "value-quantity"; - @SearchParamDefinition(name="value-date", path="Observation.valueDateTime|Observation.valuePeriod", description="The value of the observation, if the value is a Period", type="date" ) - public static final String SP_VALUEDATE = "value-date"; - -} - + +/* + 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; +/** + * Measurements and simple assertions made about a patient, device or other subject. + */ +@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") +public class Observation extends DomainResource { + + public enum DataAbsentReason implements FhirEnum { + /** + * The value is not known + */ + UNKNOWN, + /** + * The source human does not know the value + */ + ASKED, + /** + * There is reason to expect (from the workflow) that the value may become known + */ + TEMP, + /** + * The workflow didn't lead to this value being known + */ + NOTASKED, + /** + * The information is not available due to security, privacy or related reasons + */ + MASKED, + /** + * The source system wasn't capable of supporting this element + */ + UNSUPPORTED, + /** + * The content of the data is represented in the resource narrative + */ + ASTEXT, + /** + * Some system or workflow process error means that the information is not available + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return UNKNOWN; + if ("asked".equals(codeString)) + return ASKED; + if ("temp".equals(codeString)) + return TEMP; + if ("notasked".equals(codeString)) + return NOTASKED; + if ("masked".equals(codeString)) + return MASKED; + if ("unsupported".equals(codeString)) + return UNSUPPORTED; + if ("astext".equals(codeString)) + return ASTEXT; + if ("error".equals(codeString)) + return ERROR; + throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case UNKNOWN: return "unknown"; + case ASKED: return "asked"; + case TEMP: return "temp"; + case NOTASKED: return "notasked"; + case MASKED: return "masked"; + case UNSUPPORTED: return "unsupported"; + case ASTEXT: return "astext"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNKNOWN: return ""; + case ASKED: return ""; + case TEMP: return ""; + case NOTASKED: return ""; + case MASKED: return ""; + case UNSUPPORTED: return ""; + case ASTEXT: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNKNOWN: return "The value is not known"; + case ASKED: return "The source human does not know the value"; + case TEMP: return "There is reason to expect (from the workflow) that the value may become known"; + case NOTASKED: return "The workflow didn't lead to this value being known"; + case MASKED: return "The information is not available due to security, privacy or related reasons"; + case UNSUPPORTED: return "The source system wasn't capable of supporting this element"; + case ASTEXT: return "The content of the data is represented in the resource narrative"; + case ERROR: return "Some system or workflow process error means that the information is not available"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNKNOWN: return "unknown"; + case ASKED: return "asked"; + case TEMP: return "temp"; + case NOTASKED: return "notasked"; + case MASKED: return "masked"; + case UNSUPPORTED: return "unsupported"; + case ASTEXT: return "astext"; + case ERROR: return "error"; + default: return "?"; + } + } + } + + public static class DataAbsentReasonEnumFactory implements EnumFactory { + public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unknown".equals(codeString)) + return DataAbsentReason.UNKNOWN; + if ("asked".equals(codeString)) + return DataAbsentReason.ASKED; + if ("temp".equals(codeString)) + return DataAbsentReason.TEMP; + if ("notasked".equals(codeString)) + return DataAbsentReason.NOTASKED; + if ("masked".equals(codeString)) + return DataAbsentReason.MASKED; + if ("unsupported".equals(codeString)) + return DataAbsentReason.UNSUPPORTED; + if ("astext".equals(codeString)) + return DataAbsentReason.ASTEXT; + if ("error".equals(codeString)) + return DataAbsentReason.ERROR; + throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); + } + public String toCode(DataAbsentReason code) throws IllegalArgumentException { + if (code == DataAbsentReason.UNKNOWN) + return "unknown"; + if (code == DataAbsentReason.ASKED) + return "asked"; + if (code == DataAbsentReason.TEMP) + return "temp"; + if (code == DataAbsentReason.NOTASKED) + return "notasked"; + if (code == DataAbsentReason.MASKED) + return "masked"; + if (code == DataAbsentReason.UNSUPPORTED) + return "unsupported"; + if (code == DataAbsentReason.ASTEXT) + return "astext"; + if (code == DataAbsentReason.ERROR) + return "error"; + return "?"; + } + } + + public enum ObservationStatus implements FhirEnum { + /** + * The existence of the observation is registered, but there is no result yet available. + */ + REGISTERED, + /** + * This is an initial or interim observation: data may be incomplete or unverified. + */ + PRELIMINARY, + /** + * The observation is complete and verified by an authorized person. + */ + FINAL, + /** + * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. + */ + AMENDED, + /** + * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED, + /** + * The observation has been withdrawn following previous Final release. + */ + ENTEREDINERROR, + /** + * added to help the parsers + */ + NULL; + + 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)) + return REGISTERED; + if ("preliminary".equals(codeString)) + return PRELIMINARY; + if ("final".equals(codeString)) + return FINAL; + if ("amended".equals(codeString)) + return AMENDED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("entered in error".equals(codeString)) + return ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REGISTERED: return "registered"; + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case AMENDED: return "amended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REGISTERED: return ""; + case PRELIMINARY: return ""; + case FINAL: return ""; + case AMENDED: return ""; + case CANCELLED: return ""; + case ENTEREDINERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REGISTERED: return "The existence of the observation is registered, but there is no result yet available."; + case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified."; + case FINAL: return "The observation is complete and verified by an authorized person."; + case AMENDED: return "The observation has been modified subsequent to being Final, and is complete and verified by an authorized person."; + case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."; + case ENTEREDINERROR: return "The observation has been withdrawn following previous Final release."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REGISTERED: return "Registered"; + case PRELIMINARY: return "preliminary"; + case FINAL: return "final"; + case AMENDED: return "amended"; + case CANCELLED: return "cancelled"; + case ENTEREDINERROR: return "entered in error"; + default: return "?"; + } + } + } + + public static class ObservationStatusEnumFactory implements EnumFactory { + public ObservationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("registered".equals(codeString)) + return ObservationStatus.REGISTERED; + if ("preliminary".equals(codeString)) + return ObservationStatus.PRELIMINARY; + if ("final".equals(codeString)) + return ObservationStatus.FINAL; + if ("amended".equals(codeString)) + return ObservationStatus.AMENDED; + if ("cancelled".equals(codeString)) + return ObservationStatus.CANCELLED; + if ("entered in error".equals(codeString)) + return ObservationStatus.ENTEREDINERROR; + throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); + } + public String toCode(ObservationStatus code) throws IllegalArgumentException { + if (code == ObservationStatus.REGISTERED) + return "registered"; + if (code == ObservationStatus.PRELIMINARY) + return "preliminary"; + if (code == ObservationStatus.FINAL) + return "final"; + if (code == ObservationStatus.AMENDED) + return "amended"; + if (code == ObservationStatus.CANCELLED) + return "cancelled"; + if (code == ObservationStatus.ENTEREDINERROR) + return "entered in error"; + return "?"; + } + } + + public enum ObservationReliability implements FhirEnum { + /** + * The result has no reliability concerns. + */ + OK, + /** + * An early estimate of value; measurement is still occurring. + */ + ONGOING, + /** + * An early estimate of value; processing is still occurring. + */ + EARLY, + /** + * The observation value should be treated with care. + */ + QUESTIONABLE, + /** + * The result has been generated while calibration is occurring. + */ + CALIBRATING, + /** + * The observation could not be completed because of an error. + */ + ERROR, + /** + * No observation reliability value was available. + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + 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)) + return OK; + if ("ongoing".equals(codeString)) + return ONGOING; + if ("early".equals(codeString)) + return EARLY; + if ("questionable".equals(codeString)) + return QUESTIONABLE; + if ("calibrating".equals(codeString)) + return CALIBRATING; + if ("error".equals(codeString)) + return ERROR; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case OK: return "ok"; + case ONGOING: return "ongoing"; + case EARLY: return "early"; + case QUESTIONABLE: return "questionable"; + case CALIBRATING: return "calibrating"; + case ERROR: return "error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OK: return ""; + case ONGOING: return ""; + case EARLY: return ""; + case QUESTIONABLE: return ""; + case CALIBRATING: return ""; + case ERROR: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OK: return "The result has no reliability concerns."; + case ONGOING: return "An early estimate of value; measurement is still occurring."; + case EARLY: return "An early estimate of value; processing is still occurring."; + case QUESTIONABLE: return "The observation value should be treated with care."; + case CALIBRATING: return "The result has been generated while calibration is occurring."; + case ERROR: return "The observation could not be completed because of an error."; + case UNKNOWN: return "No observation reliability value was available."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OK: return "ok"; + case ONGOING: return "ongoing"; + case EARLY: return "early"; + case QUESTIONABLE: return "questionable"; + case CALIBRATING: return "calibrating"; + case ERROR: return "error"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class ObservationReliabilityEnumFactory implements EnumFactory { + public ObservationReliability fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("ok".equals(codeString)) + return ObservationReliability.OK; + if ("ongoing".equals(codeString)) + return ObservationReliability.ONGOING; + if ("early".equals(codeString)) + return ObservationReliability.EARLY; + if ("questionable".equals(codeString)) + return ObservationReliability.QUESTIONABLE; + if ("calibrating".equals(codeString)) + return ObservationReliability.CALIBRATING; + if ("error".equals(codeString)) + return ObservationReliability.ERROR; + if ("unknown".equals(codeString)) + return ObservationReliability.UNKNOWN; + throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); + } + public String toCode(ObservationReliability code) throws IllegalArgumentException { + if (code == ObservationReliability.OK) + return "ok"; + if (code == ObservationReliability.ONGOING) + return "ongoing"; + if (code == ObservationReliability.EARLY) + return "early"; + if (code == ObservationReliability.QUESTIONABLE) + return "questionable"; + if (code == ObservationReliability.CALIBRATING) + return "calibrating"; + if (code == ObservationReliability.ERROR) + return "error"; + if (code == ObservationReliability.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum ObservationRelationshiptypes implements FhirEnum { + /** + * The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure). + */ + HASCOMPONENT, + /** + * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. + */ + HASMEMBER, + /** + * The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score). + */ + DERIVEDFROM, + /** + * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). + */ + SEQUELTO, + /** + * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. + */ + REPLACES, + /** + * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure). + */ + QUALIFIEDBY, + /** + * The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). + */ + INTERFEREDBY, + /** + * added to help the parsers + */ + NULL; + + 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)) + return HASCOMPONENT; + if ("has-member".equals(codeString)) + return HASMEMBER; + if ("derived-from".equals(codeString)) + return DERIVEDFROM; + if ("sequel-to".equals(codeString)) + return SEQUELTO; + if ("replaces".equals(codeString)) + return REPLACES; + if ("qualified-by".equals(codeString)) + return QUALIFIEDBY; + if ("interfered-by".equals(codeString)) + return INTERFEREDBY; + throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case HASCOMPONENT: return "has-component"; + case HASMEMBER: return "has-member"; + case DERIVEDFROM: return "derived-from"; + case SEQUELTO: return "sequel-to"; + case REPLACES: return "replaces"; + case QUALIFIEDBY: return "qualified-by"; + case INTERFEREDBY: return "interfered-by"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HASCOMPONENT: return ""; + case HASMEMBER: return ""; + case DERIVEDFROM: return ""; + case SEQUELTO: return ""; + case REPLACES: return ""; + case QUALIFIEDBY: return ""; + case INTERFEREDBY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HASCOMPONENT: return "The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure)."; + case HASMEMBER: return "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."; + case DERIVEDFROM: return "The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score)."; + case SEQUELTO: return "This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test)."; + case REPLACES: return "This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete."; + case QUALIFIEDBY: return "The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure)."; + case INTERFEREDBY: return "The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HASCOMPONENT: return "has-component"; + case HASMEMBER: return "has-member"; + case DERIVEDFROM: return "derived-from"; + case SEQUELTO: return "sequel-to"; + case REPLACES: return "replaces"; + case QUALIFIEDBY: return "qualified-by"; + case INTERFEREDBY: return "interfered-by"; + default: return "?"; + } + } + } + + public static class ObservationRelationshiptypesEnumFactory implements EnumFactory { + public ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("has-component".equals(codeString)) + return ObservationRelationshiptypes.HASCOMPONENT; + if ("has-member".equals(codeString)) + return ObservationRelationshiptypes.HASMEMBER; + if ("derived-from".equals(codeString)) + return ObservationRelationshiptypes.DERIVEDFROM; + if ("sequel-to".equals(codeString)) + return ObservationRelationshiptypes.SEQUELTO; + if ("replaces".equals(codeString)) + return ObservationRelationshiptypes.REPLACES; + if ("qualified-by".equals(codeString)) + return ObservationRelationshiptypes.QUALIFIEDBY; + if ("interfered-by".equals(codeString)) + return ObservationRelationshiptypes.INTERFEREDBY; + throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); + } + public String toCode(ObservationRelationshiptypes code) throws IllegalArgumentException { + if (code == ObservationRelationshiptypes.HASCOMPONENT) + return "has-component"; + if (code == ObservationRelationshiptypes.HASMEMBER) + return "has-member"; + if (code == ObservationRelationshiptypes.DERIVEDFROM) + return "derived-from"; + if (code == ObservationRelationshiptypes.SEQUELTO) + return "sequel-to"; + if (code == ObservationRelationshiptypes.REPLACES) + return "replaces"; + if (code == ObservationRelationshiptypes.QUALIFIEDBY) + return "qualified-by"; + if (code == ObservationRelationshiptypes.INTERFEREDBY) + return "interfered-by"; + return "?"; + } + } + + @Block() + public static class ObservationReferenceRangeComponent extends BackboneElement { + /** + * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3. + */ + @Child(name="low", type={Quantity.class}, order=1, min=0, max=1) + @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3." ) + protected Quantity low; + + /** + * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5. + */ + @Child(name="high", type={Quantity.class}, order=2, min=0, max=1) + @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5." ) + protected Quantity high; + + /** + * Code for the meaning of the reference range. + */ + @Child(name="meaning", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Indicates the meaning/use of this range of this range", formalDefinition="Code for the meaning of the reference range." ) + protected CodeableConcept meaning; + + /** + * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. + */ + @Child(name="age", type={Range.class}, order=4, min=0, max=1) + @Description(shortDefinition="Applicable age range, if relevant", formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so." ) + protected Range age; + + /** + * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + @Child(name="text", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'." ) + protected StringType text; + + private static final long serialVersionUID = 230621180L; + + public ObservationReferenceRangeComponent() { + super(); + } + + /** + * @return {@link #low} (The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3.) + */ + public Quantity getLow() { + if (this.low == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low"); + else if (Configuration.doAutoCreate()) + this.low = new Quantity(); + return this.low; + } + + public boolean hasLow() { + return this.low != null && !this.low.isEmpty(); + } + + /** + * @param value {@link #low} (The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3.) + */ + public ObservationReferenceRangeComponent setLow(Quantity value) { + this.low = value; + return this; + } + + /** + * @return {@link #high} (The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5.) + */ + public Quantity getHigh() { + if (this.high == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high"); + else if (Configuration.doAutoCreate()) + this.high = new Quantity(); + return this.high; + } + + public boolean hasHigh() { + return this.high != null && !this.high.isEmpty(); + } + + /** + * @param value {@link #high} (The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5.) + */ + public ObservationReferenceRangeComponent setHigh(Quantity value) { + this.high = value; + return this; + } + + /** + * @return {@link #meaning} (Code for the meaning of the reference range.) + */ + public CodeableConcept getMeaning() { + if (this.meaning == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.meaning"); + else if (Configuration.doAutoCreate()) + this.meaning = new CodeableConcept(); + return this.meaning; + } + + public boolean hasMeaning() { + return this.meaning != null && !this.meaning.isEmpty(); + } + + /** + * @param value {@link #meaning} (Code for the meaning of the reference range.) + */ + public ObservationReferenceRangeComponent setMeaning(CodeableConcept value) { + this.meaning = value; + return this; + } + + /** + * @return {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) + */ + public Range getAge() { + if (this.age == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age"); + else if (Configuration.doAutoCreate()) + this.age = new Range(); + return this.age; + } + + public boolean hasAge() { + return this.age != null && !this.age.isEmpty(); + } + + /** + * @param value {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.) + */ + public ObservationReferenceRangeComponent setAge(Range value) { + this.age = value; + return this; + } + + /** + * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public ObservationReferenceRangeComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + */ + public ObservationReferenceRangeComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("low", "Quantity", "The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3.", 0, java.lang.Integer.MAX_VALUE, low)); + childrenList.add(new Property("high", "Quantity", "The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5.", 0, java.lang.Integer.MAX_VALUE, high)); + childrenList.add(new Property("meaning", "CodeableConcept", "Code for the meaning of the reference range.", 0, java.lang.Integer.MAX_VALUE, meaning)); + childrenList.add(new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, java.lang.Integer.MAX_VALUE, age)); + childrenList.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of 'Negative' or a list or table of 'normals'.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public ObservationReferenceRangeComponent copy() { + ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent(); + copyValues(dst); + dst.low = low == null ? null : low.copy(); + dst.high = high == null ? null : high.copy(); + dst.meaning = meaning == null ? null : meaning.copy(); + dst.age = age == null ? null : age.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) + && (meaning == null || meaning.isEmpty()) && (age == null || age.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + } + + @Block() + public static class ObservationRelatedComponent extends BackboneElement { + /** + * A code specifying the kind of relationship that exists with the target observation. + */ + @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", formalDefinition="A code specifying the kind of relationship that exists with the target observation." ) + protected Enumeration type; + + /** + * A reference to the observation that is related to this observation. + */ + @Child(name="target", type={Observation.class}, order=2, min=1, max=1) + @Description(shortDefinition="Observation that is related to this one", formalDefinition="A reference to the observation that is related to this observation." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (A reference to the observation that is related to this observation.) + */ + protected Observation targetTarget; + + private static final long serialVersionUID = 1078793488L; + + public ObservationRelatedComponent() { + super(); + } + + public ObservationRelatedComponent(Reference target) { + super(); + this.target = target; + } + + /** + * @return {@link #type} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (A code specifying the kind of relationship that exists with the target observation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ObservationRelatedComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return A code specifying the kind of relationship that exists with the target observation. + */ + public ObservationRelationshiptypes getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value A code specifying the kind of relationship that exists with the target observation. + */ + public ObservationRelatedComponent setType(ObservationRelationshiptypes value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(ObservationRelationshiptypes.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (A reference to the observation that is related to this observation.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (A reference to the observation that is related to this observation.) + */ + public ObservationRelatedComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 reference to the observation that is related to this observation.) + */ + public Observation getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Observation(); + return this.targetTarget; + } + + /** + * @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. (A reference to the observation that is related to this observation.) + */ + public ObservationRelatedComponent setTargetTarget(Observation value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "A code specifying the kind of relationship that exists with the target observation.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("target", "Reference(Observation)", "A reference to the observation that is related to this observation.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ObservationRelatedComponent copy() { + ObservationRelatedComponent dst = new ObservationRelatedComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + /** + * Describes what was observed. Sometimes this is called the observation "code". + */ + @Child(name="name", type={CodeableConcept.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation 'code'." ) + protected CodeableConcept name; + + /** + * The information determined as a result of making the observation, if the information has a simple value. + */ + @Child(name="value", type={Quantity.class, CodeableConcept.class, Attachment.class, Ratio.class, DateTimeType.class, Period.class, SampledData.class, StringType.class, TimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) + protected Type value; + + /** + * Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + @Child(name="dataAbsentReason", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="unknown | asked | temp | notasked +", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) + protected Enumeration dataAbsentReason; + + /** + * The assessment made based on the result of the observation. + */ + @Child(name="interpretation", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation." ) + protected CodeableConcept interpretation; + + /** + * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + @Child(name="comments", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Comments about result", formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." ) + protected StringType comments; + + /** + * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. + */ + @Child(name="applies", type={DateTimeType.class, Period.class}, order=4, min=0, max=1) + @Description(shortDefinition="Physiologically Relevant time/time-period for observation", formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself." ) + protected Type applies; + + /** + * The date and time this observation was made available. + */ + @Child(name="issued", type={InstantType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Date/Time this was made available", formalDefinition="The date and time this observation was made available." ) + protected InstantType issued; + + /** + * The status of the result value. + */ + @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) + @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." ) + protected Enumeration status; + + /** + * An estimate of the degree to which quality issues have impacted on the value reported. + */ + @Child(name="reliability", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="ok | ongoing | early | questionable | calibrating | error +", formalDefinition="An estimate of the degree to which quality issues have impacted on the value reported." ) + protected Enumeration reliability; + + /** + * Indicates the site on the subject's body where the observation was made ( i.e. the target site). + */ + @Child(name="bodySite", type={CodeableConcept.class}, order=8, min=0, max=1) + @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made ( i.e. the target site)." ) + protected CodeableConcept bodySite; + + /** + * Indicates the mechanism used to perform the observation. + */ + @Child(name="method", type={CodeableConcept.class}, order=9, min=0, max=1) + @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." ) + protected CodeableConcept method; + + /** + * A unique identifier for the simple observation. + */ + @Child(name="identifier", type={Identifier.class}, order=10, min=0, max=1) + @Description(shortDefinition="Unique Id for this particular observation", formalDefinition="A unique identifier for the simple observation." ) + protected Identifier identifier; + + /** + * The thing the observation is being made about. + */ + @Child(name="subject", type={Patient.class, Group.class, Device.class, Location.class}, order=11, min=0, max=1) + @Description(shortDefinition="Who and/or what this is about", formalDefinition="The thing the observation is being made about." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The thing the observation is being made about.) + */ + protected Resource subjectTarget; + + /** + * The specimen that was used when this observation was made. + */ + @Child(name="specimen", type={Specimen.class}, order=12, min=0, max=1) + @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." ) + protected Reference specimen; + + /** + * The actual object that is the target of the reference (The specimen that was used when this observation was made.) + */ + protected Specimen specimenTarget; + + /** + * Who was responsible for asserting the observed value as "true". + */ + @Child(name="performer", type={Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who did the observation", formalDefinition="Who was responsible for asserting the observed value as 'true'." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".) + */ + protected List performerTarget; + + + /** + * The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation. + */ + @Child(name="encounter", type={Encounter.class}, order=14, min=0, max=1) + @Description(shortDefinition="Healthcare event related to the observation", formalDefinition="The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) + */ + protected Encounter encounterTarget; + + /** + * Guidance on how to interpret the value by comparison to a normal or recommended range. + */ + @Child(name="referenceRange", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) + protected List referenceRange; + + /** + * Related observations - either components, or previous observations, or statements of derivation. + */ + @Child(name="related", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Observations related to this observation", formalDefinition="Related observations - either components, or previous observations, or statements of derivation." ) + protected List related; + + private static final long serialVersionUID = -700112511L; + + public Observation() { + super(); + } + + public Observation(CodeableConcept name, Enumeration status) { + super(); + this.name = name; + this.status = status; + } + + /** + * @return {@link #name} (Describes what was observed. Sometimes this is called the observation "code".) + */ + public CodeableConcept getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeableConcept(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (Describes what was observed. Sometimes this is called the observation "code".) + */ + public Observation setName(CodeableConcept value) { + this.name = value; + return this; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public CodeableConcept getValueCodeableConcept() throws Exception { + if (!(this.value instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); + return (CodeableConcept) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Attachment getValueAttachment() throws Exception { + if (!(this.value instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Ratio getValueRatio() throws Exception { + if (!(this.value instanceof Ratio)) + throw new Exception("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Ratio) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public DateTimeType getValueDateTimeType() throws Exception { + if (!(this.value instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Period getValuePeriod() throws Exception { + if (!(this.value instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Period) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public SampledData getValueSampledData() throws Exception { + if (!(this.value instanceof SampledData)) + throw new Exception("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); + return (SampledData) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public StringType getValueStringType() throws Exception { + if (!(this.value instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + /** + * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public TimeType getValueTimeType() throws Exception { + if (!(this.value instanceof TimeType)) + throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) + */ + public Observation setValue(Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.). This is the underlying object with id, value and extensions. The accessor "getDataAbsentReason" gives direct access to the value + */ + public Enumeration getDataAbsentReasonElement() { + if (this.dataAbsentReason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.dataAbsentReason"); + else if (Configuration.doAutoCreate()) + this.dataAbsentReason = new Enumeration(); + return this.dataAbsentReason; + } + + public boolean hasDataAbsentReasonElement() { + return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); + } + + public boolean hasDataAbsentReason() { + return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); + } + + /** + * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.). This is the underlying object with id, value and extensions. The accessor "getDataAbsentReason" gives direct access to the value + */ + public Observation setDataAbsentReasonElement(Enumeration value) { + this.dataAbsentReason = value; + return this; + } + + /** + * @return Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + public DataAbsentReason getDataAbsentReason() { + return this.dataAbsentReason == null ? null : this.dataAbsentReason.getValue(); + } + + /** + * @param value Provides a reason why the expected value in the element Observation.value[x] is missing. + */ + public Observation setDataAbsentReason(DataAbsentReason value) { + if (value == null) + this.dataAbsentReason = null; + else { + if (this.dataAbsentReason == null) + this.dataAbsentReason = new Enumeration(DataAbsentReason.ENUM_FACTORY); + this.dataAbsentReason.setValue(value); + } + return this; + } + + /** + * @return {@link #interpretation} (The assessment made based on the result of the observation.) + */ + public CodeableConcept getInterpretation() { + if (this.interpretation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.interpretation"); + else if (Configuration.doAutoCreate()) + this.interpretation = new CodeableConcept(); + return this.interpretation; + } + + public boolean hasInterpretation() { + return this.interpretation != null && !this.interpretation.isEmpty(); + } + + /** + * @param value {@link #interpretation} (The assessment made based on the result of the observation.) + */ + public Observation setInterpretation(CodeableConcept value) { + this.interpretation = value; + return this; + } + + /** + * @return {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public Observation setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + */ + public Observation setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Type getApplies() { + return this.applies; + } + + /** + * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public DateTimeType getAppliesDateTimeType() throws Exception { + if (!(this.applies instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.applies.getClass().getName()+" was encountered"); + return (DateTimeType) this.applies; + } + + /** + * @return {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Period getAppliesPeriod() throws Exception { + if (!(this.applies instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.applies.getClass().getName()+" was encountered"); + return (Period) this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) + */ + public Observation setApplies(Type value) { + this.applies = value; + return this; + } + + /** + * @return {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public InstantType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new InstantType(); + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (The date and time this observation was made available.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public Observation setIssuedElement(InstantType value) { + this.issued = value; + return this; + } + + /** + * @return The date and time this observation was made available. + */ + 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(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new InstantType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Observation setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the result value. + */ + public ObservationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the result value. + */ + public Observation setStatus(ObservationStatus value) { + if (this.status == null) + this.status = new Enumeration(ObservationStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value + */ + public Enumeration getReliabilityElement() { + if (this.reliability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.reliability"); + else if (Configuration.doAutoCreate()) + this.reliability = new Enumeration(); + return this.reliability; + } + + public boolean hasReliabilityElement() { + return this.reliability != null && !this.reliability.isEmpty(); + } + + public boolean hasReliability() { + return this.reliability != null && !this.reliability.isEmpty(); + } + + /** + * @param value {@link #reliability} (An estimate of the degree to which quality issues have impacted on the value reported.). This is the underlying object with id, value and extensions. The accessor "getReliability" gives direct access to the value + */ + public Observation setReliabilityElement(Enumeration value) { + this.reliability = value; + return this; + } + + /** + * @return An estimate of the degree to which quality issues have impacted on the value reported. + */ + public ObservationReliability getReliability() { + return this.reliability == null ? null : this.reliability.getValue(); + } + + /** + * @param value An estimate of the degree to which quality issues have impacted on the value reported. + */ + public Observation setReliability(ObservationReliability value) { + if (value == null) + this.reliability = null; + else { + if (this.reliability == null) + this.reliability = new Enumeration(ObservationReliability.ENUM_FACTORY); + this.reliability.setValue(value); + } + return this; + } + + /** + * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) + */ + public CodeableConcept getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new CodeableConcept(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made ( i.e. the target site).) + */ + public Observation setBodySite(CodeableConcept value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #method} (Indicates the mechanism used to perform the observation.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (Indicates the mechanism used to perform the observation.) + */ + public Observation setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #identifier} (A unique identifier for the simple observation.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A unique identifier for the simple observation.) + */ + public Observation setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #subject} (The thing the observation is being made about.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.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 thing the observation is being made about.) + */ + public Observation 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 thing the observation is being made about.) + */ + public Resource getSubjectTarget() { + 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 thing the observation is being made about.) + */ + public Observation setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #specimen} (The specimen that was used when this observation was made.) + */ + public Reference getSpecimen() { + if (this.specimen == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.specimen"); + else if (Configuration.doAutoCreate()) + this.specimen = new Reference(); + return this.specimen; + } + + public boolean hasSpecimen() { + return this.specimen != null && !this.specimen.isEmpty(); + } + + /** + * @param value {@link #specimen} (The specimen that was used when this observation was made.) + */ + public Observation setSpecimen(Reference value) { + this.specimen = value; + return this; + } + + /** + * @return {@link #specimen} 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 specimen that was used when this observation was made.) + */ + public Specimen getSpecimenTarget() { + if (this.specimenTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.specimen"); + else if (Configuration.doAutoCreate()) + this.specimenTarget = new Specimen(); + return this.specimenTarget; + } + + /** + * @param value {@link #specimen} 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 specimen that was used when this observation was made.) + */ + public Observation setSpecimenTarget(Specimen value) { + this.specimenTarget = value; + return this; + } + + /** + * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (Reference item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + /** + * @return {@link #performer} (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. Who was responsible for asserting the observed value as "true".) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #encounter} (The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.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 healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) + */ + public Observation 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 healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Observation.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 healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.) + */ + public Observation setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + public List getReferenceRange() { + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + return this.referenceRange; + } + + public boolean hasReferenceRange() { + if (this.referenceRange == null) + return false; + for (ObservationReferenceRangeComponent item : this.referenceRange) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) + */ + // syntactic sugar + public ObservationReferenceRangeComponent addReferenceRange() { //3 + ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); + if (this.referenceRange == null) + this.referenceRange = new ArrayList(); + this.referenceRange.add(t); + return t; + } + + /** + * @return {@link #related} (Related observations - either components, or previous observations, or statements of derivation.) + */ + public List getRelated() { + if (this.related == null) + this.related = new ArrayList(); + return this.related; + } + + public boolean hasRelated() { + if (this.related == null) + return false; + for (ObservationRelatedComponent item : this.related) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #related} (Related observations - either components, or previous observations, or statements of derivation.) + */ + // syntactic sugar + public ObservationRelatedComponent addRelated() { //3 + ObservationRelatedComponent t = new ObservationRelatedComponent(); + if (this.related == null) + this.related = new ArrayList(); + this.related.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation 'code'.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|Attachment|Ratio|dateTime|Period|SampledData|string|time", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("dataAbsentReason", "code", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); + childrenList.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.", 0, java.lang.Integer.MAX_VALUE, interpretation)); + childrenList.add(new Property("comments", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, java.lang.Integer.MAX_VALUE, comments)); + childrenList.add(new Property("applies[x]", "dateTime|Period", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the 'physiologically relevant time'. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("issued", "instant", "The date and time this observation was made available.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("status", "code", "The status of the result value.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("reliability", "code", "An estimate of the degree to which quality issues have impacted on the value reported.", 0, java.lang.Integer.MAX_VALUE, reliability)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the observation was made ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the simple observation.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The thing the observation is being made about.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, java.lang.Integer.MAX_VALUE, specimen)); + childrenList.add(new Property("performer", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as 'true'.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); + childrenList.add(new Property("related", "", "Related observations - either components, or previous observations, or statements of derivation.", 0, java.lang.Integer.MAX_VALUE, related)); + } + + public Observation copy() { + Observation dst = new Observation(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); + dst.interpretation = interpretation == null ? null : interpretation.copy(); + dst.comments = comments == null ? null : comments.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.status = status == null ? null : status.copy(); + dst.reliability = reliability == null ? null : reliability.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + dst.method = method == null ? null : method.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.specimen = specimen == null ? null : specimen.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + if (referenceRange != null) { + dst.referenceRange = new ArrayList(); + for (ObservationReferenceRangeComponent i : referenceRange) + dst.referenceRange.add(i.copy()); + }; + if (related != null) { + dst.related = new ArrayList(); + for (ObservationRelatedComponent i : related) + dst.related.add(i.copy()); + }; + return dst; + } + + protected Observation typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (interpretation == null || interpretation.isEmpty()) + && (comments == null || comments.isEmpty()) && (applies == null || applies.isEmpty()) && (issued == null || issued.isEmpty()) + && (status == null || status.isEmpty()) && (reliability == null || reliability.isEmpty()) + && (bodySite == null || bodySite.isEmpty()) && (method == null || method.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (subject == null || subject.isEmpty()) && (specimen == null || specimen.isEmpty()) && (performer == null || performer.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) + && (related == null || related.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Observation; + } + + @SearchParamDefinition(name="value-string", path="Observation.valueString", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) + public static final String SP_VALUESTRING = "value-string"; + @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="value-concept", path="Observation.valueCodeableConcept", description="The value of the observation, if the value is a CodeableConcept", type="token" ) + public static final String SP_VALUECONCEPT = "value-concept"; + @SearchParamDefinition(name="reliability", path="Observation.reliability", description="The reliability of the observation", type="token" ) + public static final String SP_RELIABILITY = "reliability"; + @SearchParamDefinition(name="encounter", path="Observation.encounter", description="Healthcare event related to the observation", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="date", path="Observation.applies[x]", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="name-value-[x]", path="", description="Both name and one of the value parameters", type="composite" ) + public static final String SP_NAMEVALUEX = "name-value-[x]"; + @SearchParamDefinition(name="related-target", path="Observation.related.target", description="Observation that is related to this one", type="reference" ) + public static final String SP_RELATEDTARGET = "related-target"; + @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" ) + public static final String SP_DATAABSENTREASON = "data-absent-reason"; + @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite" ) + public static final String SP_RELATED = "related"; + @SearchParamDefinition(name="patient", path="Observation.subject", description="The subject that the observation is about (if patient)", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="name", path="Observation.name", description="The name of the observation type", type="token" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference" ) + public static final String SP_SPECIMEN = "specimen"; + @SearchParamDefinition(name="related-type", path="Observation.related.type", description="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", type="token" ) + public static final String SP_RELATEDTYPE = "related-type"; + @SearchParamDefinition(name="performer", path="Observation.performer", description="Who and/or what performed the observation", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique Id for a particular observation", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="value-quantity", path="Observation.valueQuantity", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) + public static final String SP_VALUEQUANTITY = "value-quantity"; + @SearchParamDefinition(name="value-date", path="Observation.valueDateTime|Observation.valuePeriod", description="The value of the observation, if the value is a Period", type="date" ) + public static final String SP_VALUEDATE = "value-date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java index 445138e177a..fdae856c031 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java @@ -1,31 +1,31 @@ -/* -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. - - */ +/* +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. + + */ package org.hl7.fhir.instance.model; /* @@ -48,43 +48,43 @@ package org.hl7.fhir.instance.model; * #L% */ - -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 = 2L; - - /** - * Constructor - */ - public OidType() { - super(); - } - - /** - * Constructor - */ - public OidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public OidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public OidType copy() { - return new OidType(getValue()); - } - -} + +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 = 2L; + + /** + * Constructor + */ + public OidType() { + super(); + } + + /** + * Constructor + */ + public OidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public OidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public OidType copy() { + return new OidType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java index b89c79771fe..448361bf6e0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java @@ -20,2185 +20,2185 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). - */ -@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") -public class OperationDefinition extends DomainResource { - - public enum ResourceProfileStatus implements FhirEnum { - /** - * This profile is still under development. - */ - DRAFT, - /** - * This profile is ready for normal use. - */ - ACTIVE, - /** - * This profile has been deprecated, withdrawn or superseded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This profile is still under development."; - case ACTIVE: return "This profile is ready for normal use."; - case RETIRED: return "This profile has been deprecated, withdrawn or superseded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class ResourceProfileStatusEnumFactory implements EnumFactory { - public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ResourceProfileStatus.DRAFT; - if ("active".equals(codeString)) - return ResourceProfileStatus.ACTIVE; - if ("retired".equals(codeString)) - return ResourceProfileStatus.RETIRED; - throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); - } - public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { - if (code == ResourceProfileStatus.DRAFT) - return "draft"; - if (code == ResourceProfileStatus.ACTIVE) - return "active"; - if (code == ResourceProfileStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum OperationKind implements FhirEnum { - /** - * This operation is invoked as an operation. - */ - OPERATION, - /** - * This operation is a named query, invoked using the search mechanism. - */ - QUERY, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case OPERATION: return "operation"; - case QUERY: return "query"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OPERATION: return ""; - case QUERY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OPERATION: return "This operation is invoked as an operation."; - case QUERY: return "This operation is a named query, invoked using the search mechanism."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OPERATION: return "operation"; - case QUERY: return "query"; - default: return "?"; - } - } - } - - public static class OperationKindEnumFactory implements EnumFactory { - public OperationKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("operation".equals(codeString)) - return OperationKind.OPERATION; - if ("query".equals(codeString)) - return OperationKind.QUERY; - throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); - } - public String toCode(OperationKind code) throws IllegalArgumentException { - if (code == OperationKind.OPERATION) - return "operation"; - if (code == OperationKind.QUERY) - return "query"; - return "?"; - } - } - - public enum OperationParameterUse implements FhirEnum { - /** - * This is an input parameter. - */ - IN, - /** - * This is an output parameter. - */ - OUT, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case IN: return ""; - case OUT: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case IN: return "This is an input parameter."; - case OUT: return "This is an output parameter."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - } - - public static class OperationParameterUseEnumFactory implements EnumFactory { - public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in".equals(codeString)) - return OperationParameterUse.IN; - if ("out".equals(codeString)) - return OperationParameterUse.OUT; - throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); - } - public String toCode(OperationParameterUse code) throws IllegalArgumentException { - if (code == OperationParameterUse.IN) - return "in"; - if (code == OperationParameterUse.OUT) - return "out"; - return "?"; - } - } - - @Block() - public static class OperationDefinitionParameterComponent 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; - - /** - * Whether this is an input or an output parameter. - */ - @Child(name="use", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." ) - protected Enumeration use; - - /** - * The minimum number of times this parameter SHALL appear in the request or response. - */ - @Child(name="min", type={IntegerType.class}, order=3, 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=4, 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=5, 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=6, min=0, 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=7, 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; - - /** - * 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 part; - - private static final long serialVersionUID = 176609099L; - - public OperationDefinitionParameterComponent() { - super(); - } - - public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { - super(); - this.name = name; - this.use = use; - this.min = min; - this.max = max; - } - - /** - * @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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent setName(String value) { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public OperationDefinitionParameterComponent setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Whether this is an input or an output parameter. - */ - public OperationParameterUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Whether this is an input or an output parameter. - */ - public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { - if (this.use == null) - this.use = new Enumeration(OperationParameterUse.ENUM_FACTORY); - this.use.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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 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.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent setProfileTarget(Profile value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #part} (The parts of a Tuple Parameter.) - */ - public List getPart() { - if (this.part == null) - this.part = new ArrayList(); - 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(); - this.part.add(t); - return t; - } - - protected void listChildren(List 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("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use)); - 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)); - childrenList.add(new Property("part", "", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); - } - - public OperationDefinitionParameterComponent copy() { - OperationDefinitionParameterComponent dst = new OperationDefinitionParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.use = use == null ? null : use.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(); - if (part != null) { - dst.part = new ArrayList(); - 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()) && (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 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()); - } - - } - - /** - * The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - @Child(name="identifier", type={UriType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Logical id to reference this operation definition", formalDefinition="The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) - protected UriType identifier; - - /** - * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name identifying the Profile. - */ - @Child(name="title", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Informal name for this profile", formalDefinition="A free text natural language name identifying the Profile." ) - protected StringType title; - - /** - * Details of the individual or organization who accepts responsibility for publishing the profile. - */ - @Child(name="publisher", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the profile." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A free text natural language description of the profile and its use. - */ - @Child(name="description", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." ) - protected StringType description; - - /** - * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. - */ - @Child(name="code", type={Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) - protected List code; - - /** - * The status of the profile. - */ - @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) - protected Enumeration status; - - /** - * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name="experimental", type={BooleanType.class}, order=7, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that this version of the profile was published. - */ - @Child(name="date", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date that this version of the profile was published." ) - protected DateTimeType date; - - /** - * Whether this is operation or named query. - */ - @Child(name="kind", type={CodeType.class}, order=9, min=1, max=1) - @Description(shortDefinition="operation | query", formalDefinition="Whether this is operation or named query." ) - protected Enumeration kind; - - /** - * The name used to invoke the operation. - */ - @Child(name="name", type={CodeType.class}, order=10, min=1, max=1) - @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." ) - protected CodeType name; - - /** - * Additional information about how to use this operation or named query. - */ - @Child(name="notes", type={StringType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." ) - protected StringType notes; - - /** - * Indicates that this operation definition is a constraining profile on the base. - */ - @Child(name="base", type={OperationDefinition.class}, order=12, min=0, max=1) - @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." ) - protected Reference base; - - /** - * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.) - */ - protected OperationDefinition baseTarget; - - /** - * 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). - */ - @Child(name="system", type={BooleanType.class}, order=13, min=1, max=1) - @Description(shortDefinition="Invoke at the system level?", formalDefinition="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)." ) - protected BooleanType system; - - /** - * 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). - */ - @Child(name="type", type={CodeType.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Invoke at resource level for these type", formalDefinition="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)." ) - protected List type; - - /** - * Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - @Child(name="instance", type={BooleanType.class}, order=15, min=1, max=1) - @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." ) - protected BooleanType instance; - - /** - * 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="The parameters for the operation/query." ) - protected List parameter; - - private static final long serialVersionUID = 300577956L; - - public OperationDefinition() { - super(); - } - - public OperationDefinition(StringType title, Enumeration status, Enumeration kind, CodeType name, BooleanType system, BooleanType instance) { - super(); - this.title = title; - this.status = status; - this.kind = kind; - this.name = name; - this.system = system; - this.instance = instance; - } - - /** - * @return {@link #identifier} (The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public UriType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new UriType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public OperationDefinition setIdentifierElement(UriType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public OperationDefinition setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new UriType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public OperationDefinition setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public OperationDefinition setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public OperationDefinition setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A free text natural language name identifying the Profile. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A free text natural language name identifying the Profile. - */ - public OperationDefinition setTitle(String value) { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public OperationDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Details of the individual or organization who accepts responsibility for publishing the profile. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Details of the individual or organization who accepts responsibility for publishing the profile. - */ - public OperationDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #description} (A free text natural language description of the profile and its use.). 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 OperationDefinition.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} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public OperationDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the profile and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the profile and its use. - */ - public OperationDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - /** - * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public OperationDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the profile. - */ - public ResourceProfileStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the profile. - */ - public OperationDefinition setStatus(ResourceProfileStatus value) { - if (this.status == null) - this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public OperationDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null ? false : this.experimental.getValue(); - } - - /** - * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public OperationDefinition setExperimental(boolean value) { - if (value == false) - this.experimental = null; - else { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public OperationDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this version of the profile was published. - */ - 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(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(); - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public OperationDefinition setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Whether this is operation or named query. - */ - public OperationKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Whether this is operation or named query. - */ - public OperationDefinition setKind(OperationKind value) { - if (this.kind == null) - this.kind = new Enumeration(OperationKind.ENUM_FACTORY); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #name} (The name used to invoke the operation.). 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 OperationDefinition.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 used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinition setNameElement(CodeType value) { - this.name = value; - return this; - } - - /** - * @return The name used to invoke the operation. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name used to invoke the operation. - */ - public OperationDefinition setName(String value) { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #notes} (Additional information about how to use this operation or named query.). 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 OperationDefinition.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} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public OperationDefinition setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Additional information about how to use this operation or named query. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Additional information about how to use this operation or named query. - */ - public OperationDefinition 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 #base} (Indicates that this operation definition is a constraining profile on the base.) - */ - public Reference getBase() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.base"); - else if (Configuration.doAutoCreate()) - this.base = new Reference(); - return this.base; - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition setBase(Reference value) { - this.base = value; - return this; - } - - /** - * @return {@link #base} 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. (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition getBaseTarget() { - if (this.baseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.base"); - else if (Configuration.doAutoCreate()) - this.baseTarget = new OperationDefinition(); - return this.baseTarget; - } - - /** - * @param value {@link #base} 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. (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition setBaseTarget(OperationDefinition value) { - this.baseTarget = value; - return this; - } - - /** - * @return {@link #system} (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).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public BooleanType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.system"); - else if (Configuration.doAutoCreate()) - this.system = new BooleanType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (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).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public OperationDefinition setSystemElement(BooleanType value) { - this.system = value; - return this; - } - - /** - * @return 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). - */ - public boolean getSystem() { - return this.system == null ? false : this.system.getValue(); - } - - /** - * @param value 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). - */ - public OperationDefinition setSystem(boolean value) { - if (this.system == null) - this.system = new BooleanType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #type} (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).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeType item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (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).) - */ - // syntactic sugar - public CodeType addTypeElement() {//2 - CodeType t = new CodeType(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @param value {@link #type} (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).) - */ - public OperationDefinition addType(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @param value {@link #type} (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).) - */ - public boolean hasType(String value) { - if (this.type == null) - return false; - for (CodeType v : this.type) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value - */ - public BooleanType getInstanceElement() { - if (this.instance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.instance"); - else if (Configuration.doAutoCreate()) - this.instance = new BooleanType(); - return this.instance; - } - - public boolean hasInstanceElement() { - return this.instance != null && !this.instance.isEmpty(); - } - - public boolean hasInstance() { - return this.instance != null && !this.instance.isEmpty(); - } - - /** - * @param value {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value - */ - public OperationDefinition setInstanceElement(BooleanType value) { - this.instance = value; - return this; - } - - /** - * @return Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - public boolean getInstance() { - return this.instance == null ? false : this.instance.getValue(); - } - - /** - * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - public OperationDefinition setInstance(boolean value) { - if (this.instance == null) - this.instance = new BooleanType(); - this.instance.setValue(value); - return this; - } - - /** - * @return {@link #parameter} (The parameters for the operation/query.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (OperationDefinitionParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (The parameters for the operation/query.) - */ - // syntactic sugar - public OperationDefinitionParameterComponent addParameter() { //3 - OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "uri", "The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("title", "string", "A free text natural language name identifying the Profile.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the profile.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the profile was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("kind", "code", "Whether this is operation or named query.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("name", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("notes", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("base", "Reference(OperationDefinition)", "Indicates that this operation definition is a constraining profile on the base.", 0, java.lang.Integer.MAX_VALUE, base)); - 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", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - public OperationDefinition copy() { - OperationDefinition dst = new OperationDefinition(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.title = title == null ? null : title.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.name = name == null ? null : name.copy(); - dst.notes = notes == null ? null : notes.copy(); - dst.base = base == null ? null : base.copy(); - dst.system = system == null ? null : system.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeType i : type) - dst.type.add(i.copy()); - }; - dst.instance = instance == null ? null : instance.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (OperationDefinitionParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - protected OperationDefinition typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (title == null || title.isEmpty()) && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (description == null || description.isEmpty()) && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (kind == null || kind.isEmpty()) - && (name == null || name.isEmpty()) && (notes == null || notes.isEmpty()) && (base == null || base.isEmpty()) - && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) && (instance == null || instance.isEmpty()) - && (parameter == null || parameter.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OperationDefinition; - } - - @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Assist with indexing and finding", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" ) - public static final String SP_KIND = "kind"; - @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="title", path="OperationDefinition.title", description="Informal name for this profile", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" ) - public static final String SP_SYSTEM = "system"; - @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Name used to invoke the operation", type="token" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" ) - public static final String SP_BASE = "base"; - @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" ) - public static final String SP_INSTANCE = "instance"; - @SearchParamDefinition(name="identifier", path="OperationDefinition.identifier", description="Logical id to reference this operation definition", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="profile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" ) - public static final String SP_PROFILE = "profile"; - -} - + +/* + 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; +/** + * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + */ +@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") +public class OperationDefinition extends DomainResource { + + public enum ResourceProfileStatus implements FhirEnum { + /** + * This profile is still under development. + */ + DRAFT, + /** + * This profile is ready for normal use. + */ + ACTIVE, + /** + * This profile has been deprecated, withdrawn or superseded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This profile is still under development."; + case ACTIVE: return "This profile is ready for normal use."; + case RETIRED: return "This profile has been deprecated, withdrawn or superseded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class ResourceProfileStatusEnumFactory implements EnumFactory { + public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ResourceProfileStatus.DRAFT; + if ("active".equals(codeString)) + return ResourceProfileStatus.ACTIVE; + if ("retired".equals(codeString)) + return ResourceProfileStatus.RETIRED; + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); + } + public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { + if (code == ResourceProfileStatus.DRAFT) + return "draft"; + if (code == ResourceProfileStatus.ACTIVE) + return "active"; + if (code == ResourceProfileStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum OperationKind implements FhirEnum { + /** + * This operation is invoked as an operation. + */ + OPERATION, + /** + * This operation is a named query, invoked using the search mechanism. + */ + QUERY, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case OPERATION: return "operation"; + case QUERY: return "query"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case OPERATION: return ""; + case QUERY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case OPERATION: return "This operation is invoked as an operation."; + case QUERY: return "This operation is a named query, invoked using the search mechanism."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case OPERATION: return "operation"; + case QUERY: return "query"; + default: return "?"; + } + } + } + + public static class OperationKindEnumFactory implements EnumFactory { + public OperationKind fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("operation".equals(codeString)) + return OperationKind.OPERATION; + if ("query".equals(codeString)) + return OperationKind.QUERY; + throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); + } + public String toCode(OperationKind code) throws IllegalArgumentException { + if (code == OperationKind.OPERATION) + return "operation"; + if (code == OperationKind.QUERY) + return "query"; + return "?"; + } + } + + public enum OperationParameterUse implements FhirEnum { + /** + * This is an input parameter. + */ + IN, + /** + * This is an output parameter. + */ + OUT, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case IN: return "in"; + case OUT: return "out"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case IN: return ""; + case OUT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case IN: return "This is an input parameter."; + case OUT: return "This is an output parameter."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case IN: return "in"; + case OUT: return "out"; + default: return "?"; + } + } + } + + public static class OperationParameterUseEnumFactory implements EnumFactory { + public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in".equals(codeString)) + return OperationParameterUse.IN; + if ("out".equals(codeString)) + return OperationParameterUse.OUT; + throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); + } + public String toCode(OperationParameterUse code) throws IllegalArgumentException { + if (code == OperationParameterUse.IN) + return "in"; + if (code == OperationParameterUse.OUT) + return "out"; + return "?"; + } + } + + @Block() + public static class OperationDefinitionParameterComponent 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; + + /** + * Whether this is an input or an output parameter. + */ + @Child(name="use", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." ) + protected Enumeration use; + + /** + * The minimum number of times this parameter SHALL appear in the request or response. + */ + @Child(name="min", type={IntegerType.class}, order=3, 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=4, 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=5, 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=6, min=0, 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=7, 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; + + /** + * 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 part; + + private static final long serialVersionUID = 176609099L; + + public OperationDefinitionParameterComponent() { + super(); + } + + public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { + super(); + this.name = name; + this.use = use; + this.min = min; + this.max = max; + } + + /** + * @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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public OperationDefinitionParameterComponent setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Whether this is an input or an output parameter. + */ + public OperationParameterUse getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Whether this is an input or an output parameter. + */ + public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { + if (this.use == null) + this.use = new Enumeration(OperationParameterUse.ENUM_FACTORY); + this.use.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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 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.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent 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 OperationDefinitionParameterComponent.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 OperationDefinitionParameterComponent setProfileTarget(Profile value) { + this.profileTarget = value; + return this; + } + + /** + * @return {@link #part} (The parts of a Tuple Parameter.) + */ + public List getPart() { + if (this.part == null) + this.part = new ArrayList(); + 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(); + this.part.add(t); + return t; + } + + protected void listChildren(List 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("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use)); + 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)); + childrenList.add(new Property("part", "", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); + } + + public OperationDefinitionParameterComponent copy() { + OperationDefinitionParameterComponent dst = new OperationDefinitionParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.use = use == null ? null : use.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(); + if (part != null) { + dst.part = new ArrayList(); + 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()) && (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 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()); + } + + } + + /** + * The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + @Child(name="identifier", type={UriType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Logical id to reference this operation definition", formalDefinition="The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) + protected UriType identifier; + + /** + * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name identifying the Profile. + */ + @Child(name="title", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Informal name for this profile", formalDefinition="A free text natural language name identifying the Profile." ) + protected StringType title; + + /** + * Details of the individual or organization who accepts responsibility for publishing the profile. + */ + @Child(name="publisher", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the profile." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A free text natural language description of the profile and its use. + */ + @Child(name="description", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." ) + protected StringType description; + + /** + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + */ + @Child(name="code", type={Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) + protected List code; + + /** + * The status of the profile. + */ + @Child(name="status", type={CodeType.class}, order=6, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) + protected Enumeration status; + + /** + * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name="experimental", type={BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that this version of the profile was published. + */ + @Child(name="date", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date that this version of the profile was published." ) + protected DateTimeType date; + + /** + * Whether this is operation or named query. + */ + @Child(name="kind", type={CodeType.class}, order=9, min=1, max=1) + @Description(shortDefinition="operation | query", formalDefinition="Whether this is operation or named query." ) + protected Enumeration kind; + + /** + * The name used to invoke the operation. + */ + @Child(name="name", type={CodeType.class}, order=10, min=1, max=1) + @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." ) + protected CodeType name; + + /** + * Additional information about how to use this operation or named query. + */ + @Child(name="notes", type={StringType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." ) + protected StringType notes; + + /** + * Indicates that this operation definition is a constraining profile on the base. + */ + @Child(name="base", type={OperationDefinition.class}, order=12, min=0, max=1) + @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." ) + protected Reference base; + + /** + * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.) + */ + protected OperationDefinition baseTarget; + + /** + * 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). + */ + @Child(name="system", type={BooleanType.class}, order=13, min=1, max=1) + @Description(shortDefinition="Invoke at the system level?", formalDefinition="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)." ) + protected BooleanType system; + + /** + * 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). + */ + @Child(name="type", type={CodeType.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Invoke at resource level for these type", formalDefinition="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)." ) + protected List type; + + /** + * Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + @Child(name="instance", type={BooleanType.class}, order=15, min=1, max=1) + @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." ) + protected BooleanType instance; + + /** + * 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="The parameters for the operation/query." ) + protected List parameter; + + private static final long serialVersionUID = 300577956L; + + public OperationDefinition() { + super(); + } + + public OperationDefinition(StringType title, Enumeration status, Enumeration kind, CodeType name, BooleanType system, BooleanType instance) { + super(); + this.title = title; + this.status = status; + this.kind = kind; + this.name = name; + this.system = system; + this.instance = instance; + } + + /** + * @return {@link #identifier} (The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public UriType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new UriType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public OperationDefinition setIdentifierElement(UriType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public OperationDefinition setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new UriType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public OperationDefinition setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public OperationDefinition setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public OperationDefinition setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return A free text natural language name identifying the Profile. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value A free text natural language name identifying the Profile. + */ + public OperationDefinition setTitle(String value) { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public OperationDefinition setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Details of the individual or organization who accepts responsibility for publishing the profile. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Details of the individual or organization who accepts responsibility for publishing the profile. + */ + public OperationDefinition setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #description} (A free text natural language description of the profile and its use.). 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 OperationDefinition.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} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public OperationDefinition setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the profile and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the profile and its use. + */ + public OperationDefinition setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + /** + * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public OperationDefinition setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the profile. + */ + public ResourceProfileStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the profile. + */ + public OperationDefinition setStatus(ResourceProfileStatus value) { + if (this.status == null) + this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public OperationDefinition setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null ? false : this.experimental.getValue(); + } + + /** + * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public OperationDefinition setExperimental(boolean value) { + if (value == false) + this.experimental = null; + else { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public OperationDefinition setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this version of the profile was published. + */ + 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(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public Enumeration getKindElement() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new Enumeration(); + return this.kind; + } + + public boolean hasKindElement() { + return this.kind != null && !this.kind.isEmpty(); + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Whether this is operation or named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value + */ + public OperationDefinition setKindElement(Enumeration value) { + this.kind = value; + return this; + } + + /** + * @return Whether this is operation or named query. + */ + public OperationKind getKind() { + return this.kind == null ? null : this.kind.getValue(); + } + + /** + * @param value Whether this is operation or named query. + */ + public OperationDefinition setKind(OperationKind value) { + if (this.kind == null) + this.kind = new Enumeration(OperationKind.ENUM_FACTORY); + this.kind.setValue(value); + return this; + } + + /** + * @return {@link #name} (The name used to invoke the operation.). 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 OperationDefinition.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 used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinition setNameElement(CodeType value) { + this.name = value; + return this; + } + + /** + * @return The name used to invoke the operation. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name used to invoke the operation. + */ + public OperationDefinition setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #notes} (Additional information about how to use this operation or named query.). 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 OperationDefinition.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} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public OperationDefinition setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Additional information about how to use this operation or named query. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Additional information about how to use this operation or named query. + */ + public OperationDefinition 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 #base} (Indicates that this operation definition is a constraining profile on the base.) + */ + public Reference getBase() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.base"); + else if (Configuration.doAutoCreate()) + this.base = new Reference(); + return this.base; + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition setBase(Reference value) { + this.base = value; + return this; + } + + /** + * @return {@link #base} 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. (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition getBaseTarget() { + if (this.baseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.base"); + else if (Configuration.doAutoCreate()) + this.baseTarget = new OperationDefinition(); + return this.baseTarget; + } + + /** + * @param value {@link #base} 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. (Indicates that this operation definition is a constraining profile on the base.) + */ + public OperationDefinition setBaseTarget(OperationDefinition value) { + this.baseTarget = value; + return this; + } + + /** + * @return {@link #system} (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).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public BooleanType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.system"); + else if (Configuration.doAutoCreate()) + this.system = new BooleanType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (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).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public OperationDefinition setSystemElement(BooleanType value) { + this.system = value; + return this; + } + + /** + * @return 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). + */ + public boolean getSystem() { + return this.system == null ? false : this.system.getValue(); + } + + /** + * @param value 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). + */ + public OperationDefinition setSystem(boolean value) { + if (this.system == null) + this.system = new BooleanType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #type} (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).) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (CodeType item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (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).) + */ + // syntactic sugar + public CodeType addTypeElement() {//2 + CodeType t = new CodeType(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + /** + * @param value {@link #type} (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).) + */ + public OperationDefinition addType(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return this; + } + + /** + * @param value {@link #type} (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).) + */ + public boolean hasType(String value) { + if (this.type == null) + return false; + for (CodeType v : this.type) + if (v.equals(value)) // code + return true; + return false; + } + + /** + * @return {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value + */ + public BooleanType getInstanceElement() { + if (this.instance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinition.instance"); + else if (Configuration.doAutoCreate()) + this.instance = new BooleanType(); + return this.instance; + } + + public boolean hasInstanceElement() { + return this.instance != null && !this.instance.isEmpty(); + } + + public boolean hasInstance() { + return this.instance != null && !this.instance.isEmpty(); + } + + /** + * @param value {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value + */ + public OperationDefinition setInstanceElement(BooleanType value) { + this.instance = value; + return this; + } + + /** + * @return Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + public boolean getInstance() { + return this.instance == null ? false : this.instance.getValue(); + } + + /** + * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types. + */ + public OperationDefinition setInstance(boolean value) { + if (this.instance == null) + this.instance = new BooleanType(); + this.instance.setValue(value); + return this; + } + + /** + * @return {@link #parameter} (The parameters for the operation/query.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (OperationDefinitionParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (The parameters for the operation/query.) + */ + // syntactic sugar + public OperationDefinitionParameterComponent addParameter() { //3 + OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "uri", "The identifier that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("title", "string", "A free text natural language name identifying the Profile.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the profile.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that this version of the profile was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("kind", "code", "Whether this is operation or named query.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("name", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("notes", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("base", "Reference(OperationDefinition)", "Indicates that this operation definition is a constraining profile on the base.", 0, java.lang.Integer.MAX_VALUE, base)); + 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", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + public OperationDefinition copy() { + OperationDefinition dst = new OperationDefinition(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.title = title == null ? null : title.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.kind = kind == null ? null : kind.copy(); + dst.name = name == null ? null : name.copy(); + dst.notes = notes == null ? null : notes.copy(); + dst.base = base == null ? null : base.copy(); + dst.system = system == null ? null : system.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (CodeType i : type) + dst.type.add(i.copy()); + }; + dst.instance = instance == null ? null : instance.copy(); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (OperationDefinitionParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + protected OperationDefinition typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (title == null || title.isEmpty()) && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (description == null || description.isEmpty()) && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) + && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (kind == null || kind.isEmpty()) + && (name == null || name.isEmpty()) && (notes == null || notes.isEmpty()) && (base == null || base.isEmpty()) + && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) && (instance == null || instance.isEmpty()) + && (parameter == null || parameter.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OperationDefinition; + } + + @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Assist with indexing and finding", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" ) + public static final String SP_KIND = "kind"; + @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="title", path="OperationDefinition.title", description="Informal name for this profile", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" ) + public static final String SP_SYSTEM = "system"; + @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Name used to invoke the operation", type="token" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" ) + public static final String SP_BASE = "base"; + @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" ) + public static final String SP_INSTANCE = "instance"; + @SearchParamDefinition(name="identifier", path="OperationDefinition.identifier", description="Logical id to reference this operation definition", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="profile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" ) + public static final String SP_PROFILE = "profile"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java index 3953eac6e21..d7927daadec 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java @@ -20,470 +20,470 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A collection of error, warning or information messages that result from a system action. - */ -@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") -public class OperationOutcome extends DomainResource { - - public enum IssueSeverity implements FhirEnum { - /** - * The issue caused the action to fail, and no further checking could be performed. - */ - FATAL, - /** - * The issue is sufficiently important to cause the action to fail. - */ - ERROR, - /** - * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. - */ - WARNING, - /** - * The issue has no relation to the degree of success of the action. - */ - INFORMATION, - /** - * added to help the parsers - */ - NULL; - - 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)) - return FATAL; - if ("error".equals(codeString)) - return ERROR; - if ("warning".equals(codeString)) - return WARNING; - if ("information".equals(codeString)) - return INFORMATION; - throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case FATAL: return "fatal"; - case ERROR: return "error"; - case WARNING: return "warning"; - case INFORMATION: return "information"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FATAL: return ""; - case ERROR: return ""; - case WARNING: return ""; - case INFORMATION: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; - case ERROR: return "The issue is sufficiently important to cause the action to fail."; - case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; - case INFORMATION: return "The issue has no relation to the degree of success of the action."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FATAL: return "fatal"; - case ERROR: return "error"; - case WARNING: return "warning"; - case INFORMATION: return "information"; - default: return "?"; - } - } - } - - public static class IssueSeverityEnumFactory implements EnumFactory { - public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("fatal".equals(codeString)) - return IssueSeverity.FATAL; - if ("error".equals(codeString)) - return IssueSeverity.ERROR; - if ("warning".equals(codeString)) - return IssueSeverity.WARNING; - if ("information".equals(codeString)) - return IssueSeverity.INFORMATION; - throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); - } - public String toCode(IssueSeverity code) throws IllegalArgumentException { - if (code == IssueSeverity.FATAL) - return "fatal"; - if (code == IssueSeverity.ERROR) - return "error"; - if (code == IssueSeverity.WARNING) - return "warning"; - if (code == IssueSeverity.INFORMATION) - return "information"; - return "?"; - } - } - - @Block() - public static class OperationOutcomeIssueComponent extends BackboneElement { - /** - * Indicates whether the issue indicates a variation from successful processing. - */ - @Child(name="severity", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) - protected Enumeration severity; - - /** - * A code indicating the type of error, warning or information message. - */ - @Child(name="type", type={Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Error or warning code", formalDefinition="A code indicating the type of error, warning or information message." ) - protected Coding type; - - /** - * Additional description of the issue. - */ - @Child(name="details", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Additional description of the issue", formalDefinition="Additional description of the issue." ) - protected StringType details; - - /** - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - */ - @Child(name="location", type={StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="XPath of element(s) related to issue", formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) - protected List location; - - private static final long serialVersionUID = 1583015135L; - - public OperationOutcomeIssueComponent() { - super(); - } - - public OperationOutcomeIssueComponent(Enumeration severity) { - super(); - this.severity = severity; - } - - /** - * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(); - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public OperationOutcomeIssueComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Indicates whether the issue indicates a variation from successful processing. - */ - public IssueSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Indicates whether the issue indicates a variation from successful processing. - */ - public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { - if (this.severity == null) - this.severity = new Enumeration(IssueSeverity.ENUM_FACTORY); - this.severity.setValue(value); - return this; - } - - /** - * @return {@link #type} (A code indicating the type of error, warning or information message.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code indicating the type of error, warning or information message.) - */ - public OperationOutcomeIssueComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #details} (Additional description of the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public StringType getDetailsElement() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new StringType(); - return this.details; - } - - public boolean hasDetailsElement() { - return this.details != null && !this.details.isEmpty(); - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (Additional description of the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value - */ - public OperationOutcomeIssueComponent setDetailsElement(StringType value) { - this.details = value; - return this; - } - - /** - * @return Additional description of the issue. - */ - public String getDetails() { - return this.details == null ? null : this.details.getValue(); - } - - /** - * @param value Additional description of the issue. - */ - public OperationOutcomeIssueComponent setDetails(String value) { - if (Utilities.noString(value)) - this.details = null; - else { - if (this.details == null) - this.details = new StringType(); - this.details.setValue(value); - } - return this; - } - - /** - * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (StringType item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - // syntactic sugar - public StringType addLocationElement() {//2 - StringType t = new StringType(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - public OperationOutcomeIssueComponent addLocation(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) - */ - public boolean hasLocation(String value) { - if (this.location == null) - return false; - for (StringType v : this.location) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("type", "Coding", "A code indicating the type of error, warning or information message.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("details", "string", "Additional description of the issue.", 0, java.lang.Integer.MAX_VALUE, details)); - childrenList.add(new Property("location", "string", "A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, location)); - } - - public OperationOutcomeIssueComponent copy() { - OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); - copyValues(dst); - dst.severity = severity == null ? null : severity.copy(); - dst.type = type == null ? null : type.copy(); - dst.details = details == null ? null : details.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (StringType i : location) - dst.location.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (severity == null || severity.isEmpty()) && (type == null || type.isEmpty()) - && (details == null || details.isEmpty()) && (location == null || location.isEmpty()); - } - - } - - /** - * An error, warning or information message that results from a system action. - */ - @Child(name="issue", type={}, order=-1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) - protected List issue; - - private static final long serialVersionUID = -152150052L; - - public OperationOutcome() { - super(); - } - - /** - * @return {@link #issue} (An error, warning or information message that results from a system action.) - */ - public List getIssue() { - if (this.issue == null) - this.issue = new ArrayList(); - return this.issue; - } - - public boolean hasIssue() { - if (this.issue == null) - return false; - for (OperationOutcomeIssueComponent item : this.issue) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #issue} (An error, warning or information message that results from a system action.) - */ - // syntactic sugar - public OperationOutcomeIssueComponent addIssue() { //3 - OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); - if (this.issue == null) - this.issue = new ArrayList(); - this.issue.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); - } - - public OperationOutcome copy() { - OperationOutcome dst = new OperationOutcome(); - copyValues(dst); - if (issue != null) { - dst.issue = new ArrayList(); - for (OperationOutcomeIssueComponent i : issue) - dst.issue.add(i.copy()); - }; - return dst; - } - - protected OperationOutcome typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (issue == null || issue.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OperationOutcome; - } - - -} - + +/* + 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; +/** + * A collection of error, warning or information messages that result from a system action. + */ +@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") +public class OperationOutcome extends DomainResource { + + public enum IssueSeverity implements FhirEnum { + /** + * The issue caused the action to fail, and no further checking could be performed. + */ + FATAL, + /** + * The issue is sufficiently important to cause the action to fail. + */ + ERROR, + /** + * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. + */ + WARNING, + /** + * The issue has no relation to the degree of success of the action. + */ + INFORMATION, + /** + * added to help the parsers + */ + NULL; + + 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)) + return FATAL; + if ("error".equals(codeString)) + return ERROR; + if ("warning".equals(codeString)) + return WARNING; + if ("information".equals(codeString)) + return INFORMATION; + throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case FATAL: return "fatal"; + case ERROR: return "error"; + case WARNING: return "warning"; + case INFORMATION: return "information"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case FATAL: return ""; + case ERROR: return ""; + case WARNING: return ""; + case INFORMATION: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; + case ERROR: return "The issue is sufficiently important to cause the action to fail."; + case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; + case INFORMATION: return "The issue has no relation to the degree of success of the action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case FATAL: return "fatal"; + case ERROR: return "error"; + case WARNING: return "warning"; + case INFORMATION: return "information"; + default: return "?"; + } + } + } + + public static class IssueSeverityEnumFactory implements EnumFactory { + public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("fatal".equals(codeString)) + return IssueSeverity.FATAL; + if ("error".equals(codeString)) + return IssueSeverity.ERROR; + if ("warning".equals(codeString)) + return IssueSeverity.WARNING; + if ("information".equals(codeString)) + return IssueSeverity.INFORMATION; + throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); + } + public String toCode(IssueSeverity code) throws IllegalArgumentException { + if (code == IssueSeverity.FATAL) + return "fatal"; + if (code == IssueSeverity.ERROR) + return "error"; + if (code == IssueSeverity.WARNING) + return "warning"; + if (code == IssueSeverity.INFORMATION) + return "information"; + return "?"; + } + } + + @Block() + public static class OperationOutcomeIssueComponent extends BackboneElement { + /** + * Indicates whether the issue indicates a variation from successful processing. + */ + @Child(name="severity", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) + protected Enumeration severity; + + /** + * A code indicating the type of error, warning or information message. + */ + @Child(name="type", type={Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Error or warning code", formalDefinition="A code indicating the type of error, warning or information message." ) + protected Coding type; + + /** + * Additional description of the issue. + */ + @Child(name="details", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Additional description of the issue", formalDefinition="Additional description of the issue." ) + protected StringType details; + + /** + * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. + */ + @Child(name="location", type={StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="XPath of element(s) related to issue", formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) + protected List location; + + private static final long serialVersionUID = 1583015135L; + + public OperationOutcomeIssueComponent() { + super(); + } + + public OperationOutcomeIssueComponent(Enumeration severity) { + super(); + this.severity = severity; + } + + /** + * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public Enumeration getSeverityElement() { + if (this.severity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); + else if (Configuration.doAutoCreate()) + this.severity = new Enumeration(); + return this.severity; + } + + public boolean hasSeverityElement() { + return this.severity != null && !this.severity.isEmpty(); + } + + public boolean hasSeverity() { + return this.severity != null && !this.severity.isEmpty(); + } + + /** + * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value + */ + public OperationOutcomeIssueComponent setSeverityElement(Enumeration value) { + this.severity = value; + return this; + } + + /** + * @return Indicates whether the issue indicates a variation from successful processing. + */ + public IssueSeverity getSeverity() { + return this.severity == null ? null : this.severity.getValue(); + } + + /** + * @param value Indicates whether the issue indicates a variation from successful processing. + */ + public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { + if (this.severity == null) + this.severity = new Enumeration(IssueSeverity.ENUM_FACTORY); + this.severity.setValue(value); + return this; + } + + /** + * @return {@link #type} (A code indicating the type of error, warning or information message.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code indicating the type of error, warning or information message.) + */ + public OperationOutcomeIssueComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #details} (Additional description of the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public StringType getDetailsElement() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new StringType(); + return this.details; + } + + public boolean hasDetailsElement() { + return this.details != null && !this.details.isEmpty(); + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (Additional description of the issue.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public OperationOutcomeIssueComponent setDetailsElement(StringType value) { + this.details = value; + return this; + } + + /** + * @return Additional description of the issue. + */ + public String getDetails() { + return this.details == null ? null : this.details.getValue(); + } + + /** + * @param value Additional description of the issue. + */ + public OperationOutcomeIssueComponent setDetails(String value) { + if (Utilities.noString(value)) + this.details = null; + else { + if (this.details == null) + this.details = new StringType(); + this.details.setValue(value); + } + return this; + } + + /** + * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (StringType item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + // syntactic sugar + public StringType addLocationElement() {//2 + StringType t = new StringType(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public OperationOutcomeIssueComponent addLocation(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return this; + } + + /** + * @param value {@link #location} (A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) + */ + public boolean hasLocation(String value) { + if (this.location == null) + return false; + for (StringType v : this.location) + if (v.equals(value)) // string + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, java.lang.Integer.MAX_VALUE, severity)); + childrenList.add(new Property("type", "Coding", "A code indicating the type of error, warning or information message.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("details", "string", "Additional description of the issue.", 0, java.lang.Integer.MAX_VALUE, details)); + childrenList.add(new Property("location", "string", "A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, location)); + } + + public OperationOutcomeIssueComponent copy() { + OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); + copyValues(dst); + dst.severity = severity == null ? null : severity.copy(); + dst.type = type == null ? null : type.copy(); + dst.details = details == null ? null : details.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (StringType i : location) + dst.location.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (severity == null || severity.isEmpty()) && (type == null || type.isEmpty()) + && (details == null || details.isEmpty()) && (location == null || location.isEmpty()); + } + + } + + /** + * An error, warning or information message that results from a system action. + */ + @Child(name="issue", type={}, order=-1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) + protected List issue; + + private static final long serialVersionUID = -152150052L; + + public OperationOutcome() { + super(); + } + + /** + * @return {@link #issue} (An error, warning or information message that results from a system action.) + */ + public List getIssue() { + if (this.issue == null) + this.issue = new ArrayList(); + return this.issue; + } + + public boolean hasIssue() { + if (this.issue == null) + return false; + for (OperationOutcomeIssueComponent item : this.issue) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #issue} (An error, warning or information message that results from a system action.) + */ + // syntactic sugar + public OperationOutcomeIssueComponent addIssue() { //3 + OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); + if (this.issue == null) + this.issue = new ArrayList(); + this.issue.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); + } + + public OperationOutcome copy() { + OperationOutcome dst = new OperationOutcome(); + copyValues(dst); + if (issue != null) { + dst.issue = new ArrayList(); + for (OperationOutcomeIssueComponent i : issue) + dst.issue.add(i.copy()); + }; + return dst; + } + + protected OperationOutcome typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (issue == null || issue.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OperationOutcome; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java index 49a09c5f4cd..997bfdc8e84 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java @@ -20,4560 +20,4560 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="OralHealthClaim", profile="http://hl7.org/fhir/Profile/OralHealthClaim") -public class OralHealthClaim extends DomainResource { - - public enum UseLink implements FhirEnum { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case PROPOSED: return ""; - case EXPLORATORY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class UseLinkEnumFactory implements EnumFactory { - public UseLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return UseLink.COMPLETE; - if ("proposed".equals(codeString)) - return UseLink.PROPOSED; - if ("exploratory".equals(codeString)) - return UseLink.EXPLORATORY; - if ("other".equals(codeString)) - return UseLink.OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - public String toCode(UseLink code) throws IllegalArgumentException { - if (code == UseLink.COMPLETE) - return "complete"; - if (code == UseLink.PROPOSED) - return "proposed"; - if (code == UseLink.EXPLORATORY) - return "exploratory"; - if (code == UseLink.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class PayeeComponent extends BackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="person", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement { - /** - * Sequence of diagnosis. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) - protected IntegerType sequence; - - /** - * The diagnosis. - */ - @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -935927954L; - - public DiagnosisComponent() { - super(); - } - - public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement { - /** - * A service line item. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected IntegerType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agrement which describes the terms and conditions. - */ - @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preauthref; - - /** - * The Coverages adjudication details. - */ - @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - private static final long serialVersionUID = 450222500L; - - public CoverageComponent() { - super(); - } - - public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public boolean getFocal() { - return this.focal == null ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agrement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agrement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreauthref() { - if (this.preauthref == null) - this.preauthref = new ArrayList(); - return this.preauthref; - } - - public boolean hasPreauthref() { - if (this.preauthref == null) - return false; - for (StringType item : this.preauthref) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreauthrefElement() {//2 - StringType t = new StringType(); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return t; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreauthref(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return this; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreauthref(String value) { - if (this.preauthref == null) - return false; - for (StringType v : this.preauthref) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} 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 Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} 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 Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - 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)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preauthref != null) { - dst.preauthref = new ArrayList(); - for (StringType i : preauthref) - dst.preauthref.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - @Block() - public static class MissingTeethComponent extends BackboneElement { - /** - * The code identifying which tooth is missing. - */ - @Child(name="tooth", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) - protected Coding tooth; - - /** - * Missing reason may be: E-extraction, O-other. - */ - @Child(name="reason", type={Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) - protected Coding reason; - - /** - * The date of the extraction either known from records or patient reported estimate. - */ - @Child(name="extractiondate", type={DateType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) - protected DateType extractiondate; - - private static final long serialVersionUID = -1311739967L; - - public MissingTeethComponent() { - super(); - } - - public MissingTeethComponent(Coding tooth) { - super(); - this.tooth = tooth; - } - - /** - * @return {@link #tooth} (The code identifying which tooth is missing.) - */ - public Coding getTooth() { - if (this.tooth == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); - else if (Configuration.doAutoCreate()) - this.tooth = new Coding(); - return this.tooth; - } - - public boolean hasTooth() { - return this.tooth != null && !this.tooth.isEmpty(); - } - - /** - * @param value {@link #tooth} (The code identifying which tooth is missing.) - */ - public MissingTeethComponent setTooth(Coding value) { - this.tooth = value; - return this; - } - - /** - * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public MissingTeethComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #extractiondate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractiondate" gives direct access to the value - */ - public DateType getExtractiondateElement() { - if (this.extractiondate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.extractiondate"); - else if (Configuration.doAutoCreate()) - this.extractiondate = new DateType(); - return this.extractiondate; - } - - public boolean hasExtractiondateElement() { - return this.extractiondate != null && !this.extractiondate.isEmpty(); - } - - public boolean hasExtractiondate() { - return this.extractiondate != null && !this.extractiondate.isEmpty(); - } - - /** - * @param value {@link #extractiondate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractiondate" gives direct access to the value - */ - public MissingTeethComponent setExtractiondateElement(DateType value) { - this.extractiondate = value; - return this; - } - - /** - * @return The date of the extraction either known from records or patient reported estimate. - */ - 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(Date value) { - if (value == null) - this.extractiondate = null; - else { - if (this.extractiondate == null) - this.extractiondate = new DateType(); - this.extractiondate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); - childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("extractiondate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractiondate)); - } - - public MissingTeethComponent copy() { - MissingTeethComponent dst = new MissingTeethComponent(); - copyValues(dst); - dst.tooth = tooth == null ? null : tooth.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.extractiondate = extractiondate == null ? null : extractiondate.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) - && (extractiondate == null || extractiondate.isEmpty()); - } - - } - - @Block() - public static class OrthodonticPlanComponent extends BackboneElement { - /** - * The intended start date for service. - */ - @Child(name="start", type={DateType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Start date", formalDefinition="The intended start date for service." ) - protected DateType start; - - /** - * The estimated first examination fee. - */ - @Child(name="examFee", type={Money.class}, order=2, min=0, max=1) - @Description(shortDefinition="First exam fee", formalDefinition="The estimated first examination fee." ) - protected Money examFee; - - /** - * The estimated diagnostic fee. - */ - @Child(name="diagnosticFee", type={Money.class}, order=3, min=0, max=1) - @Description(shortDefinition="Diagnostic phase fee", formalDefinition="The estimated diagnostic fee." ) - protected Money diagnosticFee; - - /** - * The estimated initial payment. - */ - @Child(name="initialPayment", type={Money.class}, order=4, min=0, max=1) - @Description(shortDefinition="Initial payment", formalDefinition="The estimated initial payment." ) - protected Money initialPayment; - - /** - * The estimated treatment duration in months. - */ - @Child(name="durationMonths", type={IntegerType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Duration in months", formalDefinition="The estimated treatment duration in months." ) - protected IntegerType durationMonths; - - /** - * The anticipated number of payments. - */ - @Child(name="paymentCount", type={IntegerType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Anticipated number of payments", formalDefinition="The anticipated number of payments." ) - protected IntegerType paymentCount; - - /** - * The anticipated payment amount. - */ - @Child(name="periodicPayment", type={Money.class}, order=7, min=0, max=1) - @Description(shortDefinition="Anticipated payment", formalDefinition="The anticipated payment amount." ) - protected Money periodicPayment; - - private static final long serialVersionUID = 1892827159L; - - public OrthodonticPlanComponent() { - super(); - } - - /** - * @return {@link #start} (The intended start date for service.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public DateType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.start"); - else if (Configuration.doAutoCreate()) - this.start = new DateType(); - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (The intended start date for service.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public OrthodonticPlanComponent setStartElement(DateType value) { - this.start = value; - return this; - } - - /** - * @return The intended start date for service. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value The intended start date for service. - */ - public OrthodonticPlanComponent setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new DateType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #examFee} (The estimated first examination fee.) - */ - public Money getExamFee() { - if (this.examFee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.examFee"); - else if (Configuration.doAutoCreate()) - this.examFee = new Money(); - return this.examFee; - } - - public boolean hasExamFee() { - return this.examFee != null && !this.examFee.isEmpty(); - } - - /** - * @param value {@link #examFee} (The estimated first examination fee.) - */ - public OrthodonticPlanComponent setExamFee(Money value) { - this.examFee = value; - return this; - } - - /** - * @return {@link #diagnosticFee} (The estimated diagnostic fee.) - */ - public Money getDiagnosticFee() { - if (this.diagnosticFee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.diagnosticFee"); - else if (Configuration.doAutoCreate()) - this.diagnosticFee = new Money(); - return this.diagnosticFee; - } - - public boolean hasDiagnosticFee() { - return this.diagnosticFee != null && !this.diagnosticFee.isEmpty(); - } - - /** - * @param value {@link #diagnosticFee} (The estimated diagnostic fee.) - */ - public OrthodonticPlanComponent setDiagnosticFee(Money value) { - this.diagnosticFee = value; - return this; - } - - /** - * @return {@link #initialPayment} (The estimated initial payment.) - */ - public Money getInitialPayment() { - if (this.initialPayment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.initialPayment"); - else if (Configuration.doAutoCreate()) - this.initialPayment = new Money(); - return this.initialPayment; - } - - public boolean hasInitialPayment() { - return this.initialPayment != null && !this.initialPayment.isEmpty(); - } - - /** - * @param value {@link #initialPayment} (The estimated initial payment.) - */ - public OrthodonticPlanComponent setInitialPayment(Money value) { - this.initialPayment = value; - return this; - } - - /** - * @return {@link #durationMonths} (The estimated treatment duration in months.). This is the underlying object with id, value and extensions. The accessor "getDurationMonths" gives direct access to the value - */ - public IntegerType getDurationMonthsElement() { - if (this.durationMonths == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.durationMonths"); - else if (Configuration.doAutoCreate()) - this.durationMonths = new IntegerType(); - return this.durationMonths; - } - - public boolean hasDurationMonthsElement() { - return this.durationMonths != null && !this.durationMonths.isEmpty(); - } - - public boolean hasDurationMonths() { - return this.durationMonths != null && !this.durationMonths.isEmpty(); - } - - /** - * @param value {@link #durationMonths} (The estimated treatment duration in months.). This is the underlying object with id, value and extensions. The accessor "getDurationMonths" gives direct access to the value - */ - public OrthodonticPlanComponent setDurationMonthsElement(IntegerType value) { - this.durationMonths = value; - return this; - } - - /** - * @return The estimated treatment duration in months. - */ - public int getDurationMonths() { - return this.durationMonths == null ? null : this.durationMonths.getValue(); - } - - /** - * @param value The estimated treatment duration in months. - */ - public OrthodonticPlanComponent setDurationMonths(int value) { - if (value == -1) - this.durationMonths = null; - else { - if (this.durationMonths == null) - this.durationMonths = new IntegerType(); - this.durationMonths.setValue(value); - } - return this; - } - - /** - * @return {@link #paymentCount} (The anticipated number of payments.). This is the underlying object with id, value and extensions. The accessor "getPaymentCount" gives direct access to the value - */ - public IntegerType getPaymentCountElement() { - if (this.paymentCount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.paymentCount"); - else if (Configuration.doAutoCreate()) - this.paymentCount = new IntegerType(); - return this.paymentCount; - } - - public boolean hasPaymentCountElement() { - return this.paymentCount != null && !this.paymentCount.isEmpty(); - } - - public boolean hasPaymentCount() { - return this.paymentCount != null && !this.paymentCount.isEmpty(); - } - - /** - * @param value {@link #paymentCount} (The anticipated number of payments.). This is the underlying object with id, value and extensions. The accessor "getPaymentCount" gives direct access to the value - */ - public OrthodonticPlanComponent setPaymentCountElement(IntegerType value) { - this.paymentCount = value; - return this; - } - - /** - * @return The anticipated number of payments. - */ - public int getPaymentCount() { - return this.paymentCount == null ? null : this.paymentCount.getValue(); - } - - /** - * @param value The anticipated number of payments. - */ - public OrthodonticPlanComponent setPaymentCount(int value) { - if (value == -1) - this.paymentCount = null; - else { - if (this.paymentCount == null) - this.paymentCount = new IntegerType(); - this.paymentCount.setValue(value); - } - return this; - } - - /** - * @return {@link #periodicPayment} (The anticipated payment amount.) - */ - public Money getPeriodicPayment() { - if (this.periodicPayment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrthodonticPlanComponent.periodicPayment"); - else if (Configuration.doAutoCreate()) - this.periodicPayment = new Money(); - return this.periodicPayment; - } - - public boolean hasPeriodicPayment() { - return this.periodicPayment != null && !this.periodicPayment.isEmpty(); - } - - /** - * @param value {@link #periodicPayment} (The anticipated payment amount.) - */ - public OrthodonticPlanComponent setPeriodicPayment(Money value) { - this.periodicPayment = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "date", "The intended start date for service.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("examFee", "Money", "The estimated first examination fee.", 0, java.lang.Integer.MAX_VALUE, examFee)); - childrenList.add(new Property("diagnosticFee", "Money", "The estimated diagnostic fee.", 0, java.lang.Integer.MAX_VALUE, diagnosticFee)); - childrenList.add(new Property("initialPayment", "Money", "The estimated initial payment.", 0, java.lang.Integer.MAX_VALUE, initialPayment)); - childrenList.add(new Property("durationMonths", "integer", "The estimated treatment duration in months.", 0, java.lang.Integer.MAX_VALUE, durationMonths)); - childrenList.add(new Property("paymentCount", "integer", "The anticipated number of payments.", 0, java.lang.Integer.MAX_VALUE, paymentCount)); - childrenList.add(new Property("periodicPayment", "Money", "The anticipated payment amount.", 0, java.lang.Integer.MAX_VALUE, periodicPayment)); - } - - public OrthodonticPlanComponent copy() { - OrthodonticPlanComponent dst = new OrthodonticPlanComponent(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.examFee = examFee == null ? null : examFee.copy(); - dst.diagnosticFee = diagnosticFee == null ? null : diagnosticFee.copy(); - dst.initialPayment = initialPayment == null ? null : initialPayment.copy(); - dst.durationMonths = durationMonths == null ? null : durationMonths.copy(); - dst.paymentCount = paymentCount == null ? null : paymentCount.copy(); - dst.periodicPayment = periodicPayment == null ? null : periodicPayment.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (examFee == null || examFee.isEmpty()) - && (diagnosticFee == null || diagnosticFee.isEmpty()) && (initialPayment == null || initialPayment.isEmpty()) - && (durationMonths == null || durationMonths.isEmpty()) && (paymentCount == null || paymentCount.isEmpty()) - && (periodicPayment == null || periodicPayment.isEmpty()); - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; - - /** - * Second tier of goods and services. - */ - @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 detail; - - /** - * The materials and placement date of prior fixed prosthesis. - */ - @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 = 1518140870L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 ItemsComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - 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(); - 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(); - 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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public DateType getServiceDateElement() { - if (this.serviceDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); - else if (Configuration.doAutoCreate()) - this.serviceDate = new DateType(); - return this.serviceDate; - } - - public boolean hasServiceDateElement() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - public boolean hasServiceDate() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - /** - * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public ItemsComponent setServiceDateElement(DateType value) { - this.serviceDate = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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(Date value) { - if (value == null) - this.serviceDate = null; - else { - if (this.serviceDate == null) - this.serviceDate = new DateType(); - this.serviceDate.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public ItemsComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubsite() { - if (this.subsite == null) - this.subsite = new ArrayList(); - return this.subsite; - } - - public boolean hasSubsite() { - if (this.subsite == null) - return false; - for (Coding item : this.subsite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubsite() { //3 - Coding t = new Coding(); - if (this.subsite == null) - this.subsite = new ArrayList(); - this.subsite.add(t); - return t; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - /** - * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ProsthesisComponent getProsthesis() { - if (this.prosthesis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); - else if (Configuration.doAutoCreate()) - this.prosthesis = new ProsthesisComponent(); - return this.prosthesis; - } - - public boolean hasProsthesis() { - return this.prosthesis != null && !this.prosthesis.isEmpty(); - } - - /** - * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ItemsComponent setProsthesis(ProsthesisComponent value) { - this.prosthesis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - 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(); - 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(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subsite != null) { - dst.subsite = new ArrayList(); - for (Coding i : subsite) - dst.subsite.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) - && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty()) - ; - } - - } - - @Block() - public static class DetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * 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=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Total additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Third tier of goods and services. - */ - @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -342502025L; - - public DetailComponent() { - super(); - } - - public DetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public DetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="service", type={Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) - 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Net additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - private static final long serialVersionUID = 122809194L; - - public SubDetailComponent() { - super(); - } - - public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addtional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public SubDetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()); - } - - } - - @Block() - public static class ProsthesisComponent extends BackboneElement { - /** - * Is this the initial placement of a fixed prosthesis?. - */ - @Child(name="initial", type={BooleanType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Is this the initial service", formalDefinition="Is this the initial placement of a fixed prosthesis?." ) - protected BooleanType initial; - - /** - * Date of the initial placement. - */ - @Child(name="priorDate", type={DateType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) - protected DateType priorDate; - - /** - * Material of the prior denture or bridge prosthesis. (Oral). - */ - @Child(name="priorMaterial", type={Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) - protected Coding priorMaterial; - - private static final long serialVersionUID = 1739349641L; - - public ProsthesisComponent() { - super(); - } - - /** - * @return {@link #initial} (Is this the initial placement of a fixed prosthesis?.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public BooleanType getInitialElement() { - if (this.initial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.initial"); - else if (Configuration.doAutoCreate()) - this.initial = new BooleanType(); - return this.initial; - } - - public boolean hasInitialElement() { - return this.initial != null && !this.initial.isEmpty(); - } - - public boolean hasInitial() { - return this.initial != null && !this.initial.isEmpty(); - } - - /** - * @param value {@link #initial} (Is this the initial placement of a fixed prosthesis?.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public ProsthesisComponent setInitialElement(BooleanType value) { - this.initial = value; - return this; - } - - /** - * @return Is this the initial placement of a fixed prosthesis?. - */ - public boolean getInitial() { - return this.initial == null ? false : this.initial.getValue(); - } - - /** - * @param value Is this the initial placement of a fixed prosthesis?. - */ - public ProsthesisComponent setInitial(boolean value) { - if (value == false) - this.initial = null; - else { - if (this.initial == null) - this.initial = new BooleanType(); - this.initial.setValue(value); - } - return this; - } - - /** - * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public DateType getPriorDateElement() { - if (this.priorDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); - else if (Configuration.doAutoCreate()) - this.priorDate = new DateType(); - return this.priorDate; - } - - public boolean hasPriorDateElement() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - public boolean hasPriorDate() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - /** - * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public ProsthesisComponent setPriorDateElement(DateType value) { - this.priorDate = value; - return this; - } - - /** - * @return Date of the initial placement. - */ - public Date getPriorDate() { - return this.priorDate == null ? null : this.priorDate.getValue(); - } - - /** - * @param value Date of the initial placement. - */ - public ProsthesisComponent setPriorDate(Date value) { - if (value == null) - this.priorDate = null; - else { - if (this.priorDate == null) - this.priorDate = new DateType(); - this.priorDate.setValue(value); - } - return this; - } - - /** - * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public Coding getPriorMaterial() { - if (this.priorMaterial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); - else if (Configuration.doAutoCreate()) - this.priorMaterial = new Coding(); - return this.priorMaterial; - } - - public boolean hasPriorMaterial() { - return this.priorMaterial != null && !this.priorMaterial.isEmpty(); - } - - /** - * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public ProsthesisComponent setPriorMaterial(Coding value) { - this.priorMaterial = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("initial", "boolean", "Is this the initial placement of a fixed prosthesis?.", 0, java.lang.Integer.MAX_VALUE, initial)); - childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); - childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); - } - - public ProsthesisComponent copy() { - ProsthesisComponent dst = new ProsthesisComponent(); - copyValues(dst); - dst.initial = initial == null ? null : initial.copy(); - dst.priorDate = priorDate == null ? null : priorDate.copy(); - dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) - && (priorMaterial == null || priorMaterial.isEmpty()); - } - - } - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) - */ - protected Organization targetTarget; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Organization organizationTarget; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - protected Practitioner entererTarget; - - /** - * Facility where the services were provided. - */ - @Child(name="facility", type={Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Reference facility; - - /** - * The actual object that is the target of the reference (Facility where the services were provided.) - */ - protected Location facilityTarget; - - /** - * Theparty to be reimbused for the services. - */ - @Child(name="payee", type={}, order=11, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - protected ReferralRequest referralTarget; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * List of patient conditions for which care is sought. - */ - @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) - protected List condition; - - /** - * Patient Resource. - */ - @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient patientTarget; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name="school", type={StringType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * Date of an accident which these services are addessing. - */ - @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) - @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) - protected DateType accident; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) - @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - */ - @Child(name="missingteeth", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Missing Teeth", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) - protected List missingteeth; - - /** - * The highlevel detail sof an Orthodonic Treatment Plan. - */ - @Child(name="orthoPlan", type={}, order=23, min=0, max=1) - @Description(shortDefinition="Orthodontic Treatment Plan", formalDefinition="The highlevel detail sof an Orthodonic Treatment Plan." ) - protected OrthodonticPlanComponent orthoPlan; - - /** - * First tier of goods and services. - */ - @Child(name="item", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name="additionalMaterials", type={Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) - @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 additionalMaterials; - - private static final long serialVersionUID = -748490719L; - - public OralHealthClaim() { - super(); - } - - public OralHealthClaim(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public OralHealthClaim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public OralHealthClaim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public OralHealthClaim setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public OralHealthClaim setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public OralHealthClaim setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public OralHealthClaim setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public OralHealthClaim setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 bill, claim pre-determination, pre-authorization.) - */ - public OralHealthClaim setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public OralHealthClaim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public UseLink getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public OralHealthClaim setUse(UseLink value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(UseLink.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public OralHealthClaim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public OralHealthClaim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public OralHealthClaim setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); - return this.entererTarget; - } - - /** - * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public OralHealthClaim setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacility() { - if (this.facility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public OralHealthClaim setFacility(Reference value) { - this.facility = value; - return this; - } - - /** - * @return {@link #facility} 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. (Facility where the services were provided.) - */ - public Location getFacilityTarget() { - if (this.facilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); - return this.facilityTarget; - } - - /** - * @param value {@link #facility} 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. (Facility where the services were provided.) - */ - public OralHealthClaim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - - /** - * @return {@link #payee} (Theparty to be reimbused for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (Theparty to be reimbused for the services.) - */ - public OralHealthClaim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public OralHealthClaim setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); - return this.referralTarget; - } - - /** - * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public OralHealthClaim setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Coding item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - // syntactic sugar - public Coding addCondition() { //3 - Coding t = new Coding(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.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} (Patient Resource.) - */ - public OralHealthClaim 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. (Patient Resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.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. (Patient Resource.) - */ - public OralHealthClaim setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public OralHealthClaim setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public OralHealthClaim setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public DateType getAccidentElement() { - if (this.accident == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.accident"); - else if (Configuration.doAutoCreate()) - this.accident = new DateType(); - return this.accident; - } - - public boolean hasAccidentElement() { - return this.accident != null && !this.accident.isEmpty(); - } - - public boolean hasAccident() { - return this.accident != null && !this.accident.isEmpty(); - } - - /** - * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public OralHealthClaim setAccidentElement(DateType value) { - this.accident = value; - return this; - } - - /** - * @return Date of an accident which these services are addessing. - */ - 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(Date value) { - if (value == null) - this.accident = null; - else { - if (this.accident == null) - this.accident = new DateType(); - this.accident.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public OralHealthClaim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - /** - * @return {@link #missingteeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - public List getMissingteeth() { - if (this.missingteeth == null) - this.missingteeth = new ArrayList(); - return this.missingteeth; - } - - public boolean hasMissingteeth() { - if (this.missingteeth == null) - return false; - for (MissingTeethComponent item : this.missingteeth) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #missingteeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - // syntactic sugar - public MissingTeethComponent addMissingteeth() { //3 - MissingTeethComponent t = new MissingTeethComponent(); - if (this.missingteeth == null) - this.missingteeth = new ArrayList(); - this.missingteeth.add(t); - return t; - } - - /** - * @return {@link #orthoPlan} (The highlevel detail sof an Orthodonic Treatment Plan.) - */ - public OrthodonticPlanComponent getOrthoPlan() { - if (this.orthoPlan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.orthoPlan"); - else if (Configuration.doAutoCreate()) - this.orthoPlan = new OrthodonticPlanComponent(); - return this.orthoPlan; - } - - public boolean hasOrthoPlan() { - return this.orthoPlan != null && !this.orthoPlan.isEmpty(); - } - - /** - * @param value {@link #orthoPlan} (The highlevel detail sof an Orthodonic Treatment Plan.) - */ - public OralHealthClaim setOrthoPlan(OrthodonticPlanComponent value) { - this.orthoPlan = value; - return this; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterials() { - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - return this.additionalMaterials; - } - - public boolean hasAdditionalMaterials() { - if (this.additionalMaterials == null) - return false; - for (Coding item : this.additionalMaterials) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterials() { //3 - Coding t = new Coding(); - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("missingteeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingteeth)); - childrenList.add(new Property("orthoPlan", "", "The highlevel detail sof an Orthodonic Treatment Plan.", 0, java.lang.Integer.MAX_VALUE, orthoPlan)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); - } - - public OralHealthClaim copy() { - OralHealthClaim dst = new OralHealthClaim(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Coding i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.accident = accident == null ? null : accident.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (missingteeth != null) { - dst.missingteeth = new ArrayList(); - for (MissingTeethComponent i : missingteeth) - dst.missingteeth.add(i.copy()); - }; - dst.orthoPlan = orthoPlan == null ? null : orthoPlan.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additionalMaterials != null) { - dst.additionalMaterials = new ArrayList(); - for (Coding i : additionalMaterials) - dst.additionalMaterials.add(i.copy()); - }; - return dst; - } - - protected OralHealthClaim typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) - && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (missingteeth == null || missingteeth.isEmpty()) && (orthoPlan == null || orthoPlan.isEmpty()) - && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OralHealthClaim; - } - - @SearchParamDefinition(name="patient", path="OralHealthClaim.patient", description="Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="priority", path="OralHealthClaim.priority", description="Processing priority requested", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="use", path="OralHealthClaim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - @SearchParamDefinition(name="identifier", path="OralHealthClaim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="OralHealthClaim", profile="http://hl7.org/fhir/Profile/OralHealthClaim") +public class OralHealthClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} 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 Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} 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 Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + 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)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class MissingTeethComponent extends BackboneElement { + /** + * The code identifying which tooth is missing. + */ + @Child(name="tooth", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) + protected Coding tooth; + + /** + * Missing reason may be: E-extraction, O-other. + */ + @Child(name="reason", type={Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) + protected Coding reason; + + /** + * The date of the extraction either known from records or patient reported estimate. + */ + @Child(name="extractiondate", type={DateType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) + protected DateType extractiondate; + + private static final long serialVersionUID = -1311739967L; + + public MissingTeethComponent() { + super(); + } + + public MissingTeethComponent(Coding tooth) { + super(); + this.tooth = tooth; + } + + /** + * @return {@link #tooth} (The code identifying which tooth is missing.) + */ + public Coding getTooth() { + if (this.tooth == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); + else if (Configuration.doAutoCreate()) + this.tooth = new Coding(); + return this.tooth; + } + + public boolean hasTooth() { + return this.tooth != null && !this.tooth.isEmpty(); + } + + /** + * @param value {@link #tooth} (The code identifying which tooth is missing.) + */ + public MissingTeethComponent setTooth(Coding value) { + this.tooth = value; + return this; + } + + /** + * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public Coding getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new Coding(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) + */ + public MissingTeethComponent setReason(Coding value) { + this.reason = value; + return this; + } + + /** + * @return {@link #extractiondate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractiondate" gives direct access to the value + */ + public DateType getExtractiondateElement() { + if (this.extractiondate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create MissingTeethComponent.extractiondate"); + else if (Configuration.doAutoCreate()) + this.extractiondate = new DateType(); + return this.extractiondate; + } + + public boolean hasExtractiondateElement() { + return this.extractiondate != null && !this.extractiondate.isEmpty(); + } + + public boolean hasExtractiondate() { + return this.extractiondate != null && !this.extractiondate.isEmpty(); + } + + /** + * @param value {@link #extractiondate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractiondate" gives direct access to the value + */ + public MissingTeethComponent setExtractiondateElement(DateType value) { + this.extractiondate = value; + return this; + } + + /** + * @return The date of the extraction either known from records or patient reported estimate. + */ + 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(Date value) { + if (value == null) + this.extractiondate = null; + else { + if (this.extractiondate == null) + this.extractiondate = new DateType(); + this.extractiondate.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); + childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("extractiondate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractiondate)); + } + + public MissingTeethComponent copy() { + MissingTeethComponent dst = new MissingTeethComponent(); + copyValues(dst); + dst.tooth = tooth == null ? null : tooth.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.extractiondate = extractiondate == null ? null : extractiondate.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) + && (extractiondate == null || extractiondate.isEmpty()); + } + + } + + @Block() + public static class OrthodonticPlanComponent extends BackboneElement { + /** + * The intended start date for service. + */ + @Child(name="start", type={DateType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Start date", formalDefinition="The intended start date for service." ) + protected DateType start; + + /** + * The estimated first examination fee. + */ + @Child(name="examFee", type={Money.class}, order=2, min=0, max=1) + @Description(shortDefinition="First exam fee", formalDefinition="The estimated first examination fee." ) + protected Money examFee; + + /** + * The estimated diagnostic fee. + */ + @Child(name="diagnosticFee", type={Money.class}, order=3, min=0, max=1) + @Description(shortDefinition="Diagnostic phase fee", formalDefinition="The estimated diagnostic fee." ) + protected Money diagnosticFee; + + /** + * The estimated initial payment. + */ + @Child(name="initialPayment", type={Money.class}, order=4, min=0, max=1) + @Description(shortDefinition="Initial payment", formalDefinition="The estimated initial payment." ) + protected Money initialPayment; + + /** + * The estimated treatment duration in months. + */ + @Child(name="durationMonths", type={IntegerType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Duration in months", formalDefinition="The estimated treatment duration in months." ) + protected IntegerType durationMonths; + + /** + * The anticipated number of payments. + */ + @Child(name="paymentCount", type={IntegerType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Anticipated number of payments", formalDefinition="The anticipated number of payments." ) + protected IntegerType paymentCount; + + /** + * The anticipated payment amount. + */ + @Child(name="periodicPayment", type={Money.class}, order=7, min=0, max=1) + @Description(shortDefinition="Anticipated payment", formalDefinition="The anticipated payment amount." ) + protected Money periodicPayment; + + private static final long serialVersionUID = 1892827159L; + + public OrthodonticPlanComponent() { + super(); + } + + /** + * @return {@link #start} (The intended start date for service.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public DateType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.start"); + else if (Configuration.doAutoCreate()) + this.start = new DateType(); + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (The intended start date for service.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public OrthodonticPlanComponent setStartElement(DateType value) { + this.start = value; + return this; + } + + /** + * @return The intended start date for service. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value The intended start date for service. + */ + public OrthodonticPlanComponent setStart(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new DateType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #examFee} (The estimated first examination fee.) + */ + public Money getExamFee() { + if (this.examFee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.examFee"); + else if (Configuration.doAutoCreate()) + this.examFee = new Money(); + return this.examFee; + } + + public boolean hasExamFee() { + return this.examFee != null && !this.examFee.isEmpty(); + } + + /** + * @param value {@link #examFee} (The estimated first examination fee.) + */ + public OrthodonticPlanComponent setExamFee(Money value) { + this.examFee = value; + return this; + } + + /** + * @return {@link #diagnosticFee} (The estimated diagnostic fee.) + */ + public Money getDiagnosticFee() { + if (this.diagnosticFee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.diagnosticFee"); + else if (Configuration.doAutoCreate()) + this.diagnosticFee = new Money(); + return this.diagnosticFee; + } + + public boolean hasDiagnosticFee() { + return this.diagnosticFee != null && !this.diagnosticFee.isEmpty(); + } + + /** + * @param value {@link #diagnosticFee} (The estimated diagnostic fee.) + */ + public OrthodonticPlanComponent setDiagnosticFee(Money value) { + this.diagnosticFee = value; + return this; + } + + /** + * @return {@link #initialPayment} (The estimated initial payment.) + */ + public Money getInitialPayment() { + if (this.initialPayment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.initialPayment"); + else if (Configuration.doAutoCreate()) + this.initialPayment = new Money(); + return this.initialPayment; + } + + public boolean hasInitialPayment() { + return this.initialPayment != null && !this.initialPayment.isEmpty(); + } + + /** + * @param value {@link #initialPayment} (The estimated initial payment.) + */ + public OrthodonticPlanComponent setInitialPayment(Money value) { + this.initialPayment = value; + return this; + } + + /** + * @return {@link #durationMonths} (The estimated treatment duration in months.). This is the underlying object with id, value and extensions. The accessor "getDurationMonths" gives direct access to the value + */ + public IntegerType getDurationMonthsElement() { + if (this.durationMonths == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.durationMonths"); + else if (Configuration.doAutoCreate()) + this.durationMonths = new IntegerType(); + return this.durationMonths; + } + + public boolean hasDurationMonthsElement() { + return this.durationMonths != null && !this.durationMonths.isEmpty(); + } + + public boolean hasDurationMonths() { + return this.durationMonths != null && !this.durationMonths.isEmpty(); + } + + /** + * @param value {@link #durationMonths} (The estimated treatment duration in months.). This is the underlying object with id, value and extensions. The accessor "getDurationMonths" gives direct access to the value + */ + public OrthodonticPlanComponent setDurationMonthsElement(IntegerType value) { + this.durationMonths = value; + return this; + } + + /** + * @return The estimated treatment duration in months. + */ + public int getDurationMonths() { + return this.durationMonths == null ? null : this.durationMonths.getValue(); + } + + /** + * @param value The estimated treatment duration in months. + */ + public OrthodonticPlanComponent setDurationMonths(int value) { + if (value == -1) + this.durationMonths = null; + else { + if (this.durationMonths == null) + this.durationMonths = new IntegerType(); + this.durationMonths.setValue(value); + } + return this; + } + + /** + * @return {@link #paymentCount} (The anticipated number of payments.). This is the underlying object with id, value and extensions. The accessor "getPaymentCount" gives direct access to the value + */ + public IntegerType getPaymentCountElement() { + if (this.paymentCount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.paymentCount"); + else if (Configuration.doAutoCreate()) + this.paymentCount = new IntegerType(); + return this.paymentCount; + } + + public boolean hasPaymentCountElement() { + return this.paymentCount != null && !this.paymentCount.isEmpty(); + } + + public boolean hasPaymentCount() { + return this.paymentCount != null && !this.paymentCount.isEmpty(); + } + + /** + * @param value {@link #paymentCount} (The anticipated number of payments.). This is the underlying object with id, value and extensions. The accessor "getPaymentCount" gives direct access to the value + */ + public OrthodonticPlanComponent setPaymentCountElement(IntegerType value) { + this.paymentCount = value; + return this; + } + + /** + * @return The anticipated number of payments. + */ + public int getPaymentCount() { + return this.paymentCount == null ? null : this.paymentCount.getValue(); + } + + /** + * @param value The anticipated number of payments. + */ + public OrthodonticPlanComponent setPaymentCount(int value) { + if (value == -1) + this.paymentCount = null; + else { + if (this.paymentCount == null) + this.paymentCount = new IntegerType(); + this.paymentCount.setValue(value); + } + return this; + } + + /** + * @return {@link #periodicPayment} (The anticipated payment amount.) + */ + public Money getPeriodicPayment() { + if (this.periodicPayment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrthodonticPlanComponent.periodicPayment"); + else if (Configuration.doAutoCreate()) + this.periodicPayment = new Money(); + return this.periodicPayment; + } + + public boolean hasPeriodicPayment() { + return this.periodicPayment != null && !this.periodicPayment.isEmpty(); + } + + /** + * @param value {@link #periodicPayment} (The anticipated payment amount.) + */ + public OrthodonticPlanComponent setPeriodicPayment(Money value) { + this.periodicPayment = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "date", "The intended start date for service.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("examFee", "Money", "The estimated first examination fee.", 0, java.lang.Integer.MAX_VALUE, examFee)); + childrenList.add(new Property("diagnosticFee", "Money", "The estimated diagnostic fee.", 0, java.lang.Integer.MAX_VALUE, diagnosticFee)); + childrenList.add(new Property("initialPayment", "Money", "The estimated initial payment.", 0, java.lang.Integer.MAX_VALUE, initialPayment)); + childrenList.add(new Property("durationMonths", "integer", "The estimated treatment duration in months.", 0, java.lang.Integer.MAX_VALUE, durationMonths)); + childrenList.add(new Property("paymentCount", "integer", "The anticipated number of payments.", 0, java.lang.Integer.MAX_VALUE, paymentCount)); + childrenList.add(new Property("periodicPayment", "Money", "The anticipated payment amount.", 0, java.lang.Integer.MAX_VALUE, periodicPayment)); + } + + public OrthodonticPlanComponent copy() { + OrthodonticPlanComponent dst = new OrthodonticPlanComponent(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.examFee = examFee == null ? null : examFee.copy(); + dst.diagnosticFee = diagnosticFee == null ? null : diagnosticFee.copy(); + dst.initialPayment = initialPayment == null ? null : initialPayment.copy(); + dst.durationMonths = durationMonths == null ? null : durationMonths.copy(); + dst.paymentCount = paymentCount == null ? null : paymentCount.copy(); + dst.periodicPayment = periodicPayment == null ? null : periodicPayment.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (examFee == null || examFee.isEmpty()) + && (diagnosticFee == null || diagnosticFee.isEmpty()) && (initialPayment == null || initialPayment.isEmpty()) + && (durationMonths == null || durationMonths.isEmpty()) && (paymentCount == null || paymentCount.isEmpty()) + && (periodicPayment == null || periodicPayment.isEmpty()); + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; + + /** + * Second tier of goods and services. + */ + @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 detail; + + /** + * The materials and placement date of prior fixed prosthesis. + */ + @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 = 1518140870L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + 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(); + 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(); + 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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + /** + * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ProsthesisComponent getProsthesis() { + if (this.prosthesis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); + else if (Configuration.doAutoCreate()) + this.prosthesis = new ProsthesisComponent(); + return this.prosthesis; + } + + public boolean hasProsthesis() { + return this.prosthesis != null && !this.prosthesis.isEmpty(); + } + + /** + * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) + */ + public ItemsComponent setProsthesis(ProsthesisComponent value) { + this.prosthesis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + 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(); + 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(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty()) + ; + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * 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=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Total additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Net additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()); + } + + } + + @Block() + public static class ProsthesisComponent extends BackboneElement { + /** + * Is this the initial placement of a fixed prosthesis?. + */ + @Child(name="initial", type={BooleanType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Is this the initial service", formalDefinition="Is this the initial placement of a fixed prosthesis?." ) + protected BooleanType initial; + + /** + * Date of the initial placement. + */ + @Child(name="priorDate", type={DateType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) + protected DateType priorDate; + + /** + * Material of the prior denture or bridge prosthesis. (Oral). + */ + @Child(name="priorMaterial", type={Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) + protected Coding priorMaterial; + + private static final long serialVersionUID = 1739349641L; + + public ProsthesisComponent() { + super(); + } + + /** + * @return {@link #initial} (Is this the initial placement of a fixed prosthesis?.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public BooleanType getInitialElement() { + if (this.initial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.initial"); + else if (Configuration.doAutoCreate()) + this.initial = new BooleanType(); + return this.initial; + } + + public boolean hasInitialElement() { + return this.initial != null && !this.initial.isEmpty(); + } + + public boolean hasInitial() { + return this.initial != null && !this.initial.isEmpty(); + } + + /** + * @param value {@link #initial} (Is this the initial placement of a fixed prosthesis?.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value + */ + public ProsthesisComponent setInitialElement(BooleanType value) { + this.initial = value; + return this; + } + + /** + * @return Is this the initial placement of a fixed prosthesis?. + */ + public boolean getInitial() { + return this.initial == null ? false : this.initial.getValue(); + } + + /** + * @param value Is this the initial placement of a fixed prosthesis?. + */ + public ProsthesisComponent setInitial(boolean value) { + if (value == false) + this.initial = null; + else { + if (this.initial == null) + this.initial = new BooleanType(); + this.initial.setValue(value); + } + return this; + } + + /** + * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public DateType getPriorDateElement() { + if (this.priorDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); + else if (Configuration.doAutoCreate()) + this.priorDate = new DateType(); + return this.priorDate; + } + + public boolean hasPriorDateElement() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + public boolean hasPriorDate() { + return this.priorDate != null && !this.priorDate.isEmpty(); + } + + /** + * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value + */ + public ProsthesisComponent setPriorDateElement(DateType value) { + this.priorDate = value; + return this; + } + + /** + * @return Date of the initial placement. + */ + public Date getPriorDate() { + return this.priorDate == null ? null : this.priorDate.getValue(); + } + + /** + * @param value Date of the initial placement. + */ + public ProsthesisComponent setPriorDate(Date value) { + if (value == null) + this.priorDate = null; + else { + if (this.priorDate == null) + this.priorDate = new DateType(); + this.priorDate.setValue(value); + } + return this; + } + + /** + * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public Coding getPriorMaterial() { + if (this.priorMaterial == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); + else if (Configuration.doAutoCreate()) + this.priorMaterial = new Coding(); + return this.priorMaterial; + } + + public boolean hasPriorMaterial() { + return this.priorMaterial != null && !this.priorMaterial.isEmpty(); + } + + /** + * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) + */ + public ProsthesisComponent setPriorMaterial(Coding value) { + this.priorMaterial = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("initial", "boolean", "Is this the initial placement of a fixed prosthesis?.", 0, java.lang.Integer.MAX_VALUE, initial)); + childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); + childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); + } + + public ProsthesisComponent copy() { + ProsthesisComponent dst = new ProsthesisComponent(); + copyValues(dst); + dst.initial = initial == null ? null : initial.copy(); + dst.priorDate = priorDate == null ? null : priorDate.copy(); + dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) + && (priorMaterial == null || priorMaterial.isEmpty()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. + */ + @Child(name="missingteeth", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Missing Teeth", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) + protected List missingteeth; + + /** + * The highlevel detail sof an Orthodonic Treatment Plan. + */ + @Child(name="orthoPlan", type={}, order=23, min=0, max=1) + @Description(shortDefinition="Orthodontic Treatment Plan", formalDefinition="The highlevel detail sof an Orthodonic Treatment Plan." ) + protected OrthodonticPlanComponent orthoPlan; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) + @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 additionalMaterials; + + private static final long serialVersionUID = -748490719L; + + public OralHealthClaim() { + super(); + } + + public OralHealthClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public OralHealthClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public OralHealthClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public OralHealthClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public OralHealthClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public OralHealthClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public OralHealthClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public OralHealthClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 bill, claim pre-determination, pre-authorization.) + */ + public OralHealthClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public OralHealthClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public OralHealthClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public OralHealthClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public OralHealthClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public OralHealthClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public OralHealthClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public OralHealthClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} 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. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} 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. (Facility where the services were provided.) + */ + public OralHealthClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public OralHealthClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public OralHealthClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public OralHealthClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.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} (Patient Resource.) + */ + public OralHealthClaim 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. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.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. (Patient Resource.) + */ + public OralHealthClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public OralHealthClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public OralHealthClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public OralHealthClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + 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(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public OralHealthClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #missingteeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + public List getMissingteeth() { + if (this.missingteeth == null) + this.missingteeth = new ArrayList(); + return this.missingteeth; + } + + public boolean hasMissingteeth() { + if (this.missingteeth == null) + return false; + for (MissingTeethComponent item : this.missingteeth) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #missingteeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) + */ + // syntactic sugar + public MissingTeethComponent addMissingteeth() { //3 + MissingTeethComponent t = new MissingTeethComponent(); + if (this.missingteeth == null) + this.missingteeth = new ArrayList(); + this.missingteeth.add(t); + return t; + } + + /** + * @return {@link #orthoPlan} (The highlevel detail sof an Orthodonic Treatment Plan.) + */ + public OrthodonticPlanComponent getOrthoPlan() { + if (this.orthoPlan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OralHealthClaim.orthoPlan"); + else if (Configuration.doAutoCreate()) + this.orthoPlan = new OrthodonticPlanComponent(); + return this.orthoPlan; + } + + public boolean hasOrthoPlan() { + return this.orthoPlan != null && !this.orthoPlan.isEmpty(); + } + + /** + * @param value {@link #orthoPlan} (The highlevel detail sof an Orthodonic Treatment Plan.) + */ + public OralHealthClaim setOrthoPlan(OrthodonticPlanComponent value) { + this.orthoPlan = value; + return this; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("missingteeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingteeth)); + childrenList.add(new Property("orthoPlan", "", "The highlevel detail sof an Orthodonic Treatment Plan.", 0, java.lang.Integer.MAX_VALUE, orthoPlan)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public OralHealthClaim copy() { + OralHealthClaim dst = new OralHealthClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (missingteeth != null) { + dst.missingteeth = new ArrayList(); + for (MissingTeethComponent i : missingteeth) + dst.missingteeth.add(i.copy()); + }; + dst.orthoPlan = orthoPlan == null ? null : orthoPlan.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected OralHealthClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (missingteeth == null || missingteeth.isEmpty()) && (orthoPlan == null || orthoPlan.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OralHealthClaim; + } + + @SearchParamDefinition(name="patient", path="OralHealthClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="OralHealthClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="OralHealthClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="OralHealthClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java index d60a4b520a9..32190d29f0e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java @@ -20,651 +20,651 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * A request to perform an action. - */ -@ResourceDef(name="Order", profile="http://hl7.org/fhir/Profile/Order") -public class Order extends DomainResource { - - @Block() - public static class OrderWhenComponent extends BackboneElement { - /** - * Code specifies when request should be done. The code may simply be a priority code. - */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) - protected CodeableConcept code; - - /** - * A formal schedule. - */ - @Child(name="schedule", type={Timing.class}, order=2, min=0, max=1) - @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) - protected Timing schedule; - - private static final long serialVersionUID = 307115287L; - - public OrderWhenComponent() { - super(); - } - - /** - * @return {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderWhenComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) - */ - public OrderWhenComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #schedule} (A formal schedule.) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderWhenComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (A formal schedule.) - */ - public OrderWhenComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code specifies when request should be done. The code may simply be a priority code.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("schedule", "Timing", "A formal schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); - } - - public OrderWhenComponent copy() { - OrderWhenComponent dst = new OrderWhenComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) - ; - } - - } - - /** - * Identifiers assigned to this order by the orderer or by the receiver. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) - protected List identifier; - - /** - * When the order was made. - */ - @Child(name="date", type={DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="When the order was made", formalDefinition="When the order was made." ) - protected DateTimeType date; - - /** - * Patient this order is about. - */ - @Child(name="subject", type={Patient.class}, order=1, min=0, max=1) - @Description(shortDefinition="Patient this order is about", formalDefinition="Patient this order is about." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Patient this order is about.) - */ - protected Patient subjectTarget; - - /** - * Who initiated the order. - */ - @Child(name="source", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who initiated the order", formalDefinition="Who initiated the order." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Who initiated the order.) - */ - protected Practitioner sourceTarget; - - /** - * Who is intended to fulfill the order. - */ - @Child(name="target", type={Organization.class, Device.class, Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Who is intended to fulfill the order", formalDefinition="Who is intended to fulfill the order." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Who is intended to fulfill the order.) - */ - protected Resource targetTarget; - - /** - * Text - why the order was made. - */ - @Child(name="reason", type={CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Text - why the order was made", formalDefinition="Text - why the order was made." ) - protected Type reason; - - /** - * If required by policy. - */ - @Child(name="authority", type={}, order=5, min=0, max=1) - @Description(shortDefinition="If required by policy", formalDefinition="If required by policy." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (If required by policy.) - */ - protected Resource authorityTarget; - - /** - * When order should be fulfilled. - */ - @Child(name="when", type={}, order=6, min=0, max=1) - @Description(shortDefinition="When order should be fulfilled", formalDefinition="When order should be fulfilled." ) - protected OrderWhenComponent when; - - /** - * What action is being ordered. - */ - @Child(name="detail", type={}, order=7, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="What action is being ordered", formalDefinition="What action is being ordered." ) - protected List detail; - /** - * The actual objects that are the target of the reference (What action is being ordered.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = 400955487L; - - public Order() { - super(); - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this order by the orderer or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Order setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When the order was made. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When the order was made. - */ - public Order setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Patient this order is about.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.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} (Patient this order is about.) - */ - public Order 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. (Patient this order is about.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.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. (Patient this order is about.) - */ - public Order setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #source} (Who initiated the order.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Who initiated the order.) - */ - public Order setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} 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. (Who initiated the order.) - */ - public Practitioner getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Practitioner(); - return this.sourceTarget; - } - - /** - * @param value {@link #source} 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. (Who initiated the order.) - */ - public Order setSourceTarget(Practitioner value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #target} (Who is intended to fulfill the order.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Who is intended to fulfill the order.) - */ - public Order setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Who is intended to fulfill the order.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @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. (Who is intended to fulfill the order.) - */ - public Order setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public CodeableConcept getReasonCodeableConcept() throws Exception { - if (!(this.reason instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public Reference getReasonReference() throws Exception { - if (!(this.reason instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Text - why the order was made.) - */ - public Order setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #authority} (If required by policy.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (If required by policy.) - */ - public Order setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} 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. (If required by policy.) - */ - public Resource getAuthorityTarget() { - return this.authorityTarget; - } - - /** - * @param value {@link #authority} 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. (If required by policy.) - */ - public Order setAuthorityTarget(Resource value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #when} (When order should be fulfilled.) - */ - public OrderWhenComponent getWhen() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.when"); - else if (Configuration.doAutoCreate()) - this.when = new OrderWhenComponent(); - return this.when; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (When order should be fulfilled.) - */ - public Order setWhen(OrderWhenComponent value) { - this.when = value; - return this; - } - - /** - * @return {@link #detail} (What action is being ordered.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (What action is being ordered.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - /** - * @return {@link #detail} (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. What action is being ordered.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "When the order was made.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("subject", "Reference(Patient)", "Patient this order is about.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("source", "Reference(Practitioner)", "Who initiated the order.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target", "Reference(Organization|Device|Practitioner)", "Who is intended to fulfill the order.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Text - why the order was made.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("authority", "Reference(Any)", "If required by policy.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("when", "", "When order should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("detail", "Reference(Any)", "What action is being ordered.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public Order copy() { - Order dst = new Order(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.source = source == null ? null : source.copy(); - dst.target = target == null ? null : target.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.when = when == null ? null : when.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - protected Order typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) - && (reason == null || reason.isEmpty()) && (authority == null || authority.isEmpty()) && (when == null || when.isEmpty()) - && (detail == null || detail.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Order; - } - - @SearchParamDefinition(name="authority", path="Order.authority", description="If required by policy", type="reference" ) - public static final String SP_AUTHORITY = "authority"; - @SearchParamDefinition(name="detail", path="Order.detail", description="What action is being ordered", type="reference" ) - public static final String SP_DETAIL = "detail"; - @SearchParamDefinition(name="patient", path="Order.subject", description="Patient this order is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="source", path="Order.source", description="Who initiated the order", type="reference" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="subject", path="Order.subject", description="Patient this order is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="when", path="Order.when.schedule", description="A formal schedule", type="date" ) - public static final String SP_WHEN = "when"; - @SearchParamDefinition(name="target", path="Order.target", description="Who is intended to fulfill the order", type="reference" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="when_code", path="Order.when.code", description="Code specifies when request should be done. The code may simply be a priority code", type="token" ) - public static final String SP_WHENCODE = "when_code"; - @SearchParamDefinition(name="date", path="Order.date", description="When the order was made", type="date" ) - public static final String SP_DATE = "date"; - -} - + +/* + 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.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; +/** + * A request to perform an action. + */ +@ResourceDef(name="Order", profile="http://hl7.org/fhir/Profile/Order") +public class Order extends DomainResource { + + @Block() + public static class OrderWhenComponent extends BackboneElement { + /** + * Code specifies when request should be done. The code may simply be a priority code. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) + protected CodeableConcept code; + + /** + * A formal schedule. + */ + @Child(name="schedule", type={Timing.class}, order=2, min=0, max=1) + @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) + protected Timing schedule; + + private static final long serialVersionUID = 307115287L; + + public OrderWhenComponent() { + super(); + } + + /** + * @return {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderWhenComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) + */ + public OrderWhenComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #schedule} (A formal schedule.) + */ + public Timing getSchedule() { + if (this.schedule == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderWhenComponent.schedule"); + else if (Configuration.doAutoCreate()) + this.schedule = new Timing(); + return this.schedule; + } + + public boolean hasSchedule() { + return this.schedule != null && !this.schedule.isEmpty(); + } + + /** + * @param value {@link #schedule} (A formal schedule.) + */ + public OrderWhenComponent setSchedule(Timing value) { + this.schedule = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "Code specifies when request should be done. The code may simply be a priority code.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("schedule", "Timing", "A formal schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); + } + + public OrderWhenComponent copy() { + OrderWhenComponent dst = new OrderWhenComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.schedule = schedule == null ? null : schedule.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) + ; + } + + } + + /** + * Identifiers assigned to this order by the orderer or by the receiver. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) + protected List identifier; + + /** + * When the order was made. + */ + @Child(name="date", type={DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="When the order was made", formalDefinition="When the order was made." ) + protected DateTimeType date; + + /** + * Patient this order is about. + */ + @Child(name="subject", type={Patient.class}, order=1, min=0, max=1) + @Description(shortDefinition="Patient this order is about", formalDefinition="Patient this order is about." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Patient this order is about.) + */ + protected Patient subjectTarget; + + /** + * Who initiated the order. + */ + @Child(name="source", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who initiated the order", formalDefinition="Who initiated the order." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Who initiated the order.) + */ + protected Practitioner sourceTarget; + + /** + * Who is intended to fulfill the order. + */ + @Child(name="target", type={Organization.class, Device.class, Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Who is intended to fulfill the order", formalDefinition="Who is intended to fulfill the order." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Who is intended to fulfill the order.) + */ + protected Resource targetTarget; + + /** + * Text - why the order was made. + */ + @Child(name="reason", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Text - why the order was made", formalDefinition="Text - why the order was made." ) + protected Type reason; + + /** + * If required by policy. + */ + @Child(name="authority", type={}, order=5, min=0, max=1) + @Description(shortDefinition="If required by policy", formalDefinition="If required by policy." ) + protected Reference authority; + + /** + * The actual object that is the target of the reference (If required by policy.) + */ + protected Resource authorityTarget; + + /** + * When order should be fulfilled. + */ + @Child(name="when", type={}, order=6, min=0, max=1) + @Description(shortDefinition="When order should be fulfilled", formalDefinition="When order should be fulfilled." ) + protected OrderWhenComponent when; + + /** + * What action is being ordered. + */ + @Child(name="detail", type={}, order=7, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="What action is being ordered", formalDefinition="What action is being ordered." ) + protected List detail; + /** + * The actual objects that are the target of the reference (What action is being ordered.) + */ + protected List detailTarget; + + + private static final long serialVersionUID = 400955487L; + + public Order() { + super(); + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this order by the orderer or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Order setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return When the order was made. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value When the order was made. + */ + public Order setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (Patient this order is about.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.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} (Patient this order is about.) + */ + public Order 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. (Patient this order is about.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.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. (Patient this order is about.) + */ + public Order setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #source} (Who initiated the order.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Who initiated the order.) + */ + public Order setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} 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. (Who initiated the order.) + */ + public Practitioner getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Practitioner(); + return this.sourceTarget; + } + + /** + * @param value {@link #source} 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. (Who initiated the order.) + */ + public Order setSourceTarget(Practitioner value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #target} (Who is intended to fulfill the order.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Who is intended to fulfill the order.) + */ + public Order setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Who is intended to fulfill the order.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @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. (Who is intended to fulfill the order.) + */ + public Order setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public Type getReason() { + return this.reason; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public CodeableConcept getReasonCodeableConcept() throws Exception { + if (!(this.reason instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (CodeableConcept) this.reason; + } + + /** + * @return {@link #reason} (Text - why the order was made.) + */ + public Reference getReasonReference() throws Exception { + if (!(this.reason instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); + return (Reference) this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Text - why the order was made.) + */ + public Order setReason(Type value) { + this.reason = value; + return this; + } + + /** + * @return {@link #authority} (If required by policy.) + */ + public Reference getAuthority() { + if (this.authority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.authority"); + else if (Configuration.doAutoCreate()) + this.authority = new Reference(); + return this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (If required by policy.) + */ + public Order setAuthority(Reference value) { + this.authority = value; + return this; + } + + /** + * @return {@link #authority} 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. (If required by policy.) + */ + public Resource getAuthorityTarget() { + return this.authorityTarget; + } + + /** + * @param value {@link #authority} 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. (If required by policy.) + */ + public Order setAuthorityTarget(Resource value) { + this.authorityTarget = value; + return this; + } + + /** + * @return {@link #when} (When order should be fulfilled.) + */ + public OrderWhenComponent getWhen() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Order.when"); + else if (Configuration.doAutoCreate()) + this.when = new OrderWhenComponent(); + return this.when; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (When order should be fulfilled.) + */ + public Order setWhen(OrderWhenComponent value) { + this.when = value; + return this; + } + + /** + * @return {@link #detail} (What action is being ordered.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (Reference item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (What action is being ordered.) + */ + // syntactic sugar + public Reference addDetail() { //3 + Reference t = new Reference(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + /** + * @return {@link #detail} (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. What action is being ordered.) + */ + public List getDetailTarget() { + if (this.detailTarget == null) + this.detailTarget = new ArrayList(); + return this.detailTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("date", "dateTime", "When the order was made.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("subject", "Reference(Patient)", "Patient this order is about.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("source", "Reference(Practitioner)", "Who initiated the order.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("target", "Reference(Organization|Device|Practitioner)", "Who is intended to fulfill the order.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Text - why the order was made.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("authority", "Reference(Any)", "If required by policy.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("when", "", "When order should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("detail", "Reference(Any)", "What action is being ordered.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public Order copy() { + Order dst = new Order(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.source = source == null ? null : source.copy(); + dst.target = target == null ? null : target.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.when = when == null ? null : when.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (Reference i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + protected Order typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) + && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) + && (reason == null || reason.isEmpty()) && (authority == null || authority.isEmpty()) && (when == null || when.isEmpty()) + && (detail == null || detail.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Order; + } + + @SearchParamDefinition(name="authority", path="Order.authority", description="If required by policy", type="reference" ) + public static final String SP_AUTHORITY = "authority"; + @SearchParamDefinition(name="detail", path="Order.detail", description="What action is being ordered", type="reference" ) + public static final String SP_DETAIL = "detail"; + @SearchParamDefinition(name="patient", path="Order.subject", description="Patient this order is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="source", path="Order.source", description="Who initiated the order", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="subject", path="Order.subject", description="Patient this order is about", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="when", path="Order.when.schedule", description="A formal schedule", type="date" ) + public static final String SP_WHEN = "when"; + @SearchParamDefinition(name="target", path="Order.target", description="Who is intended to fulfill the order", type="reference" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="when_code", path="Order.when.code", description="Code specifies when request should be done. The code may simply be a priority code", type="token" ) + public static final String SP_WHENCODE = "when_code"; + @SearchParamDefinition(name="date", path="Order.date", description="When the order was made", type="date" ) + public static final String SP_DATE = "date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java index 680532a19b6..fdc45c55437 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java @@ -20,703 +20,703 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A response to an order. - */ -@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") -public class OrderResponse extends DomainResource { - - public enum OrderOutcomeCode implements FhirEnum { - /** - * The order is known, but no processing has occurred at this time. - */ - PENDING, - /** - * The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review). - */ - REVIEW, - /** - * The order was rejected because of a workflow/business logic reason. - */ - REJECTED, - /** - * The order was unable to be processed because of a technical error (i.e. unexpected error). - */ - ERROR, - /** - * The order has been accepted, and work is in progress. - */ - ACCEPTED, - /** - * Processing the order was halted at the initiators request. - */ - CANCELLED, - /** - * The order has been cancelled and replaced by another. - */ - REPLACED, - /** - * Processing the order was stopped because of some workflow/business logic reason. - */ - ABORTED, - /** - * The order has been completed. - */ - COMPLETE, - /** - * added to help the parsers - */ - NULL; - - public static final OrderOutcomeCodeEnumFactory ENUM_FACTORY = new OrderOutcomeCodeEnumFactory(); - - public static OrderOutcomeCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return PENDING; - if ("review".equals(codeString)) - return REVIEW; - if ("rejected".equals(codeString)) - return REJECTED; - if ("error".equals(codeString)) - return ERROR; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("replaced".equals(codeString)) - return REPLACED; - if ("aborted".equals(codeString)) - return ABORTED; - if ("complete".equals(codeString)) - return COMPLETE; - throw new IllegalArgumentException("Unknown OrderOutcomeCode code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PENDING: return "pending"; - case REVIEW: return "review"; - case REJECTED: return "rejected"; - case ERROR: return "error"; - case ACCEPTED: return "accepted"; - case CANCELLED: return "cancelled"; - case REPLACED: return "replaced"; - case ABORTED: return "aborted"; - case COMPLETE: return "complete"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PENDING: return ""; - case REVIEW: return ""; - case REJECTED: return ""; - case ERROR: return ""; - case ACCEPTED: return ""; - case CANCELLED: return ""; - case REPLACED: return ""; - case ABORTED: return ""; - case COMPLETE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PENDING: return "The order is known, but no processing has occurred at this time."; - case REVIEW: return "The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review)."; - case REJECTED: return "The order was rejected because of a workflow/business logic reason."; - case ERROR: return "The order was unable to be processed because of a technical error (i.e. unexpected error)."; - case ACCEPTED: return "The order has been accepted, and work is in progress."; - case CANCELLED: return "Processing the order was halted at the initiators request."; - case REPLACED: return "The order has been cancelled and replaced by another."; - case ABORTED: return "Processing the order was stopped because of some workflow/business logic reason."; - case COMPLETE: return "The order has been completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PENDING: return "pending"; - case REVIEW: return "review"; - case REJECTED: return "rejected"; - case ERROR: return "error"; - case ACCEPTED: return "accepted"; - case CANCELLED: return "cancelled"; - case REPLACED: return "replaced"; - case ABORTED: return "aborted"; - case COMPLETE: return "complete"; - default: return "?"; - } - } - } - - public static class OrderOutcomeCodeEnumFactory implements EnumFactory { - public OrderOutcomeCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return OrderOutcomeCode.PENDING; - if ("review".equals(codeString)) - return OrderOutcomeCode.REVIEW; - if ("rejected".equals(codeString)) - return OrderOutcomeCode.REJECTED; - if ("error".equals(codeString)) - return OrderOutcomeCode.ERROR; - if ("accepted".equals(codeString)) - return OrderOutcomeCode.ACCEPTED; - if ("cancelled".equals(codeString)) - return OrderOutcomeCode.CANCELLED; - if ("replaced".equals(codeString)) - return OrderOutcomeCode.REPLACED; - if ("aborted".equals(codeString)) - return OrderOutcomeCode.ABORTED; - if ("complete".equals(codeString)) - return OrderOutcomeCode.COMPLETE; - throw new IllegalArgumentException("Unknown OrderOutcomeCode code '"+codeString+"'"); - } - public String toCode(OrderOutcomeCode code) throws IllegalArgumentException { - if (code == OrderOutcomeCode.PENDING) - return "pending"; - if (code == OrderOutcomeCode.REVIEW) - return "review"; - if (code == OrderOutcomeCode.REJECTED) - return "rejected"; - if (code == OrderOutcomeCode.ERROR) - return "error"; - if (code == OrderOutcomeCode.ACCEPTED) - return "accepted"; - if (code == OrderOutcomeCode.CANCELLED) - return "cancelled"; - if (code == OrderOutcomeCode.REPLACED) - return "replaced"; - if (code == OrderOutcomeCode.ABORTED) - return "aborted"; - if (code == OrderOutcomeCode.COMPLETE) - return "complete"; - return "?"; - } - } - - /** - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems." ) - protected List identifier; - - /** - * A reference to the order that this is in response to. - */ - @Child(name="request", type={Order.class}, order=0, min=1, max=1) - @Description(shortDefinition="The order that this is a response to", formalDefinition="A reference to the order that this is in response to." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (A reference to the order that this is in response to.) - */ - protected Order requestTarget; - - /** - * The date and time at which this order response was made (created/posted). - */ - @Child(name="date", type={DateTimeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="When the response was made", formalDefinition="The date and time at which this order response was made (created/posted)." ) - protected DateTimeType date; - - /** - * The person, organization, or device credited with making the response. - */ - @Child(name="who", type={Practitioner.class, Organization.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who made the response", formalDefinition="The person, organization, or device credited with making the response." ) - protected Reference who; - - /** - * The actual object that is the target of the reference (The person, organization, or device credited with making the response.) - */ - protected Resource whoTarget; - - /** - * A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection. - */ - @Child(name="authority", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="If required by policy", formalDefinition="A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection." ) - protected Type authority; - - /** - * What this response says about the status of the original order. - */ - @Child(name="code", type={CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete", formalDefinition="What this response says about the status of the original order." ) - protected Enumeration code; - - /** - * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - @Child(name="description", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Additional description of the response", formalDefinition="Additional description about the response - e.g. a text description provided by a human user when making decisions about the order." ) - protected StringType description; - - /** - * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order. - */ - @Child(name="fulfillment", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details of the outcome of performing the order", formalDefinition="Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order." ) - protected List fulfillment; - /** - * The actual objects that are the target of the reference (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - protected List fulfillmentTarget; - - - private static final long serialVersionUID = 557384358L; - - public OrderResponse() { - super(); - } - - public OrderResponse(Reference request, Enumeration code) { - super(); - this.request = request; - this.code = code; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (A reference to the order that this is in response to.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (A reference to the order that this is in response to.) - */ - public OrderResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (A reference to the order that this is in response to.) - */ - public Order getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Order(); - 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. (A reference to the order that this is in response to.) - */ - public OrderResponse setRequestTarget(Order value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public OrderResponse setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date and time at which this order response was made (created/posted). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date and time at which this order response was made (created/posted). - */ - public OrderResponse setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #who} (The person, organization, or device credited with making the response.) - */ - public Reference getWho() { - if (this.who == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.who"); - else if (Configuration.doAutoCreate()) - this.who = new Reference(); - return this.who; - } - - public boolean hasWho() { - return this.who != null && !this.who.isEmpty(); - } - - /** - * @param value {@link #who} (The person, organization, or device credited with making the response.) - */ - public OrderResponse setWho(Reference value) { - this.who = value; - return this; - } - - /** - * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) - */ - public Resource getWhoTarget() { - return this.whoTarget; - } - - /** - * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) - */ - public OrderResponse setWhoTarget(Resource value) { - this.whoTarget = value; - return this; - } - - /** - * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public Type getAuthority() { - return this.authority; - } - - /** - * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public CodeableConcept getAuthorityCodeableConcept() throws Exception { - if (!(this.authority instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.authority.getClass().getName()+" was encountered"); - return (CodeableConcept) this.authority; - } - - /** - * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public Reference getAuthorityReference() throws Exception { - if (!(this.authority instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.authority.getClass().getName()+" was encountered"); - return (Reference) this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) - */ - public OrderResponse setAuthority(Type value) { - this.authority = value; - return this; - } - - /** - * @return {@link #code} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OrderResponse setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return What this response says about the status of the original order. - */ - public OrderOutcomeCode getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value What this response says about the status of the original order. - */ - public OrderResponse setCode(OrderOutcomeCode value) { - if (this.code == null) - this.code = new Enumeration(OrderOutcomeCode.ENUM_FACTORY); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). 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 OrderResponse.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} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public OrderResponse setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - public OrderResponse setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - public List getFulfillment() { - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - return this.fulfillment; - } - - public boolean hasFulfillment() { - if (this.fulfillment == null) - return false; - for (Reference item : this.fulfillment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - // syntactic sugar - public Reference addFulfillment() { //3 - Reference t = new Reference(); - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - this.fulfillment.add(t); - return t; - } - - /** - * @return {@link #fulfillment} (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. Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) - */ - public List getFulfillmentTarget() { - if (this.fulfillmentTarget == null) - this.fulfillmentTarget = new ArrayList(); - return this.fulfillmentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Order)", "A reference to the order that this is in response to.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("date", "dateTime", "The date and time at which this order response was made (created/posted).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("who", "Reference(Practitioner|Organization|Device)", "The person, organization, or device credited with making the response.", 0, java.lang.Integer.MAX_VALUE, who)); - childrenList.add(new Property("authority[x]", "CodeableConcept|Reference(Any)", "A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("code", "code", "What this response says about the status of the original order.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("description", "string", "Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("fulfillment", "Reference(Any)", "Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); - } - - public OrderResponse copy() { - OrderResponse dst = new OrderResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.date = date == null ? null : date.copy(); - dst.who = who == null ? null : who.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.code = code == null ? null : code.copy(); - dst.description = description == null ? null : description.copy(); - if (fulfillment != null) { - dst.fulfillment = new ArrayList(); - for (Reference i : fulfillment) - dst.fulfillment.add(i.copy()); - }; - return dst; - } - - protected OrderResponse typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (date == null || date.isEmpty()) && (who == null || who.isEmpty()) && (authority == null || authority.isEmpty()) - && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) && (fulfillment == null || fulfillment.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OrderResponse; - } - - @SearchParamDefinition(name="patient", path="", description="The patient the reuqest order is related to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="Details of the outcome of performing the order", type="reference" ) - public static final String SP_FULFILLMENT = "fulfillment"; - @SearchParamDefinition(name="request", path="OrderResponse.request", description="The order that this is a response to", type="reference" ) - public static final String SP_REQUEST = "request"; - @SearchParamDefinition(name="code", path="OrderResponse.code", description="pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="OrderResponse.date", description="When the response was made", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="who", path="OrderResponse.who", description="Who made the response", type="reference" ) - public static final String SP_WHO = "who"; - -} - + +/* + 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; +/** + * A response to an order. + */ +@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") +public class OrderResponse extends DomainResource { + + public enum OrderOutcomeCode implements FhirEnum { + /** + * The order is known, but no processing has occurred at this time. + */ + PENDING, + /** + * The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review). + */ + REVIEW, + /** + * The order was rejected because of a workflow/business logic reason. + */ + REJECTED, + /** + * The order was unable to be processed because of a technical error (i.e. unexpected error). + */ + ERROR, + /** + * The order has been accepted, and work is in progress. + */ + ACCEPTED, + /** + * Processing the order was halted at the initiators request. + */ + CANCELLED, + /** + * The order has been cancelled and replaced by another. + */ + REPLACED, + /** + * Processing the order was stopped because of some workflow/business logic reason. + */ + ABORTED, + /** + * The order has been completed. + */ + COMPLETE, + /** + * added to help the parsers + */ + NULL; + + public static final OrderOutcomeCodeEnumFactory ENUM_FACTORY = new OrderOutcomeCodeEnumFactory(); + + public static OrderOutcomeCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return PENDING; + if ("review".equals(codeString)) + return REVIEW; + if ("rejected".equals(codeString)) + return REJECTED; + if ("error".equals(codeString)) + return ERROR; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("replaced".equals(codeString)) + return REPLACED; + if ("aborted".equals(codeString)) + return ABORTED; + if ("complete".equals(codeString)) + return COMPLETE; + throw new IllegalArgumentException("Unknown OrderOutcomeCode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PENDING: return "pending"; + case REVIEW: return "review"; + case REJECTED: return "rejected"; + case ERROR: return "error"; + case ACCEPTED: return "accepted"; + case CANCELLED: return "cancelled"; + case REPLACED: return "replaced"; + case ABORTED: return "aborted"; + case COMPLETE: return "complete"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PENDING: return ""; + case REVIEW: return ""; + case REJECTED: return ""; + case ERROR: return ""; + case ACCEPTED: return ""; + case CANCELLED: return ""; + case REPLACED: return ""; + case ABORTED: return ""; + case COMPLETE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PENDING: return "The order is known, but no processing has occurred at this time."; + case REVIEW: return "The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review)."; + case REJECTED: return "The order was rejected because of a workflow/business logic reason."; + case ERROR: return "The order was unable to be processed because of a technical error (i.e. unexpected error)."; + case ACCEPTED: return "The order has been accepted, and work is in progress."; + case CANCELLED: return "Processing the order was halted at the initiators request."; + case REPLACED: return "The order has been cancelled and replaced by another."; + case ABORTED: return "Processing the order was stopped because of some workflow/business logic reason."; + case COMPLETE: return "The order has been completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PENDING: return "pending"; + case REVIEW: return "review"; + case REJECTED: return "rejected"; + case ERROR: return "error"; + case ACCEPTED: return "accepted"; + case CANCELLED: return "cancelled"; + case REPLACED: return "replaced"; + case ABORTED: return "aborted"; + case COMPLETE: return "complete"; + default: return "?"; + } + } + } + + public static class OrderOutcomeCodeEnumFactory implements EnumFactory { + public OrderOutcomeCode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("pending".equals(codeString)) + return OrderOutcomeCode.PENDING; + if ("review".equals(codeString)) + return OrderOutcomeCode.REVIEW; + if ("rejected".equals(codeString)) + return OrderOutcomeCode.REJECTED; + if ("error".equals(codeString)) + return OrderOutcomeCode.ERROR; + if ("accepted".equals(codeString)) + return OrderOutcomeCode.ACCEPTED; + if ("cancelled".equals(codeString)) + return OrderOutcomeCode.CANCELLED; + if ("replaced".equals(codeString)) + return OrderOutcomeCode.REPLACED; + if ("aborted".equals(codeString)) + return OrderOutcomeCode.ABORTED; + if ("complete".equals(codeString)) + return OrderOutcomeCode.COMPLETE; + throw new IllegalArgumentException("Unknown OrderOutcomeCode code '"+codeString+"'"); + } + public String toCode(OrderOutcomeCode code) throws IllegalArgumentException { + if (code == OrderOutcomeCode.PENDING) + return "pending"; + if (code == OrderOutcomeCode.REVIEW) + return "review"; + if (code == OrderOutcomeCode.REJECTED) + return "rejected"; + if (code == OrderOutcomeCode.ERROR) + return "error"; + if (code == OrderOutcomeCode.ACCEPTED) + return "accepted"; + if (code == OrderOutcomeCode.CANCELLED) + return "cancelled"; + if (code == OrderOutcomeCode.REPLACED) + return "replaced"; + if (code == OrderOutcomeCode.ABORTED) + return "aborted"; + if (code == OrderOutcomeCode.COMPLETE) + return "complete"; + return "?"; + } + } + + /** + * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems." ) + protected List identifier; + + /** + * A reference to the order that this is in response to. + */ + @Child(name="request", type={Order.class}, order=0, min=1, max=1) + @Description(shortDefinition="The order that this is a response to", formalDefinition="A reference to the order that this is in response to." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (A reference to the order that this is in response to.) + */ + protected Order requestTarget; + + /** + * The date and time at which this order response was made (created/posted). + */ + @Child(name="date", type={DateTimeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="When the response was made", formalDefinition="The date and time at which this order response was made (created/posted)." ) + protected DateTimeType date; + + /** + * The person, organization, or device credited with making the response. + */ + @Child(name="who", type={Practitioner.class, Organization.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who made the response", formalDefinition="The person, organization, or device credited with making the response." ) + protected Reference who; + + /** + * The actual object that is the target of the reference (The person, organization, or device credited with making the response.) + */ + protected Resource whoTarget; + + /** + * A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection. + */ + @Child(name="authority", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="If required by policy", formalDefinition="A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection." ) + protected Type authority; + + /** + * What this response says about the status of the original order. + */ + @Child(name="code", type={CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete", formalDefinition="What this response says about the status of the original order." ) + protected Enumeration code; + + /** + * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + @Child(name="description", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Additional description of the response", formalDefinition="Additional description about the response - e.g. a text description provided by a human user when making decisions about the order." ) + protected StringType description; + + /** + * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order. + */ + @Child(name="fulfillment", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details of the outcome of performing the order", formalDefinition="Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order." ) + protected List fulfillment; + /** + * The actual objects that are the target of the reference (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + protected List fulfillmentTarget; + + + private static final long serialVersionUID = 557384358L; + + public OrderResponse() { + super(); + } + + public OrderResponse(Reference request, Enumeration code) { + super(); + this.request = request; + this.code = code; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (A reference to the order that this is in response to.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (A reference to the order that this is in response to.) + */ + public OrderResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (A reference to the order that this is in response to.) + */ + public Order getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new Order(); + 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. (A reference to the order that this is in response to.) + */ + public OrderResponse setRequestTarget(Order value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public OrderResponse setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date and time at which this order response was made (created/posted). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date and time at which this order response was made (created/posted). + */ + public OrderResponse setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #who} (The person, organization, or device credited with making the response.) + */ + public Reference getWho() { + if (this.who == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.who"); + else if (Configuration.doAutoCreate()) + this.who = new Reference(); + return this.who; + } + + public boolean hasWho() { + return this.who != null && !this.who.isEmpty(); + } + + /** + * @param value {@link #who} (The person, organization, or device credited with making the response.) + */ + public OrderResponse setWho(Reference value) { + this.who = value; + return this; + } + + /** + * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) + */ + public Resource getWhoTarget() { + return this.whoTarget; + } + + /** + * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) + */ + public OrderResponse setWhoTarget(Resource value) { + this.whoTarget = value; + return this; + } + + /** + * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public Type getAuthority() { + return this.authority; + } + + /** + * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public CodeableConcept getAuthorityCodeableConcept() throws Exception { + if (!(this.authority instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.authority.getClass().getName()+" was encountered"); + return (CodeableConcept) this.authority; + } + + /** + * @return {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public Reference getAuthorityReference() throws Exception { + if (!(this.authority instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.authority.getClass().getName()+" was encountered"); + return (Reference) this.authority; + } + + public boolean hasAuthority() { + return this.authority != null && !this.authority.isEmpty(); + } + + /** + * @param value {@link #authority} (A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.) + */ + public OrderResponse setAuthority(Type value) { + this.authority = value; + return this; + } + + /** + * @return {@link #code} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Enumeration getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrderResponse.code"); + else if (Configuration.doAutoCreate()) + this.code = new Enumeration(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public OrderResponse setCodeElement(Enumeration value) { + this.code = value; + return this; + } + + /** + * @return What this response says about the status of the original order. + */ + public OrderOutcomeCode getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value What this response says about the status of the original order. + */ + public OrderResponse setCode(OrderOutcomeCode value) { + if (this.code == null) + this.code = new Enumeration(OrderOutcomeCode.ENUM_FACTORY); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). 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 OrderResponse.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} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public OrderResponse setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + */ + public OrderResponse setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + public List getFulfillment() { + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + return this.fulfillment; + } + + public boolean hasFulfillment() { + if (this.fulfillment == null) + return false; + for (Reference item : this.fulfillment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #fulfillment} (Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + // syntactic sugar + public Reference addFulfillment() { //3 + Reference t = new Reference(); + if (this.fulfillment == null) + this.fulfillment = new ArrayList(); + this.fulfillment.add(t); + return t; + } + + /** + * @return {@link #fulfillment} (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. Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.) + */ + public List getFulfillmentTarget() { + if (this.fulfillmentTarget == null) + this.fulfillmentTarget = new ArrayList(); + return this.fulfillmentTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("request", "Reference(Order)", "A reference to the order that this is in response to.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("date", "dateTime", "The date and time at which this order response was made (created/posted).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("who", "Reference(Practitioner|Organization|Device)", "The person, organization, or device credited with making the response.", 0, java.lang.Integer.MAX_VALUE, who)); + childrenList.add(new Property("authority[x]", "CodeableConcept|Reference(Any)", "A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("code", "code", "What this response says about the status of the original order.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("description", "string", "Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("fulfillment", "Reference(Any)", "Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); + } + + public OrderResponse copy() { + OrderResponse dst = new OrderResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.date = date == null ? null : date.copy(); + dst.who = who == null ? null : who.copy(); + dst.authority = authority == null ? null : authority.copy(); + dst.code = code == null ? null : code.copy(); + dst.description = description == null ? null : description.copy(); + if (fulfillment != null) { + dst.fulfillment = new ArrayList(); + for (Reference i : fulfillment) + dst.fulfillment.add(i.copy()); + }; + return dst; + } + + protected OrderResponse typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) + && (date == null || date.isEmpty()) && (who == null || who.isEmpty()) && (authority == null || authority.isEmpty()) + && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) && (fulfillment == null || fulfillment.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.OrderResponse; + } + + @SearchParamDefinition(name="patient", path="", description="The patient the reuqest order is related to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="Details of the outcome of performing the order", type="reference" ) + public static final String SP_FULFILLMENT = "fulfillment"; + @SearchParamDefinition(name="request", path="OrderResponse.request", description="The order that this is a response to", type="reference" ) + public static final String SP_REQUEST = "request"; + @SearchParamDefinition(name="code", path="OrderResponse.code", description="pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="OrderResponse.date", description="When the response was made", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="who", path="OrderResponse.who", description="Who made the response", type="reference" ) + public static final String SP_WHO = "who"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java index 7a40b8a9ebc..1ef1cb53601 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java @@ -20,874 +20,874 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. - */ -@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") -public class Organization extends DomainResource { - - public enum AdministrativeGender implements FhirEnum { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - - public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); - - public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) throws IllegalArgumentException { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - @Block() - public static class OrganizationContactComponent extends BackboneElement { - /** - * Indicates a purpose for which the contact can be reached. - */ - @Child(name="purpose", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) - protected CodeableConcept purpose; - - /** - * A name associated with the contact. - */ - @Child(name="name", type={HumanName.class}, order=2, min=0, max=1) - @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) - protected HumanName name; - - /** - * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details (telephone, email, etc) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." ) - protected List telecom; - - /** - * Visiting or postal addresses for the contact. - */ - @Child(name="address", type={Address.class}, order=4, min=0, max=1) - @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) - protected Address address; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name="gender", type={CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - private static final long serialVersionUID = -1433864122L; - - public OrganizationContactComponent() { - super(); - } - - /** - * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) - */ - public CodeableConcept getPurpose() { - if (this.purpose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); - else if (Configuration.doAutoCreate()) - this.purpose = new CodeableConcept(); - return this.purpose; - } - - public boolean hasPurpose() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - /** - * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) - */ - public OrganizationContactComponent setPurpose(CodeableConcept value) { - this.purpose = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the contact.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the contact.) - */ - public OrganizationContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #address} (Visiting or postal addresses for the contact.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Visiting or postal addresses for the contact.) - */ - public OrganizationContactComponent setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(); - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public OrganizationContactComponent setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public OrganizationContactComponent setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); - this.gender.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); - childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - } - - public OrganizationContactComponent copy() { - OrganizationContactComponent dst = new OrganizationContactComponent(); - copyValues(dst); - dst.purpose = purpose == null ? null : purpose.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.gender = gender == null ? null : gender.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) - ; - } - - } - - /** - * Identifier for the organization that is used to identify the organization across multiple disparate systems. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) - protected List identifier; - - /** - * A name associated with the organization. - */ - @Child(name="name", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) - protected StringType name; - - /** - * The kind of organization that this is. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) - protected CodeableConcept type; - - /** - * A contact detail for the organization. - */ - @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) - protected List telecom; - - /** - * An address for the organization. - */ - @Child(name="address", type={Address.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) - protected List
address; - - /** - * The organization of which this organization forms a part. - */ - @Child(name="partOf", type={Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (The organization of which this organization forms a part.) - */ - protected Organization partOfTarget; - - /** - * Contact for the organization for a certain purpose. - */ - @Child(name="contact", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) - protected List contact; - - /** - * Location(s) the organization uses to provide services. - */ - @Child(name="location", type={Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Location(s) the organization uses to provide services", formalDefinition="Location(s) the organization uses to provide services." ) - protected List location; - /** - * The actual objects that are the target of the reference (Location(s) the organization uses to provide services.) - */ - protected List locationTarget; - - - /** - * Whether the organization's record is still in active use. - */ - @Child(name="active", type={BooleanType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) - protected BooleanType active; - - private static final long serialVersionUID = -75313696L; - - public Organization() { - super(); - } - - /** - * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Organization setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name associated with the organization. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name associated with the organization. - */ - public Organization setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The kind of organization that this is.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of organization that this is.) - */ - public Organization setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the organization.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the organization.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #address} (An address for the organization.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (An address for the organization.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - /** - * @return {@link #partOf} (The organization of which this organization forms a part.) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (The organization of which this organization forms a part.) - */ - public Organization setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} 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 organization of which this organization forms a part.) - */ - public Organization getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Organization(); - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} 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 of which this organization forms a part.) - */ - public Organization setPartOfTarget(Organization value) { - this.partOfTarget = value; - return this; - } - - /** - * @return {@link #contact} (Contact for the organization for a certain purpose.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (OrganizationContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact for the organization for a certain purpose.) - */ - // syntactic sugar - public OrganizationContactComponent addContact() { //3 - OrganizationContactComponent t = new OrganizationContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - /** - * @return {@link #location} (Location(s) the organization uses to provide services.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (Reference item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (Location(s) the organization uses to provide services.) - */ - // syntactic sugar - public Reference addLocation() { //3 - Reference t = new Reference(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @return {@link #location} (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. Location(s) the organization uses to provide services.) - */ - public List getLocationTarget() { - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - return this.locationTarget; - } - - // syntactic sugar - /** - * @return {@link #location} (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. Location(s) the organization uses to provide services.) - */ - public Location addLocationTarget() { - Location r = new Location(); - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - this.locationTarget.add(r); - return r; - } - - /** - * @return {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Organization setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether the organization's record is still in active use. - */ - public boolean getActive() { - return this.active == null ? false : this.active.getValue(); - } - - /** - * @param value Whether the organization's record is still in active use. - */ - public Organization setActive(boolean value) { - if (value == false) - this.active = null; - else { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); - childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("location", "Reference(Location)", "Location(s) the organization uses to provide services.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - } - - public Organization copy() { - Organization dst = new Organization(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.type = type == null ? null : type.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.partOf = partOf == null ? null : partOf.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (OrganizationContactComponent i : contact) - dst.contact.add(i.copy()); - }; - if (location != null) { - dst.location = new ArrayList(); - for (Reference i : location) - dst.location.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - return dst; - } - - protected Organization typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) - && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) && (location == null || location.isEmpty()) - && (active == null || active.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Organization; - } - - @SearchParamDefinition(name="phonetic", path="", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) - public static final String SP_PARTOF = "partof"; - @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) - public static final String SP_ACTIVE = "active"; - @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + */ +@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") +public class Organization extends DomainResource { + + public enum AdministrativeGender implements FhirEnum { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) throws IllegalArgumentException { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + @Block() + public static class OrganizationContactComponent extends BackboneElement { + /** + * Indicates a purpose for which the contact can be reached. + */ + @Child(name="purpose", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) + protected CodeableConcept purpose; + + /** + * A name associated with the contact. + */ + @Child(name="name", type={HumanName.class}, order=2, min=0, max=1) + @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) + protected HumanName name; + + /** + * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details (telephone, email, etc) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." ) + protected List telecom; + + /** + * Visiting or postal addresses for the contact. + */ + @Child(name="address", type={Address.class}, order=4, min=0, max=1) + @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) + protected Address address; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name="gender", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + private static final long serialVersionUID = -1433864122L; + + public OrganizationContactComponent() { + super(); + } + + /** + * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) + */ + public CodeableConcept getPurpose() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new CodeableConcept(); + return this.purpose; + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) + */ + public OrganizationContactComponent setPurpose(CodeableConcept value) { + this.purpose = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the contact.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the contact.) + */ + public OrganizationContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #address} (Visiting or postal addresses for the contact.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Visiting or postal addresses for the contact.) + */ + public OrganizationContactComponent setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OrganizationContactComponent.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public OrganizationContactComponent setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public OrganizationContactComponent setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + } + + public OrganizationContactComponent copy() { + OrganizationContactComponent dst = new OrganizationContactComponent(); + copyValues(dst); + dst.purpose = purpose == null ? null : purpose.copy(); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.gender = gender == null ? null : gender.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) + ; + } + + } + + /** + * Identifier for the organization that is used to identify the organization across multiple disparate systems. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) + protected List identifier; + + /** + * A name associated with the organization. + */ + @Child(name="name", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) + protected StringType name; + + /** + * The kind of organization that this is. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) + protected CodeableConcept type; + + /** + * A contact detail for the organization. + */ + @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) + protected List telecom; + + /** + * An address for the organization. + */ + @Child(name="address", type={Address.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) + protected List
address; + + /** + * The organization of which this organization forms a part. + */ + @Child(name="partOf", type={Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) + protected Reference partOf; + + /** + * The actual object that is the target of the reference (The organization of which this organization forms a part.) + */ + protected Organization partOfTarget; + + /** + * Contact for the organization for a certain purpose. + */ + @Child(name="contact", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) + protected List contact; + + /** + * Location(s) the organization uses to provide services. + */ + @Child(name="location", type={Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Location(s) the organization uses to provide services", formalDefinition="Location(s) the organization uses to provide services." ) + protected List location; + /** + * The actual objects that are the target of the reference (Location(s) the organization uses to provide services.) + */ + protected List locationTarget; + + + /** + * Whether the organization's record is still in active use. + */ + @Child(name="active", type={BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) + protected BooleanType active; + + private static final long serialVersionUID = -75313696L; + + public Organization() { + super(); + } + + /** + * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Organization setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name associated with the organization. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name associated with the organization. + */ + public Organization setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The kind of organization that this is.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The kind of organization that this is.) + */ + public Organization setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the organization.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the organization.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #address} (An address for the organization.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (An address for the organization.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + /** + * @return {@link #partOf} (The organization of which this organization forms a part.) + */ + public Reference getPartOf() { + if (this.partOf == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.partOf"); + else if (Configuration.doAutoCreate()) + this.partOf = new Reference(); + return this.partOf; + } + + public boolean hasPartOf() { + return this.partOf != null && !this.partOf.isEmpty(); + } + + /** + * @param value {@link #partOf} (The organization of which this organization forms a part.) + */ + public Organization setPartOf(Reference value) { + this.partOf = value; + return this; + } + + /** + * @return {@link #partOf} 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 organization of which this organization forms a part.) + */ + public Organization getPartOfTarget() { + if (this.partOfTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.partOf"); + else if (Configuration.doAutoCreate()) + this.partOfTarget = new Organization(); + return this.partOfTarget; + } + + /** + * @param value {@link #partOf} 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 of which this organization forms a part.) + */ + public Organization setPartOfTarget(Organization value) { + this.partOfTarget = value; + return this; + } + + /** + * @return {@link #contact} (Contact for the organization for a certain purpose.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (OrganizationContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Contact for the organization for a certain purpose.) + */ + // syntactic sugar + public OrganizationContactComponent addContact() { //3 + OrganizationContactComponent t = new OrganizationContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + /** + * @return {@link #location} (Location(s) the organization uses to provide services.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (Reference item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (Location(s) the organization uses to provide services.) + */ + // syntactic sugar + public Reference addLocation() { //3 + Reference t = new Reference(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @return {@link #location} (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. Location(s) the organization uses to provide services.) + */ + public List getLocationTarget() { + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + return this.locationTarget; + } + + // syntactic sugar + /** + * @return {@link #location} (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. Location(s) the organization uses to provide services.) + */ + public Location addLocationTarget() { + Location r = new Location(); + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + this.locationTarget.add(r); + return r; + } + + /** + * @return {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Organization.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Organization setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether the organization's record is still in active use. + */ + public boolean getActive() { + return this.active == null ? false : this.active.getValue(); + } + + /** + * @param value Whether the organization's record is still in active use. + */ + public Organization setActive(boolean value) { + if (value == false) + this.active = null; + else { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); + childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("location", "Reference(Location)", "Location(s) the organization uses to provide services.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + } + + public Organization copy() { + Organization dst = new Organization(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + dst.type = type == null ? null : type.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.partOf = partOf == null ? null : partOf.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (OrganizationContactComponent i : contact) + dst.contact.add(i.copy()); + }; + if (location != null) { + dst.location = new ArrayList(); + for (Reference i : location) + dst.location.add(i.copy()); + }; + dst.active = active == null ? null : active.copy(); + return dst; + } + + protected Organization typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) + && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) && (location == null || location.isEmpty()) + && (active == null || active.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Organization; + } + + @SearchParamDefinition(name="phonetic", path="", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) + public static final String SP_PARTOF = "partof"; + @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) + public static final String SP_ACTIVE = "active"; + @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java index 6daf09c737e..3f07f299bc3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java @@ -20,335 +20,335 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest. - */ -@ResourceDef(name="Other", profile="http://hl7.org/fhir/Profile/Other") -public class Other extends DomainResource { - - /** - * Identifier assigned to the resource for business purposes, outside the context of FHIR. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) - protected List identifier; - - /** - * Identifies the 'type' of resource - equivalent to the resource name for other resources. - */ - @Child(name="code", type={CodeableConcept.class}, order=0, min=1, max=1) - @Description(shortDefinition="Kind of Resource", formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." ) - protected CodeableConcept code; - - /** - * Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce. - */ - @Child(name="subject", type={}, order=1, min=0, max=1) - @Description(shortDefinition="Identifies the", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - protected Resource subjectTarget; - - /** - * Indicates who was responsible for creating the resource instance. - */ - @Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who created", formalDefinition="Indicates who was responsible for creating the resource instance." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Indicates who was responsible for creating the resource instance.) - */ - protected Resource authorTarget; - - /** - * Identifies when the resource was first created. - */ - @Child(name="created", type={DateType.class}, order=3, min=0, max=1) - @Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." ) - protected DateType created; - - private static final long serialVersionUID = 916539354L; - - public Other() { - super(); - } - - public Other(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Other.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public Other setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Other.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} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Other 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Resource getSubjectTarget() { - 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) - */ - public Other setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Other.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Other setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Other setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Other.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Other setCreatedElement(DateType value) { - this.created = value; - return this; - } - - /** - * @return Identifies when the resource was first created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value Identifies when the resource was first created. - */ - public Other setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateType(); - this.created.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Indicates who was responsible for creating the resource instance.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created)); - } - - public Other copy() { - Other dst = new Other(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.author = author == null ? null : author.copy(); - dst.created = created == null ? null : created.copy(); - return dst; - } - - protected Other typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Other; - } - - @SearchParamDefinition(name="patient", path="Other.subject", description="Identifies the", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="created", path="Other.created", description="When created", type="date" ) - public static final String SP_CREATED = "created"; - @SearchParamDefinition(name="subject", path="Other.subject", description="Identifies the", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="code", path="Other.code", description="Kind of Resource", type="token" ) - public static final String SP_CODE = "code"; - -} - + +/* + 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.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; +/** + * Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest. + */ +@ResourceDef(name="Other", profile="http://hl7.org/fhir/Profile/Other") +public class Other extends DomainResource { + + /** + * Identifier assigned to the resource for business purposes, outside the context of FHIR. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) + protected List identifier; + + /** + * Identifies the 'type' of resource - equivalent to the resource name for other resources. + */ + @Child(name="code", type={CodeableConcept.class}, order=0, min=1, max=1) + @Description(shortDefinition="Kind of Resource", formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." ) + protected CodeableConcept code; + + /** + * Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce. + */ + @Child(name="subject", type={}, order=1, min=0, max=1) + @Description(shortDefinition="Identifies the", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + protected Resource subjectTarget; + + /** + * Indicates who was responsible for creating the resource instance. + */ + @Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who created", formalDefinition="Indicates who was responsible for creating the resource instance." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Indicates who was responsible for creating the resource instance.) + */ + protected Resource authorTarget; + + /** + * Identifies when the resource was first created. + */ + @Child(name="created", type={DateType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." ) + protected DateType created; + + private static final long serialVersionUID = 916539354L; + + public Other() { + super(); + } + + public Other(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Other.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) + */ + public Other setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Other.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} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Other 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Resource getSubjectTarget() { + 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. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce.) + */ + public Other setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Other.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) + */ + public Other setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) + */ + public Other setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Other.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public Other setCreatedElement(DateType value) { + this.created = value; + return this; + } + + /** + * @return Identifies when the resource was first created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value Identifies when the resource was first created. + */ + public Other setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateType(); + this.created.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the 'focus' of this resoruce.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Indicates who was responsible for creating the resource instance.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created)); + } + + public Other copy() { + Other dst = new Other(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.author = author == null ? null : author.copy(); + dst.created = created == null ? null : created.copy(); + return dst; + } + + protected Other typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Other; + } + + @SearchParamDefinition(name="patient", path="Other.subject", description="Identifies the", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="created", path="Other.created", description="When created", type="date" ) + public static final String SP_CREATED = "created"; + @SearchParamDefinition(name="subject", path="Other.subject", description="Identifies the", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="code", path="Other.code", description="Kind of Resource", type="token" ) + public static final String SP_CODE = "code"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java index 5b5804d3750..cdcdb1f22aa 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java @@ -20,420 +20,420 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. - */ -@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") -public class Parameters extends Resource { - - @Block() - public static class ParametersParameterComponent extends BackboneElement { - /** - * The name of the parameter (reference to the operation definition). - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) - protected StringType name; - - /** - * If the parameter is a data type. - */ - @Child(name="value", type={}, order=2, min=0, max=1) - @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) - protected org.hl7.fhir.instance.model.Type value; - - /** - * If the parameter is a whole resource. - */ - @Child(name="resource", type={Resource.class}, order=3, min=0, max=1) - @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) - protected Resource resource; - - /** - * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". - */ - @Child(name="part", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Named part of a parameter (e.g. Tuple)", formalDefinition="A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'." ) - protected List part; - - private static final long serialVersionUID = 2101270343L; - - public ParametersParameterComponent() { - super(); - } - - public ParametersParameterComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParametersParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParametersParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter (reference to the operation definition). - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter (reference to the operation definition). - */ - public ParametersParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (If the parameter is a data type.) - */ - public org.hl7.fhir.instance.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (If the parameter is a data type.) - */ - public ParametersParameterComponent setValue(org.hl7.fhir.instance.model.Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #resource} (If the parameter is a whole resource.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (If the parameter is a whole resource.) - */ - public ParametersParameterComponent setResource(Resource value) { - this.resource = value; - return this; - } - - /** - * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) - */ - public List getPart() { - if (this.part == null) - this.part = new ArrayList(); - return this.part; - } - - public boolean hasPart() { - if (this.part == null) - return false; - for (ParametersParameterPartComponent item : this.part) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) - */ - // syntactic sugar - public ParametersParameterPartComponent addPart() { //3 - ParametersParameterPartComponent t = new ParametersParameterPartComponent(); - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("part", "", "A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'.", 0, java.lang.Integer.MAX_VALUE, part)); - } - - public ParametersParameterComponent copy() { - ParametersParameterComponent dst = new ParametersParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - dst.resource = resource == null ? null : resource.copy(); - if (part != null) { - dst.part = new ArrayList(); - for (ParametersParameterPartComponent i : part) - dst.part.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); - } - - } - - @Block() - public static class ParametersParameterPartComponent extends BackboneElement { - /** - * The name of the parameter (reference to the operation definition). - */ - @Child(name="name", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) - protected StringType name; - - /** - * The value of the parameter. - */ - @Child(name="value", type={}, order=2, min=1, max=1) - @Description(shortDefinition="Value of the part", formalDefinition="The value of the parameter." ) - protected org.hl7.fhir.instance.model.Type value; - - private static final long serialVersionUID = 2130806097L; - - public ParametersParameterPartComponent() { - super(); - } - - public ParametersParameterPartComponent(StringType name, org.hl7.fhir.instance.model.Type value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParametersParameterPartComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParametersParameterPartComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter (reference to the operation definition). - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter (reference to the operation definition). - */ - public ParametersParameterPartComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public org.hl7.fhir.instance.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the parameter.) - */ - public ParametersParameterPartComponent setValue(org.hl7.fhir.instance.model.Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ParametersParameterPartComponent copy() { - ParametersParameterPartComponent dst = new ParametersParameterPartComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - /** - * A parameter passed to or received from the operation. - */ - @Child(name="parameter", type={}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) - protected List parameter; - - private static final long serialVersionUID = -1495940293L; - - public Parameters() { - super(); - } - - /** - * @return {@link #parameter} (A parameter passed to or received from the operation.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ParametersParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (A parameter passed to or received from the operation.) - */ - // syntactic sugar - public ParametersParameterComponent addParameter() { //3 - ParametersParameterComponent t = new ParametersParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - public Parameters copy() { - Parameters dst = new Parameters(); - copyValues(dst); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ParametersParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - protected Parameters typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (parameter == null || parameter.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Parameters; - } - - -} - + +/* + 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; +/** + * This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. + */ +@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") +public class Parameters extends Resource { + + @Block() + public static class ParametersParameterComponent extends BackboneElement { + /** + * The name of the parameter (reference to the operation definition). + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) + protected StringType name; + + /** + * If the parameter is a data type. + */ + @Child(name="value", type={}, order=2, min=0, max=1) + @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) + protected org.hl7.fhir.instance.model.Type value; + + /** + * If the parameter is a whole resource. + */ + @Child(name="resource", type={Resource.class}, order=3, min=0, max=1) + @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) + protected Resource resource; + + /** + * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". + */ + @Child(name="part", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Named part of a parameter (e.g. Tuple)", formalDefinition="A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'." ) + protected List part; + + private static final long serialVersionUID = 2101270343L; + + public ParametersParameterComponent() { + super(); + } + + public ParametersParameterComponent(StringType name) { + super(); + this.name = name; + } + + /** + * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParametersParameterComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParametersParameterComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter (reference to the operation definition). + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter (reference to the operation definition). + */ + public ParametersParameterComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (If the parameter is a data type.) + */ + public org.hl7.fhir.instance.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (If the parameter is a data type.) + */ + public ParametersParameterComponent setValue(org.hl7.fhir.instance.model.Type value) { + this.value = value; + return this; + } + + /** + * @return {@link #resource} (If the parameter is a whole resource.) + */ + public Resource getResource() { + return this.resource; + } + + public boolean hasResource() { + return this.resource != null && !this.resource.isEmpty(); + } + + /** + * @param value {@link #resource} (If the parameter is a whole resource.) + */ + public ParametersParameterComponent setResource(Resource value) { + this.resource = value; + return this; + } + + /** + * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) + */ + public List getPart() { + if (this.part == null) + this.part = new ArrayList(); + return this.part; + } + + public boolean hasPart() { + if (this.part == null) + return false; + for (ParametersParameterPartComponent item : this.part) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) + */ + // syntactic sugar + public ParametersParameterPartComponent addPart() { //3 + ParametersParameterPartComponent t = new ParametersParameterPartComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("part", "", "A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'.", 0, java.lang.Integer.MAX_VALUE, part)); + } + + public ParametersParameterComponent copy() { + ParametersParameterComponent dst = new ParametersParameterComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + dst.resource = resource == null ? null : resource.copy(); + if (part != null) { + dst.part = new ArrayList(); + for (ParametersParameterPartComponent i : part) + dst.part.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); + } + + } + + @Block() + public static class ParametersParameterPartComponent extends BackboneElement { + /** + * The name of the parameter (reference to the operation definition). + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) + protected StringType name; + + /** + * The value of the parameter. + */ + @Child(name="value", type={}, order=2, min=1, max=1) + @Description(shortDefinition="Value of the part", formalDefinition="The value of the parameter." ) + protected org.hl7.fhir.instance.model.Type value; + + private static final long serialVersionUID = 2130806097L; + + public ParametersParameterPartComponent() { + super(); + } + + public ParametersParameterPartComponent(StringType name, org.hl7.fhir.instance.model.Type value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParametersParameterPartComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParametersParameterPartComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter (reference to the operation definition). + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter (reference to the operation definition). + */ + public ParametersParameterPartComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public org.hl7.fhir.instance.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the parameter.) + */ + public ParametersParameterPartComponent setValue(org.hl7.fhir.instance.model.Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ParametersParameterPartComponent copy() { + ParametersParameterPartComponent dst = new ParametersParameterPartComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + /** + * A parameter passed to or received from the operation. + */ + @Child(name="parameter", type={}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) + protected List parameter; + + private static final long serialVersionUID = -1495940293L; + + public Parameters() { + super(); + } + + /** + * @return {@link #parameter} (A parameter passed to or received from the operation.) + */ + public List getParameter() { + if (this.parameter == null) + this.parameter = new ArrayList(); + return this.parameter; + } + + public boolean hasParameter() { + if (this.parameter == null) + return false; + for (ParametersParameterComponent item : this.parameter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #parameter} (A parameter passed to or received from the operation.) + */ + // syntactic sugar + public ParametersParameterComponent addParameter() { //3 + ParametersParameterComponent t = new ParametersParameterComponent(); + if (this.parameter == null) + this.parameter = new ArrayList(); + this.parameter.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); + } + + public Parameters copy() { + Parameters dst = new Parameters(); + copyValues(dst); + if (parameter != null) { + dst.parameter = new ArrayList(); + for (ParametersParameterComponent i : parameter) + dst.parameter.add(i.copy()); + }; + return dst; + } + + protected Parameters typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (parameter == null || parameter.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Parameters; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java index 9719186f0cd..1c4acce7061 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java @@ -20,1704 +20,1704 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Demographics and other administrative information about a person or animal receiving care or other health-related services. - */ -@ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") -public class Patient extends DomainResource { - - public enum AdministrativeGender implements FhirEnum { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - - public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); - - public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) throws IllegalArgumentException { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum LinkType implements FhirEnum { - /** - * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. - */ - REPLACE, - /** - * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. - */ - REFER, - /** - * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. - */ - SEEALSO, - /** - * added to help the parsers - */ - NULL; - - public static final LinkTypeEnumFactory ENUM_FACTORY = new LinkTypeEnumFactory(); - - public static LinkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return REPLACE; - if ("refer".equals(codeString)) - return REFER; - if ("seealso".equals(codeString)) - return SEEALSO; - throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REPLACE: return "replace"; - case REFER: return "refer"; - case SEEALSO: return "seealso"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REPLACE: return ""; - case REFER: return ""; - case SEEALSO: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REPLACE: return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link."; - case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information."; - case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REPLACE: return "replace"; - case REFER: return "refer"; - case SEEALSO: return "see also"; - default: return "?"; - } - } - } - - public static class LinkTypeEnumFactory implements EnumFactory { - public LinkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return LinkType.REPLACE; - if ("refer".equals(codeString)) - return LinkType.REFER; - if ("seealso".equals(codeString)) - return LinkType.SEEALSO; - throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); - } - public String toCode(LinkType code) throws IllegalArgumentException { - if (code == LinkType.REPLACE) - return "replace"; - if (code == LinkType.REFER) - return "refer"; - if (code == LinkType.SEEALSO) - return "seealso"; - return "?"; - } - } - - @Block() - public static class ContactComponent extends BackboneElement { - /** - * The nature of the relationship between the patient and the contact person. - */ - @Child(name="relationship", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." ) - protected List relationship; - - /** - * A name associated with the person. - */ - @Child(name="name", type={HumanName.class}, order=2, min=0, max=1) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected HumanName name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Address for the contact person. - */ - @Child(name="address", type={Address.class}, order=4, min=0, max=1) - @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." ) - protected Address address; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name="gender", type={CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * Organization on behalf of which the contact is acting or for which the contact is working. - */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Organization that is associated with the contact", formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - protected Organization organizationTarget; - - /** - * The period during which this person or organisation is valid to be contacted relating to this patient. - */ - @Child(name="period", type={Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="The period during which this person or organisation is valid to be contacted relating to this patient", formalDefinition="The period during which this person or organisation is valid to be contacted relating to this patient." ) - protected Period period; - - private static final long serialVersionUID = 364269017L; - - public ContactComponent() { - super(); - } - - /** - * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) - */ - public List getRelationship() { - if (this.relationship == null) - this.relationship = new ArrayList(); - return this.relationship; - } - - public boolean hasRelationship() { - if (this.relationship == null) - return false; - for (CodeableConcept item : this.relationship) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) - */ - // syntactic sugar - public CodeableConcept addRelationship() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.relationship == null) - this.relationship = new ArrayList(); - this.relationship.add(t); - return t; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the person.) - */ - public ContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #address} (Address for the contact person.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Address for the contact person.) - */ - public ContactComponent setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(); - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public ContactComponent setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public ContactComponent setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public ContactComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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. (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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. (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public ContactComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #period} (The period during which this person or organisation is valid to be contacted relating to this patient.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.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} (The period during which this person or organisation is valid to be contacted relating to this patient.) - */ - public ContactComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Address for the contact person.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("period", "Period", "The period during which this person or organisation is valid to be contacted relating to this patient.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public ContactComponent copy() { - ContactComponent dst = new ContactComponent(); - copyValues(dst); - if (relationship != null) { - dst.relationship = new ArrayList(); - for (CodeableConcept i : relationship) - dst.relationship.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.gender = gender == null ? null : gender.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) - && (organization == null || organization.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - } - - @Block() - public static class AnimalComponent extends BackboneElement { - /** - * Identifies the high level categorization of the kind of animal. - */ - @Child(name="species", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="E.g. Dog, Cow", formalDefinition="Identifies the high level categorization of the kind of animal." ) - protected CodeableConcept species; - - /** - * Identifies the detailed categorization of the kind of animal. - */ - @Child(name="breed", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="E.g. Poodle, Angus", formalDefinition="Identifies the detailed categorization of the kind of animal." ) - protected CodeableConcept breed; - - /** - * Indicates the current state of the animal's reproductive organs. - */ - @Child(name="genderStatus", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="E.g. Neutered, Intact", formalDefinition="Indicates the current state of the animal's reproductive organs." ) - protected CodeableConcept genderStatus; - - private static final long serialVersionUID = -549738382L; - - public AnimalComponent() { - super(); - } - - public AnimalComponent(CodeableConcept species) { - super(); - this.species = species; - } - - /** - * @return {@link #species} (Identifies the high level categorization of the kind of animal.) - */ - public CodeableConcept getSpecies() { - if (this.species == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.species"); - else if (Configuration.doAutoCreate()) - this.species = new CodeableConcept(); - return this.species; - } - - public boolean hasSpecies() { - return this.species != null && !this.species.isEmpty(); - } - - /** - * @param value {@link #species} (Identifies the high level categorization of the kind of animal.) - */ - public AnimalComponent setSpecies(CodeableConcept value) { - this.species = value; - return this; - } - - /** - * @return {@link #breed} (Identifies the detailed categorization of the kind of animal.) - */ - public CodeableConcept getBreed() { - if (this.breed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.breed"); - else if (Configuration.doAutoCreate()) - this.breed = new CodeableConcept(); - return this.breed; - } - - public boolean hasBreed() { - return this.breed != null && !this.breed.isEmpty(); - } - - /** - * @param value {@link #breed} (Identifies the detailed categorization of the kind of animal.) - */ - public AnimalComponent setBreed(CodeableConcept value) { - this.breed = value; - return this; - } - - /** - * @return {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) - */ - public CodeableConcept getGenderStatus() { - if (this.genderStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.genderStatus"); - else if (Configuration.doAutoCreate()) - this.genderStatus = new CodeableConcept(); - return this.genderStatus; - } - - public boolean hasGenderStatus() { - return this.genderStatus != null && !this.genderStatus.isEmpty(); - } - - /** - * @param value {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) - */ - public AnimalComponent setGenderStatus(CodeableConcept value) { - this.genderStatus = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("species", "CodeableConcept", "Identifies the high level categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, species)); - childrenList.add(new Property("breed", "CodeableConcept", "Identifies the detailed categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, breed)); - childrenList.add(new Property("genderStatus", "CodeableConcept", "Indicates the current state of the animal's reproductive organs.", 0, java.lang.Integer.MAX_VALUE, genderStatus)); - } - - public AnimalComponent copy() { - AnimalComponent dst = new AnimalComponent(); - copyValues(dst); - dst.species = species == null ? null : species.copy(); - dst.breed = breed == null ? null : breed.copy(); - dst.genderStatus = genderStatus == null ? null : genderStatus.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (species == null || species.isEmpty()) && (breed == null || breed.isEmpty()) - && (genderStatus == null || genderStatus.isEmpty()); - } - - } - - @Block() - public static class PatientLinkComponent extends BackboneElement { - /** - * The other patient resource that the link refers to. - */ - @Child(name="other", type={Patient.class}, order=1, min=1, max=1) - @Description(shortDefinition="The other patient resource that the link refers to", formalDefinition="The other patient resource that the link refers to." ) - protected Reference other; - - /** - * The actual object that is the target of the reference (The other patient resource that the link refers to.) - */ - protected Patient otherTarget; - - /** - * The type of link between this patient resource and another patient resource. - */ - @Child(name="type", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="replace | refer | seealso - type of link", formalDefinition="The type of link between this patient resource and another patient resource." ) - protected Enumeration type; - - private static final long serialVersionUID = -1942104050L; - - public PatientLinkComponent() { - super(); - } - - public PatientLinkComponent(Reference other, Enumeration type) { - super(); - this.other = other; - this.type = type; - } - - /** - * @return {@link #other} (The other patient resource that the link refers to.) - */ - public Reference getOther() { - if (this.other == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.other = new Reference(); - return this.other; - } - - public boolean hasOther() { - return this.other != null && !this.other.isEmpty(); - } - - /** - * @param value {@link #other} (The other patient resource that the link refers to.) - */ - public PatientLinkComponent setOther(Reference value) { - this.other = value; - return this; - } - - /** - * @return {@link #other} 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 other patient resource that the link refers to.) - */ - public Patient getOtherTarget() { - if (this.otherTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.otherTarget = new Patient(); - return this.otherTarget; - } - - /** - * @param value {@link #other} 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 other patient resource that the link refers to.) - */ - public PatientLinkComponent setOtherTarget(Patient value) { - this.otherTarget = value; - return this; - } - - /** - * @return {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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 of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public PatientLinkComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of link between this patient resource and another patient resource. - */ - public LinkType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of link between this patient resource and another patient resource. - */ - public PatientLinkComponent setType(LinkType value) { - if (this.type == null) - this.type = new Enumeration(LinkType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("other", "Reference(Patient)", "The other patient resource that the link refers to.", 0, java.lang.Integer.MAX_VALUE, other)); - childrenList.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - public PatientLinkComponent copy() { - PatientLinkComponent dst = new PatientLinkComponent(); - copyValues(dst); - dst.other = other == null ? null : other.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (other == null || other.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - } - - /** - * An identifier that applies to this person as a patient. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An identifier for the person as this patient", formalDefinition="An identifier that applies to this person as a patient." ) - protected List identifier; - - /** - * A name associated with the individual. - */ - @Child(name="name", type={HumanName.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) - protected List name; - - /** - * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. - */ - @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the individual", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." ) - protected List telecom; - - /** - * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - @Child(name="gender", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date and time of birth for the individual. - */ - @Child(name="birthDate", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The date and time of birth for the individual", formalDefinition="The date and time of birth for the individual." ) - protected DateTimeType birthDate; - - /** - * Indicates if the individual is deceased or not. - */ - @Child(name="deceased", type={BooleanType.class, DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." ) - protected Type deceased; - - /** - * Addresses for the individual. - */ - @Child(name="address", type={Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." ) - protected List
address; - - /** - * This field contains a patient's most recent marital (civil) status. - */ - @Child(name="maritalStatus", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Marital (civil) status of a person", formalDefinition="This field contains a patient's most recent marital (civil) status." ) - protected CodeableConcept maritalStatus; - - /** - * Indicates whether the patient is part of a multiple or indicates the actual birth order. - */ - @Child(name="multipleBirth", type={BooleanType.class, IntegerType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple or indicates the actual birth order." ) - protected Type multipleBirth; - - /** - * Image of the person. - */ - @Child(name="photo", type={Attachment.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - /** - * A contact party (e.g. guardian, partner, friend) for the patient. - */ - @Child(name="contact", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." ) - protected List contact; - - /** - * This element has a value if the patient is an animal. - */ - @Child(name="animal", type={}, order=10, min=0, max=1) - @Description(shortDefinition="If this patient is an animal (non-human)", formalDefinition="This element has a value if the patient is an animal." ) - protected AnimalComponent animal; - - /** - * Languages which may be used to communicate with the patient about his or her health. - */ - @Child(name="communication", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Languages which may be used to communicate with the patient about his or her health", formalDefinition="Languages which may be used to communicate with the patient about his or her health." ) - protected List communication; - - /** - * Patient's nominated care provider. - */ - @Child(name="careProvider", type={Organization.class, Practitioner.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Patient's nominated care provider", formalDefinition="Patient's nominated care provider." ) - protected List careProvider; - /** - * The actual objects that are the target of the reference (Patient's nominated care provider.) - */ - protected List careProviderTarget; - - - /** - * Organization that is the custodian of the patient record. - */ - @Child(name="managingOrganization", type={Organization.class}, order=13, min=0, max=1) - @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (Organization that is the custodian of the patient record.) - */ - protected Organization managingOrganizationTarget; - - /** - * Link to another patient resource that concerns the same actual person. - */ - @Child(name="link", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual person." ) - protected List link; - - /** - * Whether this patient record is in active use. - */ - @Child(name="active", type={BooleanType.class}, order=15, min=0, max=1) - @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use." ) - protected BooleanType active; - - private static final long serialVersionUID = 1020038018L; - - public Patient() { - super(); - } - - /** - * @return {@link #identifier} (An identifier that applies to this person as a patient.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (An identifier that applies to this person as a patient.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #name} (A name associated with the individual.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (A name associated with the individual.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(); - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Patient setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - public Patient setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date and time of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateTimeType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateTimeType(); - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date and time of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Patient setBirthDateElement(DateTimeType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date and time of birth for the individual. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date and time of birth for the individual. - */ - public Patient setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateTimeType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public Type getDeceased() { - return this.deceased; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public BooleanType getDeceasedBooleanType() throws Exception { - if (!(this.deceased instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (BooleanType) this.deceased; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public DateTimeType getDeceasedDateTimeType() throws Exception { - if (!(this.deceased instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (DateTimeType) this.deceased; - } - - public boolean hasDeceased() { - return this.deceased != null && !this.deceased.isEmpty(); - } - - /** - * @param value {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public Patient setDeceased(Type value) { - this.deceased = value; - return this; - } - - /** - * @return {@link #address} (Addresses for the individual.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (Addresses for the individual.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - /** - * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) - */ - public CodeableConcept getMaritalStatus() { - if (this.maritalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.maritalStatus"); - else if (Configuration.doAutoCreate()) - this.maritalStatus = new CodeableConcept(); - return this.maritalStatus; - } - - public boolean hasMaritalStatus() { - return this.maritalStatus != null && !this.maritalStatus.isEmpty(); - } - - /** - * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) - */ - public Patient setMaritalStatus(CodeableConcept value) { - this.maritalStatus = value; - return this; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public Type getMultipleBirth() { - return this.multipleBirth; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public BooleanType getMultipleBirthBooleanType() throws Exception { - if (!(this.multipleBirth instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); - return (BooleanType) this.multipleBirth; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public IntegerType getMultipleBirthIntegerType() throws Exception { - if (!(this.multipleBirth instanceof IntegerType)) - throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); - return (IntegerType) this.multipleBirth; - } - - public boolean hasMultipleBirth() { - return this.multipleBirth != null && !this.multipleBirth.isEmpty(); - } - - /** - * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) - */ - public Patient setMultipleBirth(Type value) { - this.multipleBirth = value; - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - /** - * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) - */ - // syntactic sugar - public ContactComponent addContact() { //3 - ContactComponent t = new ContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - /** - * @return {@link #animal} (This element has a value if the patient is an animal.) - */ - public AnimalComponent getAnimal() { - if (this.animal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.animal"); - else if (Configuration.doAutoCreate()) - this.animal = new AnimalComponent(); - return this.animal; - } - - public boolean hasAnimal() { - return this.animal != null && !this.animal.isEmpty(); - } - - /** - * @param value {@link #animal} (This element has a value if the patient is an animal.) - */ - public Patient setAnimal(AnimalComponent value) { - this.animal = value; - return this; - } - - /** - * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) - */ - public List getCommunication() { - if (this.communication == null) - this.communication = new ArrayList(); - return this.communication; - } - - public boolean hasCommunication() { - if (this.communication == null) - return false; - for (CodeableConcept item : this.communication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) - */ - // syntactic sugar - public CodeableConcept addCommunication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return t; - } - - /** - * @return {@link #careProvider} (Patient's nominated care provider.) - */ - public List getCareProvider() { - if (this.careProvider == null) - this.careProvider = new ArrayList(); - return this.careProvider; - } - - public boolean hasCareProvider() { - if (this.careProvider == null) - return false; - for (Reference item : this.careProvider) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #careProvider} (Patient's nominated care provider.) - */ - // syntactic sugar - public Reference addCareProvider() { //3 - Reference t = new Reference(); - if (this.careProvider == null) - this.careProvider = new ArrayList(); - this.careProvider.add(t); - return t; - } - - /** - * @return {@link #careProvider} (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. Patient's nominated care provider.) - */ - public List getCareProviderTarget() { - if (this.careProviderTarget == null) - this.careProviderTarget = new ArrayList(); - return this.careProviderTarget; - } - - /** - * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.) - */ - public Patient setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} 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. (Organization that is the custodian of the patient record.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} 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. (Organization that is the custodian of the patient record.) - */ - public Patient setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #link} (Link to another patient resource that concerns the same actual person.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (PatientLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Link to another patient resource that concerns the same actual person.) - */ - // syntactic sugar - public PatientLinkComponent addLink() { //3 - PatientLinkComponent t = new PatientLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - /** - * @return {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Patient setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this patient record is in active use. - */ - public boolean getActive() { - return this.active == null ? false : this.active.getValue(); - } - - /** - * @param value Whether this patient record is in active use. - */ - public Patient setActive(boolean value) { - if (value == false) - this.active = null; - else { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person as a patient.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "dateTime", "The date and time of birth for the individual.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, java.lang.Integer.MAX_VALUE, deceased)); - childrenList.add(new Property("address", "Address", "Addresses for the individual.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, java.lang.Integer.MAX_VALUE, maritalStatus)); - childrenList.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple or indicates the actual birth order.", 0, java.lang.Integer.MAX_VALUE, multipleBirth)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("animal", "", "This element has a value if the patient is an animal.", 0, java.lang.Integer.MAX_VALUE, animal)); - childrenList.add(new Property("communication", "CodeableConcept", "Languages which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication)); - childrenList.add(new Property("careProvider", "Reference(Organization|Practitioner)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, careProvider)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("link", "", "Link to another patient resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("active", "boolean", "Whether this patient record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - } - - public Patient copy() { - Patient dst = new Patient(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - dst.deceased = deceased == null ? null : deceased.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy(); - dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.animal = animal == null ? null : animal.copy(); - if (communication != null) { - dst.communication = new ArrayList(); - for (CodeableConcept i : communication) - dst.communication.add(i.copy()); - }; - if (careProvider != null) { - dst.careProvider = new ArrayList(); - for (Reference i : careProvider) - dst.careProvider.add(i.copy()); - }; - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (PatientLinkComponent i : link) - dst.link.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - return dst; - } - - protected Patient typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) - && (deceased == null || deceased.isEmpty()) && (address == null || address.isEmpty()) && (maritalStatus == null || maritalStatus.isEmpty()) - && (multipleBirth == null || multipleBirth.isEmpty()) && (photo == null || photo.isEmpty()) - && (contact == null || contact.isEmpty()) && (animal == null || animal.isEmpty()) && (communication == null || communication.isEmpty()) - && (careProvider == null || careProvider.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (link == null || link.isEmpty()) && (active == null || active.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Patient; - } - - @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token" ) - public static final String SP_ANIMALBREED = "animal-breed"; - @SearchParamDefinition(name="phonetic", path="", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" ) - public static final String SP_LINK = "link"; - @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token" ) - public static final String SP_ANIMALSPECIES = "animal-species"; - @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" ) - public static final String SP_GIVEN = "given"; - @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" ) - public static final String SP_CAREPROVIDER = "careprovider"; - @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" ) - public static final String SP_FAMILY = "family"; - @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="string" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) - public static final String SP_ACTIVE = "active"; - @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="language", path="Patient.communication", description="Language code (irrespective of use value)", type="token" ) - public static final String SP_LANGUAGE = "language"; - @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * Demographics and other administrative information about a person or animal receiving care or other health-related services. + */ +@ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") +public class Patient extends DomainResource { + + public enum AdministrativeGender implements FhirEnum { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) throws IllegalArgumentException { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum LinkType implements FhirEnum { + /** + * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. + */ + REPLACE, + /** + * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. + */ + REFER, + /** + * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. + */ + SEEALSO, + /** + * added to help the parsers + */ + NULL; + + public static final LinkTypeEnumFactory ENUM_FACTORY = new LinkTypeEnumFactory(); + + public static LinkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("replace".equals(codeString)) + return REPLACE; + if ("refer".equals(codeString)) + return REFER; + if ("seealso".equals(codeString)) + return SEEALSO; + throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REPLACE: return "replace"; + case REFER: return "refer"; + case SEEALSO: return "seealso"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REPLACE: return ""; + case REFER: return ""; + case SEEALSO: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REPLACE: return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link."; + case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information."; + case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REPLACE: return "replace"; + case REFER: return "refer"; + case SEEALSO: return "see also"; + default: return "?"; + } + } + } + + public static class LinkTypeEnumFactory implements EnumFactory { + public LinkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("replace".equals(codeString)) + return LinkType.REPLACE; + if ("refer".equals(codeString)) + return LinkType.REFER; + if ("seealso".equals(codeString)) + return LinkType.SEEALSO; + throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); + } + public String toCode(LinkType code) throws IllegalArgumentException { + if (code == LinkType.REPLACE) + return "replace"; + if (code == LinkType.REFER) + return "refer"; + if (code == LinkType.SEEALSO) + return "seealso"; + return "?"; + } + } + + @Block() + public static class ContactComponent extends BackboneElement { + /** + * The nature of the relationship between the patient and the contact person. + */ + @Child(name="relationship", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." ) + protected List relationship; + + /** + * A name associated with the person. + */ + @Child(name="name", type={HumanName.class}, order=2, min=0, max=1) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected HumanName name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Address for the contact person. + */ + @Child(name="address", type={Address.class}, order=4, min=0, max=1) + @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." ) + protected Address address; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name="gender", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * Organization on behalf of which the contact is acting or for which the contact is working. + */ + @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Organization that is associated with the contact", formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + protected Organization organizationTarget; + + /** + * The period during which this person or organisation is valid to be contacted relating to this patient. + */ + @Child(name="period", type={Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="The period during which this person or organisation is valid to be contacted relating to this patient", formalDefinition="The period during which this person or organisation is valid to be contacted relating to this patient." ) + protected Period period; + + private static final long serialVersionUID = 364269017L; + + public ContactComponent() { + super(); + } + + /** + * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) + */ + public List getRelationship() { + if (this.relationship == null) + this.relationship = new ArrayList(); + return this.relationship; + } + + public boolean hasRelationship() { + if (this.relationship == null) + return false; + for (CodeableConcept item : this.relationship) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) + */ + // syntactic sugar + public CodeableConcept addRelationship() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.relationship == null) + this.relationship = new ArrayList(); + this.relationship.add(t); + return t; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the person.) + */ + public ContactComponent setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #address} (Address for the contact person.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Address for the contact person.) + */ + public ContactComponent setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public ContactComponent setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public ContactComponent setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public ContactComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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. (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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. (Organization on behalf of which the contact is acting or for which the contact is working.) + */ + public ContactComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #period} (The period during which this person or organisation is valid to be contacted relating to this patient.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContactComponent.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} (The period during which this person or organisation is valid to be contacted relating to this patient.) + */ + public ContactComponent setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "Address for the contact person.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("period", "Period", "The period during which this person or organisation is valid to be contacted relating to this patient.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public ContactComponent copy() { + ContactComponent dst = new ContactComponent(); + copyValues(dst); + if (relationship != null) { + dst.relationship = new ArrayList(); + for (CodeableConcept i : relationship) + dst.relationship.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.address = address == null ? null : address.copy(); + dst.gender = gender == null ? null : gender.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.period = period == null ? null : period.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) + && (organization == null || organization.isEmpty()) && (period == null || period.isEmpty()) + ; + } + + } + + @Block() + public static class AnimalComponent extends BackboneElement { + /** + * Identifies the high level categorization of the kind of animal. + */ + @Child(name="species", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="E.g. Dog, Cow", formalDefinition="Identifies the high level categorization of the kind of animal." ) + protected CodeableConcept species; + + /** + * Identifies the detailed categorization of the kind of animal. + */ + @Child(name="breed", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="E.g. Poodle, Angus", formalDefinition="Identifies the detailed categorization of the kind of animal." ) + protected CodeableConcept breed; + + /** + * Indicates the current state of the animal's reproductive organs. + */ + @Child(name="genderStatus", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="E.g. Neutered, Intact", formalDefinition="Indicates the current state of the animal's reproductive organs." ) + protected CodeableConcept genderStatus; + + private static final long serialVersionUID = -549738382L; + + public AnimalComponent() { + super(); + } + + public AnimalComponent(CodeableConcept species) { + super(); + this.species = species; + } + + /** + * @return {@link #species} (Identifies the high level categorization of the kind of animal.) + */ + public CodeableConcept getSpecies() { + if (this.species == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.species"); + else if (Configuration.doAutoCreate()) + this.species = new CodeableConcept(); + return this.species; + } + + public boolean hasSpecies() { + return this.species != null && !this.species.isEmpty(); + } + + /** + * @param value {@link #species} (Identifies the high level categorization of the kind of animal.) + */ + public AnimalComponent setSpecies(CodeableConcept value) { + this.species = value; + return this; + } + + /** + * @return {@link #breed} (Identifies the detailed categorization of the kind of animal.) + */ + public CodeableConcept getBreed() { + if (this.breed == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.breed"); + else if (Configuration.doAutoCreate()) + this.breed = new CodeableConcept(); + return this.breed; + } + + public boolean hasBreed() { + return this.breed != null && !this.breed.isEmpty(); + } + + /** + * @param value {@link #breed} (Identifies the detailed categorization of the kind of animal.) + */ + public AnimalComponent setBreed(CodeableConcept value) { + this.breed = value; + return this; + } + + /** + * @return {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) + */ + public CodeableConcept getGenderStatus() { + if (this.genderStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create AnimalComponent.genderStatus"); + else if (Configuration.doAutoCreate()) + this.genderStatus = new CodeableConcept(); + return this.genderStatus; + } + + public boolean hasGenderStatus() { + return this.genderStatus != null && !this.genderStatus.isEmpty(); + } + + /** + * @param value {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) + */ + public AnimalComponent setGenderStatus(CodeableConcept value) { + this.genderStatus = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("species", "CodeableConcept", "Identifies the high level categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, species)); + childrenList.add(new Property("breed", "CodeableConcept", "Identifies the detailed categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, breed)); + childrenList.add(new Property("genderStatus", "CodeableConcept", "Indicates the current state of the animal's reproductive organs.", 0, java.lang.Integer.MAX_VALUE, genderStatus)); + } + + public AnimalComponent copy() { + AnimalComponent dst = new AnimalComponent(); + copyValues(dst); + dst.species = species == null ? null : species.copy(); + dst.breed = breed == null ? null : breed.copy(); + dst.genderStatus = genderStatus == null ? null : genderStatus.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (species == null || species.isEmpty()) && (breed == null || breed.isEmpty()) + && (genderStatus == null || genderStatus.isEmpty()); + } + + } + + @Block() + public static class PatientLinkComponent extends BackboneElement { + /** + * The other patient resource that the link refers to. + */ + @Child(name="other", type={Patient.class}, order=1, min=1, max=1) + @Description(shortDefinition="The other patient resource that the link refers to", formalDefinition="The other patient resource that the link refers to." ) + protected Reference other; + + /** + * The actual object that is the target of the reference (The other patient resource that the link refers to.) + */ + protected Patient otherTarget; + + /** + * The type of link between this patient resource and another patient resource. + */ + @Child(name="type", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="replace | refer | seealso - type of link", formalDefinition="The type of link between this patient resource and another patient resource." ) + protected Enumeration type; + + private static final long serialVersionUID = -1942104050L; + + public PatientLinkComponent() { + super(); + } + + public PatientLinkComponent(Reference other, Enumeration type) { + super(); + this.other = other; + this.type = type; + } + + /** + * @return {@link #other} (The other patient resource that the link refers to.) + */ + public Reference getOther() { + if (this.other == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.other = new Reference(); + return this.other; + } + + public boolean hasOther() { + return this.other != null && !this.other.isEmpty(); + } + + /** + * @param value {@link #other} (The other patient resource that the link refers to.) + */ + public PatientLinkComponent setOther(Reference value) { + this.other = value; + return this; + } + + /** + * @return {@link #other} 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 other patient resource that the link refers to.) + */ + public Patient getOtherTarget() { + if (this.otherTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.otherTarget = new Patient(); + return this.otherTarget; + } + + /** + * @param value {@link #other} 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 other patient resource that the link refers to.) + */ + public PatientLinkComponent setOtherTarget(Patient value) { + this.otherTarget = value; + return this; + } + + /** + * @return {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PatientLinkComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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 of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public PatientLinkComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of link between this patient resource and another patient resource. + */ + public LinkType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of link between this patient resource and another patient resource. + */ + public PatientLinkComponent setType(LinkType value) { + if (this.type == null) + this.type = new Enumeration(LinkType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("other", "Reference(Patient)", "The other patient resource that the link refers to.", 0, java.lang.Integer.MAX_VALUE, other)); + childrenList.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + public PatientLinkComponent copy() { + PatientLinkComponent dst = new PatientLinkComponent(); + copyValues(dst); + dst.other = other == null ? null : other.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (other == null || other.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + } + + /** + * An identifier that applies to this person as a patient. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An identifier for the person as this patient", formalDefinition="An identifier that applies to this person as a patient." ) + protected List identifier; + + /** + * A name associated with the individual. + */ + @Child(name="name", type={HumanName.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) + protected List name; + + /** + * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. + */ + @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the individual", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." ) + protected List telecom; + + /** + * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + @Child(name="gender", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date and time of birth for the individual. + */ + @Child(name="birthDate", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The date and time of birth for the individual", formalDefinition="The date and time of birth for the individual." ) + protected DateTimeType birthDate; + + /** + * Indicates if the individual is deceased or not. + */ + @Child(name="deceased", type={BooleanType.class, DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." ) + protected Type deceased; + + /** + * Addresses for the individual. + */ + @Child(name="address", type={Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." ) + protected List
address; + + /** + * This field contains a patient's most recent marital (civil) status. + */ + @Child(name="maritalStatus", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Marital (civil) status of a person", formalDefinition="This field contains a patient's most recent marital (civil) status." ) + protected CodeableConcept maritalStatus; + + /** + * Indicates whether the patient is part of a multiple or indicates the actual birth order. + */ + @Child(name="multipleBirth", type={BooleanType.class, IntegerType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple or indicates the actual birth order." ) + protected Type multipleBirth; + + /** + * Image of the person. + */ + @Child(name="photo", type={Attachment.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + /** + * A contact party (e.g. guardian, partner, friend) for the patient. + */ + @Child(name="contact", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient." ) + protected List contact; + + /** + * This element has a value if the patient is an animal. + */ + @Child(name="animal", type={}, order=10, min=0, max=1) + @Description(shortDefinition="If this patient is an animal (non-human)", formalDefinition="This element has a value if the patient is an animal." ) + protected AnimalComponent animal; + + /** + * Languages which may be used to communicate with the patient about his or her health. + */ + @Child(name="communication", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Languages which may be used to communicate with the patient about his or her health", formalDefinition="Languages which may be used to communicate with the patient about his or her health." ) + protected List communication; + + /** + * Patient's nominated care provider. + */ + @Child(name="careProvider", type={Organization.class, Practitioner.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Patient's nominated care provider", formalDefinition="Patient's nominated care provider." ) + protected List careProvider; + /** + * The actual objects that are the target of the reference (Patient's nominated care provider.) + */ + protected List careProviderTarget; + + + /** + * Organization that is the custodian of the patient record. + */ + @Child(name="managingOrganization", type={Organization.class}, order=13, min=0, max=1) + @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (Organization that is the custodian of the patient record.) + */ + protected Organization managingOrganizationTarget; + + /** + * Link to another patient resource that concerns the same actual person. + */ + @Child(name="link", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual person." ) + protected List link; + + /** + * Whether this patient record is in active use. + */ + @Child(name="active", type={BooleanType.class}, order=15, min=0, max=1) + @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use." ) + protected BooleanType active; + + private static final long serialVersionUID = 1020038018L; + + public Patient() { + super(); + } + + /** + * @return {@link #identifier} (An identifier that applies to this person as a patient.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (An identifier that applies to this person as a patient.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (A name associated with the individual.) + */ + public List getName() { + if (this.name == null) + this.name = new ArrayList(); + return this.name; + } + + public boolean hasName() { + if (this.name == null) + return false; + for (HumanName item : this.name) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #name} (A name associated with the individual.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Patient setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + */ + public Patient setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date and time of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateTimeType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateTimeType(); + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The date and time of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Patient setBirthDateElement(DateTimeType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date and time of birth for the individual. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date and time of birth for the individual. + */ + public Patient setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateTimeType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public Type getDeceased() { + return this.deceased; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public BooleanType getDeceasedBooleanType() throws Exception { + if (!(this.deceased instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (BooleanType) this.deceased; + } + + /** + * @return {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public DateTimeType getDeceasedDateTimeType() throws Exception { + if (!(this.deceased instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered"); + return (DateTimeType) this.deceased; + } + + public boolean hasDeceased() { + return this.deceased != null && !this.deceased.isEmpty(); + } + + /** + * @param value {@link #deceased} (Indicates if the individual is deceased or not.) + */ + public Patient setDeceased(Type value) { + this.deceased = value; + return this; + } + + /** + * @return {@link #address} (Addresses for the individual.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (Addresses for the individual.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + /** + * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) + */ + public CodeableConcept getMaritalStatus() { + if (this.maritalStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.maritalStatus"); + else if (Configuration.doAutoCreate()) + this.maritalStatus = new CodeableConcept(); + return this.maritalStatus; + } + + public boolean hasMaritalStatus() { + return this.maritalStatus != null && !this.maritalStatus.isEmpty(); + } + + /** + * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) + */ + public Patient setMaritalStatus(CodeableConcept value) { + this.maritalStatus = value; + return this; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public Type getMultipleBirth() { + return this.multipleBirth; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public BooleanType getMultipleBirthBooleanType() throws Exception { + if (!(this.multipleBirth instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); + return (BooleanType) this.multipleBirth; + } + + /** + * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public IntegerType getMultipleBirthIntegerType() throws Exception { + if (!(this.multipleBirth instanceof IntegerType)) + throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); + return (IntegerType) this.multipleBirth; + } + + public boolean hasMultipleBirth() { + return this.multipleBirth != null && !this.multipleBirth.isEmpty(); + } + + /** + * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple or indicates the actual birth order.) + */ + public Patient setMultipleBirth(Type value) { + this.multipleBirth = value; + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + /** + * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactComponent item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) + */ + // syntactic sugar + public ContactComponent addContact() { //3 + ContactComponent t = new ContactComponent(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + /** + * @return {@link #animal} (This element has a value if the patient is an animal.) + */ + public AnimalComponent getAnimal() { + if (this.animal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.animal"); + else if (Configuration.doAutoCreate()) + this.animal = new AnimalComponent(); + return this.animal; + } + + public boolean hasAnimal() { + return this.animal != null && !this.animal.isEmpty(); + } + + /** + * @param value {@link #animal} (This element has a value if the patient is an animal.) + */ + public Patient setAnimal(AnimalComponent value) { + this.animal = value; + return this; + } + + /** + * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) + */ + public List getCommunication() { + if (this.communication == null) + this.communication = new ArrayList(); + return this.communication; + } + + public boolean hasCommunication() { + if (this.communication == null) + return false; + for (CodeableConcept item : this.communication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) + */ + // syntactic sugar + public CodeableConcept addCommunication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return t; + } + + /** + * @return {@link #careProvider} (Patient's nominated care provider.) + */ + public List getCareProvider() { + if (this.careProvider == null) + this.careProvider = new ArrayList(); + return this.careProvider; + } + + public boolean hasCareProvider() { + if (this.careProvider == null) + return false; + for (Reference item : this.careProvider) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #careProvider} (Patient's nominated care provider.) + */ + // syntactic sugar + public Reference addCareProvider() { //3 + Reference t = new Reference(); + if (this.careProvider == null) + this.careProvider = new ArrayList(); + this.careProvider.add(t); + return t; + } + + /** + * @return {@link #careProvider} (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. Patient's nominated care provider.) + */ + public List getCareProviderTarget() { + if (this.careProviderTarget == null) + this.careProviderTarget = new ArrayList(); + return this.careProviderTarget; + } + + /** + * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.) + */ + public Patient setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} 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. (Organization that is the custodian of the patient record.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} 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. (Organization that is the custodian of the patient record.) + */ + public Patient setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #link} (Link to another patient resource that concerns the same actual person.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (PatientLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Link to another patient resource that concerns the same actual person.) + */ + // syntactic sugar + public PatientLinkComponent addLink() { //3 + PatientLinkComponent t = new PatientLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + /** + * @return {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Patient.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Patient setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this patient record is in active use. + */ + public boolean getActive() { + return this.active == null ? false : this.active.getValue(); + } + + /** + * @param value Whether this patient record is in active use. + */ + public Patient setActive(boolean value) { + if (value == false) + this.active = null; + else { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person as a patient.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "dateTime", "The date and time of birth for the individual.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, java.lang.Integer.MAX_VALUE, deceased)); + childrenList.add(new Property("address", "Address", "Addresses for the individual.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, java.lang.Integer.MAX_VALUE, maritalStatus)); + childrenList.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple or indicates the actual birth order.", 0, java.lang.Integer.MAX_VALUE, multipleBirth)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("animal", "", "This element has a value if the patient is an animal.", 0, java.lang.Integer.MAX_VALUE, animal)); + childrenList.add(new Property("communication", "CodeableConcept", "Languages which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication)); + childrenList.add(new Property("careProvider", "Reference(Organization|Practitioner)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, careProvider)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("link", "", "Link to another patient resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); + childrenList.add(new Property("active", "boolean", "Whether this patient record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + } + + public Patient copy() { + Patient dst = new Patient(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (name != null) { + dst.name = new ArrayList(); + for (HumanName i : name) + dst.name.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + dst.deceased = deceased == null ? null : deceased.copy(); + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy(); + dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactComponent i : contact) + dst.contact.add(i.copy()); + }; + dst.animal = animal == null ? null : animal.copy(); + if (communication != null) { + dst.communication = new ArrayList(); + for (CodeableConcept i : communication) + dst.communication.add(i.copy()); + }; + if (careProvider != null) { + dst.careProvider = new ArrayList(); + for (Reference i : careProvider) + dst.careProvider.add(i.copy()); + }; + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (PatientLinkComponent i : link) + dst.link.add(i.copy()); + }; + dst.active = active == null ? null : active.copy(); + return dst; + } + + protected Patient typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) + && (deceased == null || deceased.isEmpty()) && (address == null || address.isEmpty()) && (maritalStatus == null || maritalStatus.isEmpty()) + && (multipleBirth == null || multipleBirth.isEmpty()) && (photo == null || photo.isEmpty()) + && (contact == null || contact.isEmpty()) && (animal == null || animal.isEmpty()) && (communication == null || communication.isEmpty()) + && (careProvider == null || careProvider.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (link == null || link.isEmpty()) && (active == null || active.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Patient; + } + + @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token" ) + public static final String SP_ANIMALBREED = "animal-breed"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" ) + public static final String SP_LINK = "link"; + @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token" ) + public static final String SP_ANIMALSPECIES = "animal-species"; + @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" ) + public static final String SP_GIVEN = "given"; + @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" ) + public static final String SP_CAREPROVIDER = "careprovider"; + @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" ) + public static final String SP_FAMILY = "family"; + @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="string" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) + public static final String SP_ACTIVE = "active"; + @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="language", path="Patient.communication", description="Language code (irrespective of use value)", type="token" ) + public static final String SP_LANGUAGE = "language"; + @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java index bb824483e04..bf86559a946 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java @@ -20,571 +20,571 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * This resource provides the request and response details for the request for which the payment status is being reported. - */ -@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice") -public class PaymentNotice extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Reference of resource to reverse. - */ - @Child(name="request", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource to reverse.) - */ - protected Resource requestTarget; - - /** - * Reference of response to resource to reverse. - */ - @Child(name="response", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Reference of response to resource to reverse.) - */ - protected Resource responseTarget; - - /** - * The payment status, typically paid: payment sent, cleared: payment received. - */ - @Child(name="paymentStatus", type={Coding.class}, order=8, min=1, max=1) - @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) - protected Coding paymentStatus; - - private static final long serialVersionUID = -394826458L; - - public PaymentNotice() { - super(); - } - - public PaymentNotice(Coding paymentStatus) { - super(); - this.paymentStatus = paymentStatus; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 PaymentNotice setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PaymentNotice setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 PaymentNotice setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public PaymentNotice setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public PaymentNotice setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 PaymentNotice setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentNotice setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 PaymentNotice setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentNotice setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 PaymentNotice setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public PaymentNotice setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Reference of resource to reverse.) - */ - public Resource getRequestTarget() { - 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. (Reference of resource to reverse.) - */ - public PaymentNotice setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource to reverse.) - */ - public PaymentNotice setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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. (Reference of response to resource to reverse.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} 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 of response to resource to reverse.) - */ - public PaymentNotice setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) - */ - public Coding getPaymentStatus() { - if (this.paymentStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); - else if (Configuration.doAutoCreate()) - this.paymentStatus = new Coding(); - return this.paymentStatus; - } - - public boolean hasPaymentStatus() { - return this.paymentStatus != null && !this.paymentStatus.isEmpty(); - } - - /** - * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) - */ - public PaymentNotice setPaymentStatus(Coding value) { - this.paymentStatus = value; - return this; - } - - protected void listChildren(List 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("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("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)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); - } - - public PaymentNotice copy() { - PaymentNotice dst = new PaymentNotice(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); - return dst; - } - - protected PaymentNotice typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PaymentNotice; - } - - @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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.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; +/** + * This resource provides the request and response details for the request for which the payment status is being reported. + */ +@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice") +public class PaymentNotice extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Reference of resource to reverse. + */ + @Child(name="request", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource to reverse.) + */ + protected Resource requestTarget; + + /** + * Reference of response to resource to reverse. + */ + @Child(name="response", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Reference of response to resource to reverse.) + */ + protected Resource responseTarget; + + /** + * The payment status, typically paid: payment sent, cleared: payment received. + */ + @Child(name="paymentStatus", type={Coding.class}, order=8, min=1, max=1) + @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) + protected Coding paymentStatus; + + private static final long serialVersionUID = -394826458L; + + public PaymentNotice() { + super(); + } + + public PaymentNotice(Coding paymentStatus) { + super(); + this.paymentStatus = paymentStatus; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 PaymentNotice setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public PaymentNotice setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 PaymentNotice setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public PaymentNotice setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public PaymentNotice setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 PaymentNotice setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentNotice setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 PaymentNotice setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentNotice setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 PaymentNotice setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public PaymentNotice setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Reference of resource to reverse.) + */ + public Resource getRequestTarget() { + 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. (Reference of resource to reverse.) + */ + public PaymentNotice setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource to reverse.) + */ + public PaymentNotice setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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. (Reference of response to resource to reverse.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} 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 of response to resource to reverse.) + */ + public PaymentNotice setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) + */ + public Coding getPaymentStatus() { + if (this.paymentStatus == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); + else if (Configuration.doAutoCreate()) + this.paymentStatus = new Coding(); + return this.paymentStatus; + } + + public boolean hasPaymentStatus() { + return this.paymentStatus != null && !this.paymentStatus.isEmpty(); + } + + /** + * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) + */ + public PaymentNotice setPaymentStatus(Coding value) { + this.paymentStatus = value; + return this; + } + + protected void listChildren(List 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("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("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)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); + } + + public PaymentNotice copy() { + PaymentNotice dst = new PaymentNotice(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); + return dst; + } + + protected PaymentNotice typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PaymentNotice; + } + + @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java index e6ad4d81eab..06ecae2c157 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java @@ -20,1407 +20,1407 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides payment details supporting a bulk payment, or the errors in, processing a ReconciliationRequest resource. - */ -@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") -public class PaymentReconciliation extends DomainResource { - - public enum RSLink implements FhirEnum { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified with errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - - 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified with errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class RSLinkEnumFactory implements EnumFactory { - public RSLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RSLink.COMPLETE; - if ("error".equals(codeString)) - return RSLink.ERROR; - throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); - } - public String toCode(RSLink code) throws IllegalArgumentException { - if (code == RSLink.COMPLETE) - return "complete"; - if (code == RSLink.ERROR) - return "error"; - return "?"; - } - } - - @Block() - public static class DetailsComponent extends BackboneElement { - /** - * Code to indicate the nature of the payment, adjustment, funds advance, etc. - */ - @Child(name="type", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) - protected Coding type; - - /** - * The claim or financial resource. - */ - @Child(name="request", type={}, order=2, min=0, max=1) - @Description(shortDefinition="Claim", formalDefinition="The claim or financial resource." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (The claim or financial resource.) - */ - protected Resource requestTarget; - - /** - * The claim response resource. - */ - @Child(name="responce", type={}, order=3, min=0, max=1) - @Description(shortDefinition="Claim Response", formalDefinition="The claim response resource." ) - protected Reference responce; - - /** - * The actual object that is the target of the reference (The claim response resource.) - */ - protected Resource responceTarget; - - /** - * The Organization which submitted the invoice or financial transaction. - */ - @Child(name="submitter", type={Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Submitter", formalDefinition="The Organization which submitted the invoice or financial transaction." ) - protected Reference submitter; - - /** - * The actual object that is the target of the reference (The Organization which submitted the invoice or financial transaction.) - */ - protected Organization submitterTarget; - - /** - * The organization which is receiving the payment. - */ - @Child(name="payee", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="The organization which is receiving the payment." ) - protected Reference payee; - - /** - * The actual object that is the target of the reference (The organization which is receiving the payment.) - */ - protected Organization payeeTarget; - - /** - * The date of the invoice or financial resource. - */ - @Child(name="date", type={DateType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Invoice date", formalDefinition="The date of the invoice or financial resource." ) - protected DateType date; - - /** - * Amount paid for this detail. - */ - @Child(name="amount", type={Money.class}, order=7, min=0, max=1) - @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) - protected Money amount; - - private static final long serialVersionUID = -1644048062L; - - public DetailsComponent() { - super(); - } - - public DetailsComponent(Coding type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) - */ - public DetailsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #request} (The claim or financial resource.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (The claim or financial resource.) - */ - public DetailsComponent setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (The claim or financial resource.) - */ - public Resource getRequestTarget() { - 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. (The claim or financial resource.) - */ - public DetailsComponent setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #responce} (The claim response resource.) - */ - public Reference getResponce() { - if (this.responce == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.responce"); - else if (Configuration.doAutoCreate()) - this.responce = new Reference(); - return this.responce; - } - - public boolean hasResponce() { - return this.responce != null && !this.responce.isEmpty(); - } - - /** - * @param value {@link #responce} (The claim response resource.) - */ - public DetailsComponent setResponce(Reference value) { - this.responce = value; - return this; - } - - /** - * @return {@link #responce} 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 claim response resource.) - */ - public Resource getResponceTarget() { - return this.responceTarget; - } - - /** - * @param value {@link #responce} 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 claim response resource.) - */ - public DetailsComponent setResponceTarget(Resource value) { - this.responceTarget = value; - return this; - } - - /** - * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public Reference getSubmitter() { - if (this.submitter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.submitter"); - else if (Configuration.doAutoCreate()) - this.submitter = new Reference(); - return this.submitter; - } - - public boolean hasSubmitter() { - return this.submitter != null && !this.submitter.isEmpty(); - } - - /** - * @param value {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public DetailsComponent setSubmitter(Reference value) { - this.submitter = value; - return this; - } - - /** - * @return {@link #submitter} 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 Organization which submitted the invoice or financial transaction.) - */ - public Organization getSubmitterTarget() { - if (this.submitterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.submitter"); - else if (Configuration.doAutoCreate()) - this.submitterTarget = new Organization(); - return this.submitterTarget; - } - - /** - * @param value {@link #submitter} 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 submitted the invoice or financial transaction.) - */ - public DetailsComponent setSubmitterTarget(Organization value) { - this.submitterTarget = value; - return this; - } - - /** - * @return {@link #payee} (The organization which is receiving the payment.) - */ - public Reference getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new Reference(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (The organization which is receiving the payment.) - */ - public DetailsComponent setPayee(Reference value) { - this.payee = value; - return this; - } - - /** - * @return {@link #payee} 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 organization which is receiving the payment.) - */ - public Organization getPayeeTarget() { - if (this.payeeTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.payee"); - else if (Configuration.doAutoCreate()) - this.payeeTarget = new Organization(); - return this.payeeTarget; - } - - /** - * @param value {@link #payee} 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 receiving the payment.) - */ - public DetailsComponent setPayeeTarget(Organization value) { - this.payeeTarget = value; - return this; - } - - /** - * @return {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DetailsComponent setDateElement(DateType value) { - this.date = value; - return this; - } - - /** - * @return The date of the invoice or financial resource. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date of the invoice or financial resource. - */ - public DetailsComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #amount} (Amount paid for this detail.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Amount paid for this detail.) - */ - public DetailsComponent setAmount(Money value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("request", "Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("responce", "Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, responce)); - childrenList.add(new Property("submitter", "Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); - childrenList.add(new Property("payee", "Reference(Organization)", "The organization which is receiving the payment.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("date", "date", "The date of the invoice or financial resource.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("amount", "Money", "Amount paid for this detail.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - public DetailsComponent copy() { - DetailsComponent dst = new DetailsComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.request = request == null ? null : request.copy(); - dst.responce = responce == null ? null : responce.copy(); - dst.submitter = submitter == null ? null : submitter.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.date = date == null ? null : date.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (request == null || request.isEmpty()) - && (responce == null || responce.isEmpty()) && (submitter == null || submitter.isEmpty()) - && (payee == null || payee.isEmpty()) && (date == null || date.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - } - - @Block() - public static class NotesComponent extends BackboneElement { - /** - * The note purpose: Print/Display. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name="text", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Notes text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 129959202L; - - public NotesComponent() { - super(); - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @Child(name="request", type={PendedRequest.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 PendedRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * The period of time for which payments have been gathered into this bulk payment for settlement. - */ - @Child(name="period", type={Period.class}, order=6, min=0, max=1) - @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." ) - protected Period period; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name="organization", type={Organization.class}, order=7, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="requestProvider", type={Practitioner.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="requestOrganization", type={Organization.class}, order=9, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - /** - * List of individual settlement amounts and the corresponding transaction. - */ - @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Details", formalDefinition="List of individual settlement amounts and the corresponding transaction." ) - protected List detail; - - /** - * The form to be used for printing the content. - */ - @Child(name="form", type={Coding.class}, order=11, min=0, max=1) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Total payment amount. - */ - @Child(name="total", type={Money.class}, order=12, min=1, max=1) - @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) - protected Money total; - - /** - * List of errors detected in the request. - */ - @Child(name="error", type={Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Error code", formalDefinition="List of errors detected in the request." ) - protected List error; - - /** - * Suite of notes. - */ - @Child(name="note", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) - protected List note; - - private static final long serialVersionUID = 1739436327L; - - public PaymentReconciliation() { - super(); - } - - public PaymentReconciliation(Money total) { - super(); - this.total = total; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public PaymentReconciliation setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 PendedRequest getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new PendedRequest(); - 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 PaymentReconciliation setRequestTarget(PendedRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public PaymentReconciliation setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RSLink getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public PaymentReconciliation setOutcome(RSLink value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(RSLink.ENUM_FACTORY); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public PaymentReconciliation setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public PaymentReconciliation setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 PaymentReconciliation setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PaymentReconciliation setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 PaymentReconciliation setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 PaymentReconciliation setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.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} (The period of time for which payments have been gathered into this bulk payment for settlement.) - */ - public PaymentReconciliation setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public PaymentReconciliation setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Insurer who produced this adjudicated response.) - */ - public PaymentReconciliation setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} 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 PaymentReconciliation setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} 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 PaymentReconciliation setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - /** - * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailsComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) - */ - // syntactic sugar - public DetailsComponent addDetail() { //3 - DetailsComponent t = new DetailsComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public PaymentReconciliation setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #total} (Total payment amount.) - */ - public Money getTotal() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.total"); - else if (Configuration.doAutoCreate()) - this.total = new Money(); - return this.total; - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (Total payment amount.) - */ - public PaymentReconciliation setTotal(Money value) { - this.total = value; - return this; - } - - /** - * @return {@link #error} (List of errors detected in the request.) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (Coding item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (List of errors detected in the request.) - */ - // syntactic sugar - public Coding addError() { //3 - Coding t = new Coding(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - /** - * @return {@link #note} (Suite of notes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Suite of notes.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - protected void listChildren(List 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(PendedRequest)", "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("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("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, java.lang.Integer.MAX_VALUE, period)); - 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)); - childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("error", "Coding", "List of errors detected in the request.", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - public PaymentReconciliation copy() { - PaymentReconciliation dst = new PaymentReconciliation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.period = period == null ? null : period.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailsComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.form = form == null ? null : form.copy(); - dst.total = total == null ? null : total.copy(); - if (error != null) { - dst.error = new ArrayList(); - for (Coding i : error) - dst.error.add(i.copy()); - }; - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - protected PaymentReconciliation typedCopy() { - return copy(); - } - - public boolean isEmpty() { - 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()) - && (created == null || created.isEmpty()) && (period == null || period.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (detail == null || detail.isEmpty()) && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) - && (error == null || error.isEmpty()) && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PaymentReconciliation; - } - - @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides payment details supporting a bulk payment, or the errors in, processing a ReconciliationRequest resource. + */ +@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") +public class PaymentReconciliation extends DomainResource { + + public enum RSLink implements FhirEnum { + /** + * The processing completed without errors. + */ + COMPLETE, + /** + * The processing identified with errors. + */ + ERROR, + /** + * added to help the parsers + */ + NULL; + + 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 IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case ERROR: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The processing completed without errors."; + case ERROR: return "The processing identified with errors."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case ERROR: return "error"; + default: return "?"; + } + } + } + + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return RSLink.COMPLETE; + if ("error".equals(codeString)) + return RSLink.ERROR; + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); + } + public String toCode(RSLink code) throws IllegalArgumentException { + if (code == RSLink.COMPLETE) + return "complete"; + if (code == RSLink.ERROR) + return "error"; + return "?"; + } + } + + @Block() + public static class DetailsComponent extends BackboneElement { + /** + * Code to indicate the nature of the payment, adjustment, funds advance, etc. + */ + @Child(name="type", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) + protected Coding type; + + /** + * The claim or financial resource. + */ + @Child(name="request", type={}, order=2, min=0, max=1) + @Description(shortDefinition="Claim", formalDefinition="The claim or financial resource." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (The claim or financial resource.) + */ + protected Resource requestTarget; + + /** + * The claim response resource. + */ + @Child(name="responce", type={}, order=3, min=0, max=1) + @Description(shortDefinition="Claim Response", formalDefinition="The claim response resource." ) + protected Reference responce; + + /** + * The actual object that is the target of the reference (The claim response resource.) + */ + protected Resource responceTarget; + + /** + * The Organization which submitted the invoice or financial transaction. + */ + @Child(name="submitter", type={Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Submitter", formalDefinition="The Organization which submitted the invoice or financial transaction." ) + protected Reference submitter; + + /** + * The actual object that is the target of the reference (The Organization which submitted the invoice or financial transaction.) + */ + protected Organization submitterTarget; + + /** + * The organization which is receiving the payment. + */ + @Child(name="payee", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="The organization which is receiving the payment." ) + protected Reference payee; + + /** + * The actual object that is the target of the reference (The organization which is receiving the payment.) + */ + protected Organization payeeTarget; + + /** + * The date of the invoice or financial resource. + */ + @Child(name="date", type={DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Invoice date", formalDefinition="The date of the invoice or financial resource." ) + protected DateType date; + + /** + * Amount paid for this detail. + */ + @Child(name="amount", type={Money.class}, order=7, min=0, max=1) + @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) + protected Money amount; + + private static final long serialVersionUID = -1644048062L; + + public DetailsComponent() { + super(); + } + + public DetailsComponent(Coding type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) + */ + public DetailsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #request} (The claim or financial resource.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (The claim or financial resource.) + */ + public DetailsComponent setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (The claim or financial resource.) + */ + public Resource getRequestTarget() { + 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. (The claim or financial resource.) + */ + public DetailsComponent setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #responce} (The claim response resource.) + */ + public Reference getResponce() { + if (this.responce == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.responce"); + else if (Configuration.doAutoCreate()) + this.responce = new Reference(); + return this.responce; + } + + public boolean hasResponce() { + return this.responce != null && !this.responce.isEmpty(); + } + + /** + * @param value {@link #responce} (The claim response resource.) + */ + public DetailsComponent setResponce(Reference value) { + this.responce = value; + return this; + } + + /** + * @return {@link #responce} 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 claim response resource.) + */ + public Resource getResponceTarget() { + return this.responceTarget; + } + + /** + * @param value {@link #responce} 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 claim response resource.) + */ + public DetailsComponent setResponceTarget(Resource value) { + this.responceTarget = value; + return this; + } + + /** + * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public Reference getSubmitter() { + if (this.submitter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.submitter"); + else if (Configuration.doAutoCreate()) + this.submitter = new Reference(); + return this.submitter; + } + + public boolean hasSubmitter() { + return this.submitter != null && !this.submitter.isEmpty(); + } + + /** + * @param value {@link #submitter} (The Organization which submitted the invoice or financial transaction.) + */ + public DetailsComponent setSubmitter(Reference value) { + this.submitter = value; + return this; + } + + /** + * @return {@link #submitter} 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 Organization which submitted the invoice or financial transaction.) + */ + public Organization getSubmitterTarget() { + if (this.submitterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.submitter"); + else if (Configuration.doAutoCreate()) + this.submitterTarget = new Organization(); + return this.submitterTarget; + } + + /** + * @param value {@link #submitter} 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 submitted the invoice or financial transaction.) + */ + public DetailsComponent setSubmitterTarget(Organization value) { + this.submitterTarget = value; + return this; + } + + /** + * @return {@link #payee} (The organization which is receiving the payment.) + */ + public Reference getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new Reference(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (The organization which is receiving the payment.) + */ + public DetailsComponent setPayee(Reference value) { + this.payee = value; + return this; + } + + /** + * @return {@link #payee} 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 organization which is receiving the payment.) + */ + public Organization getPayeeTarget() { + if (this.payeeTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.payee"); + else if (Configuration.doAutoCreate()) + this.payeeTarget = new Organization(); + return this.payeeTarget; + } + + /** + * @param value {@link #payee} 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 receiving the payment.) + */ + public DetailsComponent setPayeeTarget(Organization value) { + this.payeeTarget = value; + return this; + } + + /** + * @return {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DetailsComponent setDateElement(DateType value) { + this.date = value; + return this; + } + + /** + * @return The date of the invoice or financial resource. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date of the invoice or financial resource. + */ + public DetailsComponent setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #amount} (Amount paid for this detail.) + */ + public Money getAmount() { + if (this.amount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailsComponent.amount"); + else if (Configuration.doAutoCreate()) + this.amount = new Money(); + return this.amount; + } + + public boolean hasAmount() { + return this.amount != null && !this.amount.isEmpty(); + } + + /** + * @param value {@link #amount} (Amount paid for this detail.) + */ + public DetailsComponent setAmount(Money value) { + this.amount = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("request", "Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("responce", "Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, responce)); + childrenList.add(new Property("submitter", "Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); + childrenList.add(new Property("payee", "Reference(Organization)", "The organization which is receiving the payment.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("date", "date", "The date of the invoice or financial resource.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("amount", "Money", "Amount paid for this detail.", 0, java.lang.Integer.MAX_VALUE, amount)); + } + + public DetailsComponent copy() { + DetailsComponent dst = new DetailsComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.request = request == null ? null : request.copy(); + dst.responce = responce == null ? null : responce.copy(); + dst.submitter = submitter == null ? null : submitter.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.date = date == null ? null : date.copy(); + dst.amount = amount == null ? null : amount.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (request == null || request.isEmpty()) + && (responce == null || responce.isEmpty()) && (submitter == null || submitter.isEmpty()) + && (payee == null || payee.isEmpty()) && (date == null || date.isEmpty()) && (amount == null || amount.isEmpty()) + ; + } + + } + + @Block() + public static class NotesComponent extends BackboneElement { + /** + * The note purpose: Print/Display. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name="text", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Notes text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 129959202L; + + public NotesComponent() { + super(); + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public NotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public NotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public NotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public NotesComponent copy() { + NotesComponent dst = new NotesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @Child(name="request", type={PendedRequest.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 PendedRequest requestTarget; + + /** + * Transaction status: error, complete. + */ + @Child(name="outcome", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) + protected Enumeration outcome; + + /** + * A description of the status of the adjudication. + */ + @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * The period of time for which payments have been gathered into this bulk payment for settlement. + */ + @Child(name="period", type={Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." ) + protected Period period; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name="organization", type={Organization.class}, order=7, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="requestProvider", type={Practitioner.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="requestOrganization", type={Organization.class}, order=9, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + /** + * List of individual settlement amounts and the corresponding transaction. + */ + @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Details", formalDefinition="List of individual settlement amounts and the corresponding transaction." ) + protected List detail; + + /** + * The form to be used for printing the content. + */ + @Child(name="form", type={Coding.class}, order=11, min=0, max=1) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Total payment amount. + */ + @Child(name="total", type={Money.class}, order=12, min=1, max=1) + @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) + protected Money total; + + /** + * List of errors detected in the request. + */ + @Child(name="error", type={Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Error code", formalDefinition="List of errors detected in the request." ) + protected List error; + + /** + * Suite of notes. + */ + @Child(name="note", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) + protected List note; + + private static final long serialVersionUID = 1739436327L; + + public PaymentReconciliation() { + super(); + } + + public PaymentReconciliation(Money total) { + super(); + this.total = total; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public PaymentReconciliation setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 PendedRequest getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new PendedRequest(); + 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 PaymentReconciliation setRequestTarget(PendedRequest value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public PaymentReconciliation setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Transaction status: error, complete. + */ + public RSLink getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Transaction status: error, complete. + */ + public PaymentReconciliation setOutcome(RSLink value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public PaymentReconciliation setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication. + */ + public PaymentReconciliation setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 PaymentReconciliation setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public PaymentReconciliation setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 PaymentReconciliation setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 PaymentReconciliation setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.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} (The period of time for which payments have been gathered into this bulk payment for settlement.) + */ + public PaymentReconciliation setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public PaymentReconciliation setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Insurer who produced this adjudicated response.) + */ + public PaymentReconciliation setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 PaymentReconciliation setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public PaymentReconciliation setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 PaymentReconciliation setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + /** + * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailsComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) + */ + // syntactic sugar + public DetailsComponent addDetail() { //3 + DetailsComponent t = new DetailsComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public PaymentReconciliation setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #total} (Total payment amount.) + */ + public Money getTotal() { + if (this.total == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.total"); + else if (Configuration.doAutoCreate()) + this.total = new Money(); + return this.total; + } + + public boolean hasTotal() { + return this.total != null && !this.total.isEmpty(); + } + + /** + * @param value {@link #total} (Total payment amount.) + */ + public PaymentReconciliation setTotal(Money value) { + this.total = value; + return this; + } + + /** + * @return {@link #error} (List of errors detected in the request.) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (Coding item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (List of errors detected in the request.) + */ + // syntactic sugar + public Coding addError() { //3 + Coding t = new Coding(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + /** + * @return {@link #note} (Suite of notes.) + */ + public List getNote() { + if (this.note == null) + this.note = new ArrayList(); + return this.note; + } + + public boolean hasNote() { + if (this.note == null) + return false; + for (NotesComponent item : this.note) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #note} (Suite of notes.) + */ + // syntactic sugar + public NotesComponent addNote() { //3 + NotesComponent t = new NotesComponent(); + if (this.note == null) + this.note = new ArrayList(); + this.note.add(t); + return t; + } + + protected void listChildren(List 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(PendedRequest)", "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("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("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, java.lang.Integer.MAX_VALUE, period)); + 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)); + childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); + childrenList.add(new Property("error", "Coding", "List of errors detected in the request.", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); + } + + public PaymentReconciliation copy() { + PaymentReconciliation dst = new PaymentReconciliation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.period = period == null ? null : period.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); + dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailsComponent i : detail) + dst.detail.add(i.copy()); + }; + dst.form = form == null ? null : form.copy(); + dst.total = total == null ? null : total.copy(); + if (error != null) { + dst.error = new ArrayList(); + for (Coding i : error) + dst.error.add(i.copy()); + }; + if (note != null) { + dst.note = new ArrayList(); + for (NotesComponent i : note) + dst.note.add(i.copy()); + }; + return dst; + } + + protected PaymentReconciliation typedCopy() { + return copy(); + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (period == null || period.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (detail == null || detail.isEmpty()) && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) + && (error == null || error.isEmpty()) && (note == null || note.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PaymentReconciliation; + } + + @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java index 55e7aeb5667..90ac7562f81 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java @@ -20,648 +20,648 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides the request and response details for the resource for which the stsatus is to be checked. - */ -@ResourceDef(name="PendedRequest", profile="http://hl7.org/fhir/Profile/PendedRequest") -public class PendedRequest extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Reference of resource to reverse. - */ - @Child(name="request", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource to reverse.) - */ - protected Resource requestTarget; - - /** - * Names of resource types to include. - */ - @Child(name="include", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource type(s) to include", formalDefinition="Names of resource types to include." ) - protected List include; - - /** - * Names of resource types to exclude. - */ - @Child(name="exclude", type={StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) - protected List exclude; - - /** - * A period of time during which the fulfilling resources would have been created. - */ - @Child(name="period", type={Period.class}, order=9, min=0, max=1) - @Description(shortDefinition="Period", formalDefinition="A period of time during which the fulfilling resources would have been created." ) - protected Period period; - - private static final long serialVersionUID = 1211492560L; - - public PendedRequest() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 PendedRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PendedRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 PendedRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public PendedRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public PendedRequest setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 PendedRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PendedRequest setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 PendedRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public PendedRequest setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 PendedRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public PendedRequest setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Reference of resource to reverse.) - */ - public Resource getRequestTarget() { - 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. (Reference of resource to reverse.) - */ - public PendedRequest setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #include} (Names of resource types to include.) - */ - public List getInclude() { - if (this.include == null) - this.include = new ArrayList(); - return this.include; - } - - public boolean hasInclude() { - if (this.include == null) - return false; - for (StringType item : this.include) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #include} (Names of resource types to include.) - */ - // syntactic sugar - public StringType addIncludeElement() {//2 - StringType t = new StringType(); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return t; - } - - /** - * @param value {@link #include} (Names of resource types to include.) - */ - public PendedRequest addInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return this; - } - - /** - * @param value {@link #include} (Names of resource types to include.) - */ - public boolean hasInclude(String value) { - if (this.include == null) - return false; - for (StringType v : this.include) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #exclude} (Names of resource types to exclude.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (StringType item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Names of resource types to exclude.) - */ - // syntactic sugar - public StringType addExcludeElement() {//2 - StringType t = new StringType(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - /** - * @param value {@link #exclude} (Names of resource types to exclude.) - */ - public PendedRequest addExclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return this; - } - - /** - * @param value {@link #exclude} (Names of resource types to exclude.) - */ - public boolean hasExclude(String value) { - if (this.exclude == null) - return false; - for (StringType v : this.exclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #period} (A period of time during which the fulfilling resources would have been created.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.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} (A period of time during which the fulfilling resources would have been created.) - */ - public PendedRequest setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List 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("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("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)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("include", "string", "Names of resource types to include.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "string", "Names of resource types to exclude.", 0, java.lang.Integer.MAX_VALUE, exclude)); - childrenList.add(new Property("period", "Period", "A period of time during which the fulfilling resources would have been created.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - public PendedRequest copy() { - PendedRequest dst = new PendedRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.request = request == null ? null : request.copy(); - if (include != null) { - dst.include = new ArrayList(); - for (StringType i : include) - dst.include.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (StringType i : exclude) - dst.exclude.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected PendedRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) - && (period == null || period.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PendedRequest; - } - - @SearchParamDefinition(name="identifier", path="PendedRequest.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides the request and response details for the resource for which the stsatus is to be checked. + */ +@ResourceDef(name="PendedRequest", profile="http://hl7.org/fhir/Profile/PendedRequest") +public class PendedRequest extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Reference of resource to reverse. + */ + @Child(name="request", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource to reverse.) + */ + protected Resource requestTarget; + + /** + * Names of resource types to include. + */ + @Child(name="include", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Resource type(s) to include", formalDefinition="Names of resource types to include." ) + protected List include; + + /** + * Names of resource types to exclude. + */ + @Child(name="exclude", type={StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) + protected List exclude; + + /** + * A period of time during which the fulfilling resources would have been created. + */ + @Child(name="period", type={Period.class}, order=9, min=0, max=1) + @Description(shortDefinition="Period", formalDefinition="A period of time during which the fulfilling resources would have been created." ) + protected Period period; + + private static final long serialVersionUID = 1211492560L; + + public PendedRequest() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 PendedRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public PendedRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 PendedRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public PendedRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public PendedRequest setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 PendedRequest setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public PendedRequest setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 PendedRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public PendedRequest setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 PendedRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public PendedRequest setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Reference of resource to reverse.) + */ + public Resource getRequestTarget() { + 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. (Reference of resource to reverse.) + */ + public PendedRequest setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #include} (Names of resource types to include.) + */ + public List getInclude() { + if (this.include == null) + this.include = new ArrayList(); + return this.include; + } + + public boolean hasInclude() { + if (this.include == null) + return false; + for (StringType item : this.include) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #include} (Names of resource types to include.) + */ + // syntactic sugar + public StringType addIncludeElement() {//2 + StringType t = new StringType(); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return t; + } + + /** + * @param value {@link #include} (Names of resource types to include.) + */ + public PendedRequest addInclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return this; + } + + /** + * @param value {@link #include} (Names of resource types to include.) + */ + public boolean hasInclude(String value) { + if (this.include == null) + return false; + for (StringType v : this.include) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #exclude} (Names of resource types to exclude.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (StringType item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Names of resource types to exclude.) + */ + // syntactic sugar + public StringType addExcludeElement() {//2 + StringType t = new StringType(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + /** + * @param value {@link #exclude} (Names of resource types to exclude.) + */ + public PendedRequest addExclude(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return this; + } + + /** + * @param value {@link #exclude} (Names of resource types to exclude.) + */ + public boolean hasExclude(String value) { + if (this.exclude == null) + return false; + for (StringType v : this.exclude) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #period} (A period of time during which the fulfilling resources would have been created.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.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} (A period of time during which the fulfilling resources would have been created.) + */ + public PendedRequest setPeriod(Period value) { + this.period = value; + return this; + } + + protected void listChildren(List 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("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("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)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("include", "string", "Names of resource types to include.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "string", "Names of resource types to exclude.", 0, java.lang.Integer.MAX_VALUE, exclude)); + childrenList.add(new Property("period", "Period", "A period of time during which the fulfilling resources would have been created.", 0, java.lang.Integer.MAX_VALUE, period)); + } + + public PendedRequest copy() { + PendedRequest dst = new PendedRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.request = request == null ? null : request.copy(); + if (include != null) { + dst.include = new ArrayList(); + for (StringType i : include) + dst.include.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (StringType i : exclude) + dst.exclude.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + return dst; + } + + protected PendedRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) + && (period == null || period.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PendedRequest; + } + + @SearchParamDefinition(name="identifier", path="PendedRequest.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java index cd35d52cdb1..da355605a2c 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java @@ -20,190 +20,190 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A time period defined by a start and end date and optionally time. - */ -@DatatypeDef(name="Period") -public class Period extends Type implements ICompositeType { - - /** - * The start of the period. The boundary is inclusive. - */ - @Child(name="start", type={DateTimeType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Starting time with inclusive boundary", formalDefinition="The start of the period. The boundary is inclusive." ) - protected DateTimeType start; - - /** - * The end of the period. If the end of the period is missing, it means that the period is ongoing. - */ - @Child(name="end", type={DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="End time with inclusive boundary, if not ongoing", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing." ) - protected DateTimeType end; - - private static final long serialVersionUID = 649791751L; - - public Period() { - super(); - } - - /** - * @return {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public DateTimeType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Period.start"); - else if (Configuration.doAutoCreate()) - this.start = new DateTimeType(); - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Period setStartElement(DateTimeType value) { - this.start = value; - return this; - } - - /** - * @return The start of the period. The boundary is inclusive. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value The start of the period. The boundary is inclusive. - */ - public Period setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new DateTimeType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public DateTimeType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Period.end"); - else if (Configuration.doAutoCreate()) - this.end = new DateTimeType(); - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Period setEndElement(DateTimeType value) { - this.end = value; - return this; - } - - /** - * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value The end of the period. If the end of the period is missing, it means that the period is ongoing. - */ - public Period setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new DateTimeType(); - this.end.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "dateTime", "The start of the period. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "dateTime", "The end of the period. If the end of the period is missing, it means that the period is ongoing.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - public Period copy() { - Period dst = new Period(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - protected Period typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - ; - } - - -} - + +/* + 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.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A time period defined by a start and end date and optionally time. + */ +@DatatypeDef(name="Period") +public class Period extends Type implements ICompositeType { + + /** + * The start of the period. The boundary is inclusive. + */ + @Child(name="start", type={DateTimeType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Starting time with inclusive boundary", formalDefinition="The start of the period. The boundary is inclusive." ) + protected DateTimeType start; + + /** + * The end of the period. If the end of the period is missing, it means that the period is ongoing. + */ + @Child(name="end", type={DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="End time with inclusive boundary, if not ongoing", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing." ) + protected DateTimeType end; + + private static final long serialVersionUID = 649791751L; + + public Period() { + super(); + } + + /** + * @return {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public DateTimeType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Period.start"); + else if (Configuration.doAutoCreate()) + this.start = new DateTimeType(); + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Period setStartElement(DateTimeType value) { + this.start = value; + return this; + } + + /** + * @return The start of the period. The boundary is inclusive. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value The start of the period. The boundary is inclusive. + */ + public Period setStart(Date value) { + if (value == null) + this.start = null; + else { + if (this.start == null) + this.start = new DateTimeType(); + this.start.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public DateTimeType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Period.end"); + else if (Configuration.doAutoCreate()) + this.end = new DateTimeType(); + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Period setEndElement(DateTimeType value) { + this.end = value; + return this; + } + + /** + * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value The end of the period. If the end of the period is missing, it means that the period is ongoing. + */ + public Period setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new DateTimeType(); + this.end.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("start", "dateTime", "The start of the period. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "dateTime", "The end of the period. If the end of the period is missing, it means that the period is ongoing.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + public Period copy() { + Period dst = new Period(); + copyValues(dst); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + protected Period typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java index 17b7324c472..1c557f823f2 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java @@ -20,929 +20,929 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Demographics and administrative information about a person independent of a specific health-related context. - */ -@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person") -public class Person extends DomainResource { - - public enum AdministrativeGender implements FhirEnum { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - - public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); - - public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) throws IllegalArgumentException { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - public enum IdentityAssuranceLevel implements FhirEnum { - /** - * Little or no confidence in the asserted identity's accuracy. - */ - LEVEL1, - /** - * Some confidence in the asserted identity's accuracy. - */ - LEVEL2, - /** - * High confidence in the asserted identity's accuracy. - */ - LEVEL3, - /** - * Very high confidence in the asserted identity's accuracy. - */ - LEVEL4, - /** - * added to help the parsers - */ - NULL; - - public static final IdentityAssuranceLevelEnumFactory ENUM_FACTORY = new IdentityAssuranceLevelEnumFactory(); - - public static IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return LEVEL1; - if ("level2".equals(codeString)) - return LEVEL2; - if ("level3".equals(codeString)) - return LEVEL3; - if ("level4".equals(codeString)) - return LEVEL4; - throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case LEVEL1: return "level1"; - case LEVEL2: return "level2"; - case LEVEL3: return "level3"; - case LEVEL4: return "level4"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LEVEL1: return ""; - case LEVEL2: return ""; - case LEVEL3: return ""; - case LEVEL4: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LEVEL1: return "Little or no confidence in the asserted identity's accuracy."; - case LEVEL2: return "Some confidence in the asserted identity's accuracy."; - case LEVEL3: return "High confidence in the asserted identity's accuracy."; - case LEVEL4: return "Very high confidence in the asserted identity's accuracy."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LEVEL1: return "Level 1"; - case LEVEL2: return "Level 2"; - case LEVEL3: return "Level 3"; - case LEVEL4: return "Level 4"; - default: return "?"; - } - } - } - - public static class IdentityAssuranceLevelEnumFactory implements EnumFactory { - public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return IdentityAssuranceLevel.LEVEL1; - if ("level2".equals(codeString)) - return IdentityAssuranceLevel.LEVEL2; - if ("level3".equals(codeString)) - return IdentityAssuranceLevel.LEVEL3; - if ("level4".equals(codeString)) - return IdentityAssuranceLevel.LEVEL4; - throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - public String toCode(IdentityAssuranceLevel code) throws IllegalArgumentException { - if (code == IdentityAssuranceLevel.LEVEL1) - return "level1"; - if (code == IdentityAssuranceLevel.LEVEL2) - return "level2"; - if (code == IdentityAssuranceLevel.LEVEL3) - return "level3"; - if (code == IdentityAssuranceLevel.LEVEL4) - return "level4"; - return "?"; - } - } - - @Block() - public static class PersonLinkComponent extends BackboneElement { - /** - * The resource to which this actual person is associated. - */ - @Child(name="other", type={Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1) - @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) - protected Reference other; - - /** - * The actual object that is the target of the reference (The resource to which this actual person is associated.) - */ - protected Resource otherTarget; - - /** - * Level of assurance that this link is actually associated with the referenced record. - */ - @Child(name="assurance", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the referenced record." ) - protected Enumeration assurance; - - private static final long serialVersionUID = -1417349007L; - - public PersonLinkComponent() { - super(); - } - - public PersonLinkComponent(Reference other) { - super(); - this.other = other; - } - - /** - * @return {@link #other} (The resource to which this actual person is associated.) - */ - public Reference getOther() { - if (this.other == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PersonLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.other = new Reference(); - return this.other; - } - - public boolean hasOther() { - return this.other != null && !this.other.isEmpty(); - } - - /** - * @param value {@link #other} (The resource to which this actual person is associated.) - */ - public PersonLinkComponent setOther(Reference value) { - this.other = value; - return this; - } - - /** - * @return {@link #other} 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 resource to which this actual person is associated.) - */ - public Resource getOtherTarget() { - return this.otherTarget; - } - - /** - * @param value {@link #other} 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 resource to which this actual person is associated.) - */ - public PersonLinkComponent setOtherTarget(Resource value) { - this.otherTarget = value; - return this; - } - - /** - * @return {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value - */ - public Enumeration getAssuranceElement() { - if (this.assurance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PersonLinkComponent.assurance"); - else if (Configuration.doAutoCreate()) - this.assurance = new Enumeration(); - return this.assurance; - } - - public boolean hasAssuranceElement() { - return this.assurance != null && !this.assurance.isEmpty(); - } - - public boolean hasAssurance() { - return this.assurance != null && !this.assurance.isEmpty(); - } - - /** - * @param value {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value - */ - public PersonLinkComponent setAssuranceElement(Enumeration value) { - this.assurance = value; - return this; - } - - /** - * @return Level of assurance that this link is actually associated with the referenced record. - */ - public IdentityAssuranceLevel getAssurance() { - return this.assurance == null ? null : this.assurance.getValue(); - } - - /** - * @param value Level of assurance that this link is actually associated with the referenced record. - */ - public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { - if (value == null) - this.assurance = null; - else { - if (this.assurance == null) - this.assurance = new Enumeration(IdentityAssuranceLevel.ENUM_FACTORY); - this.assurance.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("other", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, other)); - childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the referenced record.", 0, java.lang.Integer.MAX_VALUE, assurance)); - } - - public PersonLinkComponent copy() { - PersonLinkComponent dst = new PersonLinkComponent(); - copyValues(dst); - dst.other = other == null ? null : other.copy(); - dst.assurance = assurance == null ? null : assurance.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (other == null || other.isEmpty()) && (assurance == null || assurance.isEmpty()) - ; - } - - } - - /** - * Identifier for a person within a particular scope. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) - protected List identifier; - - /** - * A name associated with the person. - */ - @Child(name="name", type={HumanName.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected List name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Administrative Gender. - */ - @Child(name="gender", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) - protected Enumeration gender; - - /** - * The birth date for the person. - */ - @Child(name="birthDate", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The birth date for the person", formalDefinition="The birth date for the person." ) - protected DateTimeType birthDate; - - /** - * One or more addresses for the person. - */ - @Child(name="address", type={Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." ) - protected List
address; - - /** - * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. - */ - @Child(name="photo", type={Attachment.class}, order=5, min=0, max=1) - @Description(shortDefinition="Image of the Person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." ) - protected Attachment photo; - - /** - * The Organization that is the custodian of the person record. - */ - @Child(name="managingOrganization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="The Organization that is the custodian of the person record", formalDefinition="The Organization that is the custodian of the person record." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The Organization that is the custodian of the person record.) - */ - protected Organization managingOrganizationTarget; - - /** - * Whether this person's record is in active use. - */ - @Child(name="active", type={BooleanType.class}, order=7, min=0, max=1) - @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." ) - protected BooleanType active; - - /** - * Link to a resource that converns the same actual person. - */ - @Child(name="link", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Link to a resource that converns the same actual person", formalDefinition="Link to a resource that converns the same actual person." ) - protected List link; - - private static final long serialVersionUID = -2072707611L; - - public Person() { - super(); - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier for a person within a particular scope.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(); - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Person setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender. - */ - public Person setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateTimeType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateTimeType(); - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Person setBirthDateElement(DateTimeType value) { - this.birthDate = value; - return this; - } - - /** - * @return The birth date for the person. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The birth date for the person. - */ - public Person setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateTimeType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #address} (One or more addresses for the person.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (One or more addresses for the person.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - /** - * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) - */ - public Attachment getPhoto() { - if (this.photo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.photo"); - else if (Configuration.doAutoCreate()) - this.photo = new Attachment(); - return this.photo; - } - - public boolean hasPhoto() { - return this.photo != null && !this.photo.isEmpty(); - } - - /** - * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) - */ - public Person setPhoto(Attachment value) { - this.photo = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The Organization that is the custodian of the person record.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The Organization that is the custodian of the person record.) - */ - public Person setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} 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 Organization that is the custodian of the person record.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} 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 that is the custodian of the person record.) - */ - public Person setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Person setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this person's record is in active use. - */ - public boolean getActive() { - return this.active == null ? false : this.active.getValue(); - } - - /** - * @param value Whether this person's record is in active use. - */ - public Person setActive(boolean value) { - if (value == false) - this.active = null; - else { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - } - return this; - } - - /** - * @return {@link #link} (Link to a resource that converns the same actual person.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (PersonLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Link to a resource that converns the same actual person.) - */ - // syntactic sugar - public PersonLinkComponent addLink() { //3 - PersonLinkComponent t = new PersonLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "dateTime", "The birth date for the person.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("link", "", "Link to a resource that converns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - public Person copy() { - Person dst = new Person(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.photo = photo == null ? null : photo.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.active = active == null ? null : active.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (PersonLinkComponent i : link) - dst.link.add(i.copy()); - }; - return dst; - } - - protected Person typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) - && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (active == null || active.isEmpty()) && (link == null || link.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Person; - } - - @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="string" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="identifier", path="Person.identifier", description="A patient Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * Demographics and administrative information about a person independent of a specific health-related context. + */ +@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person") +public class Person extends DomainResource { + + public enum AdministrativeGender implements FhirEnum { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) throws IllegalArgumentException { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum IdentityAssuranceLevel implements FhirEnum { + /** + * Little or no confidence in the asserted identity's accuracy. + */ + LEVEL1, + /** + * Some confidence in the asserted identity's accuracy. + */ + LEVEL2, + /** + * High confidence in the asserted identity's accuracy. + */ + LEVEL3, + /** + * Very high confidence in the asserted identity's accuracy. + */ + LEVEL4, + /** + * added to help the parsers + */ + NULL; + + public static final IdentityAssuranceLevelEnumFactory ENUM_FACTORY = new IdentityAssuranceLevelEnumFactory(); + + public static IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return LEVEL1; + if ("level2".equals(codeString)) + return LEVEL2; + if ("level3".equals(codeString)) + return LEVEL3; + if ("level4".equals(codeString)) + return LEVEL4; + throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case LEVEL1: return "level1"; + case LEVEL2: return "level2"; + case LEVEL3: return "level3"; + case LEVEL4: return "level4"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LEVEL1: return ""; + case LEVEL2: return ""; + case LEVEL3: return ""; + case LEVEL4: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LEVEL1: return "Little or no confidence in the asserted identity's accuracy."; + case LEVEL2: return "Some confidence in the asserted identity's accuracy."; + case LEVEL3: return "High confidence in the asserted identity's accuracy."; + case LEVEL4: return "Very high confidence in the asserted identity's accuracy."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LEVEL1: return "Level 1"; + case LEVEL2: return "Level 2"; + case LEVEL3: return "Level 3"; + case LEVEL4: return "Level 4"; + default: return "?"; + } + } + } + + public static class IdentityAssuranceLevelEnumFactory implements EnumFactory { + public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return IdentityAssuranceLevel.LEVEL1; + if ("level2".equals(codeString)) + return IdentityAssuranceLevel.LEVEL2; + if ("level3".equals(codeString)) + return IdentityAssuranceLevel.LEVEL3; + if ("level4".equals(codeString)) + return IdentityAssuranceLevel.LEVEL4; + throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + public String toCode(IdentityAssuranceLevel code) throws IllegalArgumentException { + if (code == IdentityAssuranceLevel.LEVEL1) + return "level1"; + if (code == IdentityAssuranceLevel.LEVEL2) + return "level2"; + if (code == IdentityAssuranceLevel.LEVEL3) + return "level3"; + if (code == IdentityAssuranceLevel.LEVEL4) + return "level4"; + return "?"; + } + } + + @Block() + public static class PersonLinkComponent extends BackboneElement { + /** + * The resource to which this actual person is associated. + */ + @Child(name="other", type={Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1) + @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) + protected Reference other; + + /** + * The actual object that is the target of the reference (The resource to which this actual person is associated.) + */ + protected Resource otherTarget; + + /** + * Level of assurance that this link is actually associated with the referenced record. + */ + @Child(name="assurance", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the referenced record." ) + protected Enumeration assurance; + + private static final long serialVersionUID = -1417349007L; + + public PersonLinkComponent() { + super(); + } + + public PersonLinkComponent(Reference other) { + super(); + this.other = other; + } + + /** + * @return {@link #other} (The resource to which this actual person is associated.) + */ + public Reference getOther() { + if (this.other == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.other = new Reference(); + return this.other; + } + + public boolean hasOther() { + return this.other != null && !this.other.isEmpty(); + } + + /** + * @param value {@link #other} (The resource to which this actual person is associated.) + */ + public PersonLinkComponent setOther(Reference value) { + this.other = value; + return this; + } + + /** + * @return {@link #other} 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 resource to which this actual person is associated.) + */ + public Resource getOtherTarget() { + return this.otherTarget; + } + + /** + * @param value {@link #other} 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 resource to which this actual person is associated.) + */ + public PersonLinkComponent setOtherTarget(Resource value) { + this.otherTarget = value; + return this; + } + + /** + * @return {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value + */ + public Enumeration getAssuranceElement() { + if (this.assurance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.assurance"); + else if (Configuration.doAutoCreate()) + this.assurance = new Enumeration(); + return this.assurance; + } + + public boolean hasAssuranceElement() { + return this.assurance != null && !this.assurance.isEmpty(); + } + + public boolean hasAssurance() { + return this.assurance != null && !this.assurance.isEmpty(); + } + + /** + * @param value {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value + */ + public PersonLinkComponent setAssuranceElement(Enumeration value) { + this.assurance = value; + return this; + } + + /** + * @return Level of assurance that this link is actually associated with the referenced record. + */ + public IdentityAssuranceLevel getAssurance() { + return this.assurance == null ? null : this.assurance.getValue(); + } + + /** + * @param value Level of assurance that this link is actually associated with the referenced record. + */ + public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { + if (value == null) + this.assurance = null; + else { + if (this.assurance == null) + this.assurance = new Enumeration(IdentityAssuranceLevel.ENUM_FACTORY); + this.assurance.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("other", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, other)); + childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the referenced record.", 0, java.lang.Integer.MAX_VALUE, assurance)); + } + + public PersonLinkComponent copy() { + PersonLinkComponent dst = new PersonLinkComponent(); + copyValues(dst); + dst.other = other == null ? null : other.copy(); + dst.assurance = assurance == null ? null : assurance.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (other == null || other.isEmpty()) && (assurance == null || assurance.isEmpty()) + ; + } + + } + + /** + * Identifier for a person within a particular scope. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) + protected List identifier; + + /** + * A name associated with the person. + */ + @Child(name="name", type={HumanName.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected List name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Administrative Gender. + */ + @Child(name="gender", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) + protected Enumeration gender; + + /** + * The birth date for the person. + */ + @Child(name="birthDate", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The birth date for the person", formalDefinition="The birth date for the person." ) + protected DateTimeType birthDate; + + /** + * One or more addresses for the person. + */ + @Child(name="address", type={Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." ) + protected List
address; + + /** + * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. + */ + @Child(name="photo", type={Attachment.class}, order=5, min=0, max=1) + @Description(shortDefinition="Image of the Person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." ) + protected Attachment photo; + + /** + * The Organization that is the custodian of the person record. + */ + @Child(name="managingOrganization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="The Organization that is the custodian of the person record", formalDefinition="The Organization that is the custodian of the person record." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The Organization that is the custodian of the person record.) + */ + protected Organization managingOrganizationTarget; + + /** + * Whether this person's record is in active use. + */ + @Child(name="active", type={BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." ) + protected BooleanType active; + + /** + * Link to a resource that converns the same actual person. + */ + @Child(name="link", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Link to a resource that converns the same actual person", formalDefinition="Link to a resource that converns the same actual person." ) + protected List link; + + private static final long serialVersionUID = -2072707611L; + + public Person() { + super(); + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier for a person within a particular scope.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public List getName() { + if (this.name == null) + this.name = new ArrayList(); + return this.name; + } + + public boolean hasName() { + if (this.name == null) + return false; + for (HumanName item : this.name) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Person setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender. + */ + public Person setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateTimeType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateTimeType(); + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Person setBirthDateElement(DateTimeType value) { + this.birthDate = value; + return this; + } + + /** + * @return The birth date for the person. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The birth date for the person. + */ + public Person setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateTimeType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #address} (One or more addresses for the person.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (One or more addresses for the person.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + /** + * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) + */ + public Attachment getPhoto() { + if (this.photo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.photo"); + else if (Configuration.doAutoCreate()) + this.photo = new Attachment(); + return this.photo; + } + + public boolean hasPhoto() { + return this.photo != null && !this.photo.isEmpty(); + } + + /** + * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) + */ + public Person setPhoto(Attachment value) { + this.photo = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The Organization that is the custodian of the person record.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The Organization that is the custodian of the person record.) + */ + public Person setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} 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 Organization that is the custodian of the person record.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} 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 that is the custodian of the person record.) + */ + public Person setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Person setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this person's record is in active use. + */ + public boolean getActive() { + return this.active == null ? false : this.active.getValue(); + } + + /** + * @param value Whether this person's record is in active use. + */ + public Person setActive(boolean value) { + if (value == false) + this.active = null; + else { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (Link to a resource that converns the same actual person.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (PersonLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Link to a resource that converns the same actual person.) + */ + // syntactic sugar + public PersonLinkComponent addLink() { //3 + PersonLinkComponent t = new PersonLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "dateTime", "The birth date for the person.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("link", "", "Link to a resource that converns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + public Person copy() { + Person dst = new Person(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (name != null) { + dst.name = new ArrayList(); + for (HumanName i : name) + dst.name.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.photo = photo == null ? null : photo.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.active = active == null ? null : active.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (PersonLinkComponent i : link) + dst.link.add(i.copy()); + }; + return dst; + } + + protected Person typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) + && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (active == null || active.isEmpty()) && (link == null || link.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Person; + } + + @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="string" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="identifier", path="Person.identifier", description="A patient Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java index 0edaa4a1cbc..53794751c79 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java @@ -20,3905 +20,3905 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="PharmacyClaim", profile="http://hl7.org/fhir/Profile/PharmacyClaim") -public class PharmacyClaim extends DomainResource { - - public enum UseLink implements FhirEnum { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case PROPOSED: return ""; - case EXPLORATORY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class UseLinkEnumFactory implements EnumFactory { - public UseLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return UseLink.COMPLETE; - if ("proposed".equals(codeString)) - return UseLink.PROPOSED; - if ("exploratory".equals(codeString)) - return UseLink.EXPLORATORY; - if ("other".equals(codeString)) - return UseLink.OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - public String toCode(UseLink code) throws IllegalArgumentException { - if (code == UseLink.COMPLETE) - return "complete"; - if (code == UseLink.PROPOSED) - return "proposed"; - if (code == UseLink.EXPLORATORY) - return "exploratory"; - if (code == UseLink.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class PayeeComponent extends BackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="person", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement { - /** - * Sequence of diagnosis. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) - protected IntegerType sequence; - - /** - * The diagnosis. - */ - @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -935927954L; - - public DiagnosisComponent() { - super(); - } - - public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement { - /** - * A service line item. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected IntegerType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agrement which describes the terms and conditions. - */ - @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preauthref; - - /** - * The Coverages adjudication details. - */ - @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - private static final long serialVersionUID = 450222500L; - - public CoverageComponent() { - super(); - } - - public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public boolean getFocal() { - return this.focal == null ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agrement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agrement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreauthref() { - if (this.preauthref == null) - this.preauthref = new ArrayList(); - return this.preauthref; - } - - public boolean hasPreauthref() { - if (this.preauthref == null) - return false; - for (StringType item : this.preauthref) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreauthrefElement() {//2 - StringType t = new StringType(); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return t; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreauthref(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return this; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreauthref(String value) { - if (this.preauthref == null) - return false; - for (StringType v : this.preauthref) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} 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 Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} 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 Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - 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)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preauthref != null) { - dst.preauthref = new ArrayList(); - for (StringType i : preauthref) - dst.preauthref.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; - - /** - * Second tier of goods and services. - */ - @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 detail; - - private static final long serialVersionUID = -1140048455L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 ItemsComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - 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(); - 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(); - 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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public DateType getServiceDateElement() { - if (this.serviceDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); - else if (Configuration.doAutoCreate()) - this.serviceDate = new DateType(); - return this.serviceDate; - } - - public boolean hasServiceDateElement() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - public boolean hasServiceDate() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - /** - * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public ItemsComponent setServiceDateElement(DateType value) { - this.serviceDate = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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(Date value) { - if (value == null) - this.serviceDate = null; - else { - if (this.serviceDate == null) - this.serviceDate = new DateType(); - this.serviceDate.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public ItemsComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubsite() { - if (this.subsite == null) - this.subsite = new ArrayList(); - return this.subsite; - } - - public boolean hasSubsite() { - if (this.subsite == null) - return false; - for (Coding item : this.subsite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubsite() { //3 - Coding t = new Coding(); - if (this.subsite == null) - this.subsite = new ArrayList(); - this.subsite.add(t); - return t; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - 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(); - 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(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subsite != null) { - dst.subsite = new ArrayList(); - for (Coding i : subsite) - dst.subsite.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) - && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class DetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * 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=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Total additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Third tier of goods and services. - */ - @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -342502025L; - - public DetailComponent() { - super(); - } - - public DetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public DetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="service", type={Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) - 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Net additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - private static final long serialVersionUID = 122809194L; - - public SubDetailComponent() { - super(); - } - - public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addtional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public SubDetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()); - } - - } - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) - */ - protected Organization targetTarget; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Organization organizationTarget; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - protected Practitioner entererTarget; - - /** - * Facility where the services were provided. - */ - @Child(name="facility", type={Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Reference facility; - - /** - * The actual object that is the target of the reference (Facility where the services were provided.) - */ - protected Location facilityTarget; - - /** - * Prescription to support the dispensing of pharmacy services, medications or products. - */ - @Child(name="prescription", type={MedicationPrescription.class}, order=11, min=0, max=1) - @Description(shortDefinition="Current Prescription", formalDefinition="Prescription to support the dispensing of pharmacy services, medications or products." ) - protected Reference prescription; - - /** - * The actual object that is the target of the reference (Prescription to support the dispensing of pharmacy services, medications or products.) - */ - protected MedicationPrescription prescriptionTarget; - - /** - * Original prescription to support the dispensing of pharmacy services, medications or products. - */ - @Child(name="originalPrescription", type={MedicationPrescription.class}, order=12, min=0, max=1) - @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription to support the dispensing of pharmacy services, medications or products." ) - protected Reference originalPrescription; - - /** - * The actual object that is the target of the reference (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - protected MedicationPrescription originalPrescriptionTarget; - - /** - * Theparty to be reimbused for the services. - */ - @Child(name="payee", type={}, order=13, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name="referral", type={ReferralRequest.class}, order=14, min=0, max=1) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - protected ReferralRequest referralTarget; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name="diagnosis", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * List of patient conditions for which care is sought. - */ - @Child(name="condition", type={Coding.class}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) - protected List condition; - - /** - * Patient Resource. - */ - @Child(name="patient", type={Patient.class}, order=17, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient patientTarget; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name="coverage", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name="exception", type={Coding.class}, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name="school", type={StringType.class}, order=20, min=0, max=1) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * Date of an accident which these services are addessing. - */ - @Child(name="accident", type={DateType.class}, order=21, min=0, max=1) - @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) - protected DateType accident; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name="accidentType", type={Coding.class}, order=22, min=0, max=1) - @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name="interventionException", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * First tier of goods and services. - */ - @Child(name="item", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name="additionalMaterials", type={Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) - @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 additionalMaterials; - - private static final long serialVersionUID = -12435566L; - - public PharmacyClaim() { - super(); - } - - public PharmacyClaim(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public PharmacyClaim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public PharmacyClaim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 PharmacyClaim setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 PharmacyClaim setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public PharmacyClaim setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public PharmacyClaim setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public PharmacyClaim setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public PharmacyClaim setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public PharmacyClaim setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 bill, claim pre-determination, pre-authorization.) - */ - public PharmacyClaim setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public PharmacyClaim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public UseLink getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public PharmacyClaim setUse(UseLink value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(UseLink.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public PharmacyClaim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public PharmacyClaim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public PharmacyClaim setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); - return this.entererTarget; - } - - /** - * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public PharmacyClaim setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacility() { - if (this.facility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public PharmacyClaim setFacility(Reference value) { - this.facility = value; - return this; - } - - /** - * @return {@link #facility} 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. (Facility where the services were provided.) - */ - public Location getFacilityTarget() { - if (this.facilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); - return this.facilityTarget; - } - - /** - * @param value {@link #facility} 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. (Facility where the services were provided.) - */ - public PharmacyClaim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Reference getPrescription() { - if (this.prescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.prescription"); - else if (Configuration.doAutoCreate()) - this.prescription = new Reference(); - return this.prescription; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (Prescription to support the dispensing of pharmacy services, medications or products.) - */ - public PharmacyClaim setPrescription(Reference value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #prescription} 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. (Prescription to support the dispensing of pharmacy services, medications or products.) - */ - public MedicationPrescription getPrescriptionTarget() { - if (this.prescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.prescription"); - else if (Configuration.doAutoCreate()) - this.prescriptionTarget = new MedicationPrescription(); - return this.prescriptionTarget; - } - - /** - * @param value {@link #prescription} 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. (Prescription to support the dispensing of pharmacy services, medications or products.) - */ - public PharmacyClaim setPrescriptionTarget(MedicationPrescription value) { - this.prescriptionTarget = value; - return this; - } - - /** - * @return {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Reference getOriginalPrescription() { - if (this.originalPrescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.originalPrescription"); - else if (Configuration.doAutoCreate()) - this.originalPrescription = new Reference(); - return this.originalPrescription; - } - - public boolean hasOriginalPrescription() { - return this.originalPrescription != null && !this.originalPrescription.isEmpty(); - } - - /** - * @param value {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) - */ - public PharmacyClaim setOriginalPrescription(Reference value) { - this.originalPrescription = value; - return this; - } - - /** - * @return {@link #originalPrescription} 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 prescription to support the dispensing of pharmacy services, medications or products.) - */ - public MedicationPrescription getOriginalPrescriptionTarget() { - if (this.originalPrescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.originalPrescription"); - else if (Configuration.doAutoCreate()) - this.originalPrescriptionTarget = new MedicationPrescription(); - return this.originalPrescriptionTarget; - } - - /** - * @param value {@link #originalPrescription} 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 prescription to support the dispensing of pharmacy services, medications or products.) - */ - public PharmacyClaim setOriginalPrescriptionTarget(MedicationPrescription value) { - this.originalPrescriptionTarget = value; - return this; - } - - /** - * @return {@link #payee} (Theparty to be reimbused for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (Theparty to be reimbused for the services.) - */ - public PharmacyClaim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public PharmacyClaim setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); - return this.referralTarget; - } - - /** - * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public PharmacyClaim setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Coding item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - // syntactic sugar - public Coding addCondition() { //3 - Coding t = new Coding(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.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} (Patient Resource.) - */ - public PharmacyClaim 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. (Patient Resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.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. (Patient Resource.) - */ - public PharmacyClaim setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public PharmacyClaim setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public PharmacyClaim setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public DateType getAccidentElement() { - if (this.accident == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.accident"); - else if (Configuration.doAutoCreate()) - this.accident = new DateType(); - return this.accident; - } - - public boolean hasAccidentElement() { - return this.accident != null && !this.accident.isEmpty(); - } - - public boolean hasAccident() { - return this.accident != null && !this.accident.isEmpty(); - } - - /** - * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public PharmacyClaim setAccidentElement(DateType value) { - this.accident = value; - return this; - } - - /** - * @return Date of an accident which these services are addessing. - */ - public Date getAccident() { - return this.accident == null ? null : this.accident.getValue(); - } - - /** - * @param value Date of an accident which these services are addessing. - */ - public PharmacyClaim setAccident(Date value) { - if (value == null) - this.accident = null; - else { - if (this.accident == null) - this.accident = new DateType(); - this.accident.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PharmacyClaim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public PharmacyClaim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterials() { - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - return this.additionalMaterials; - } - - public boolean hasAdditionalMaterials() { - if (this.additionalMaterials == null) - return false; - for (Coding item : this.additionalMaterials) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterials() { //3 - Coding t = new Coding(); - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "Prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("originalPrescription", "Reference(MedicationPrescription)", "Original prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); - childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); - } - - public PharmacyClaim copy() { - PharmacyClaim dst = new PharmacyClaim(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.prescription = prescription == null ? null : prescription.copy(); - dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Coding i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.accident = accident == null ? null : accident.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additionalMaterials != null) { - dst.additionalMaterials = new ArrayList(); - for (Coding i : additionalMaterials) - dst.additionalMaterials.add(i.copy()); - }; - return dst; - } - - protected PharmacyClaim typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) && (prescription == null || prescription.isEmpty()) - && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) - && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PharmacyClaim; - } - - @SearchParamDefinition(name="patient", path="PharmacyClaim.patient", description="Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="priority", path="PharmacyClaim.priority", description="Processing priority requested", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="use", path="PharmacyClaim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - @SearchParamDefinition(name="identifier", path="PharmacyClaim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="PharmacyClaim", profile="http://hl7.org/fhir/Profile/PharmacyClaim") +public class PharmacyClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} 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 Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} 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 Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + 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)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; + + /** + * Second tier of goods and services. + */ + @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 detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + 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(); + 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(); + 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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + 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(); + 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(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * 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=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Total additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Net additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name="prescription", type={MedicationPrescription.class}, order=11, min=0, max=1) + @Description(shortDefinition="Current Prescription", formalDefinition="Prescription to support the dispensing of pharmacy services, medications or products." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + protected MedicationPrescription prescriptionTarget; + + /** + * Original prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name="originalPrescription", type={MedicationPrescription.class}, order=12, min=0, max=1) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription to support the dispensing of pharmacy services, medications or products." ) + protected Reference originalPrescription; + + /** + * The actual object that is the target of the reference (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + protected MedicationPrescription originalPrescriptionTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=13, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=14, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=17, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=20, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=21, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=22, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) + @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 additionalMaterials; + + private static final long serialVersionUID = -12435566L; + + public PharmacyClaim() { + super(); + } + + public PharmacyClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public PharmacyClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public PharmacyClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 PharmacyClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 PharmacyClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public PharmacyClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public PharmacyClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public PharmacyClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public PharmacyClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public PharmacyClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public PharmacyClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public PharmacyClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public PharmacyClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public PharmacyClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} 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. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} 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. (Facility where the services were provided.) + */ + public PharmacyClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getPrescription() { + if (this.prescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.prescription"); + else if (Configuration.doAutoCreate()) + this.prescription = new Reference(); + return this.prescription; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setPrescription(Reference value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #prescription} 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. (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public MedicationPrescription getPrescriptionTarget() { + if (this.prescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.prescription"); + else if (Configuration.doAutoCreate()) + this.prescriptionTarget = new MedicationPrescription(); + return this.prescriptionTarget; + } + + /** + * @param value {@link #prescription} 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. (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setPrescriptionTarget(MedicationPrescription value) { + this.prescriptionTarget = value; + return this; + } + + /** + * @return {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getOriginalPrescription() { + if (this.originalPrescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.originalPrescription"); + else if (Configuration.doAutoCreate()) + this.originalPrescription = new Reference(); + return this.originalPrescription; + } + + public boolean hasOriginalPrescription() { + return this.originalPrescription != null && !this.originalPrescription.isEmpty(); + } + + /** + * @param value {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setOriginalPrescription(Reference value) { + this.originalPrescription = value; + return this; + } + + /** + * @return {@link #originalPrescription} 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 prescription to support the dispensing of pharmacy services, medications or products.) + */ + public MedicationPrescription getOriginalPrescriptionTarget() { + if (this.originalPrescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.originalPrescription"); + else if (Configuration.doAutoCreate()) + this.originalPrescriptionTarget = new MedicationPrescription(); + return this.originalPrescriptionTarget; + } + + /** + * @param value {@link #originalPrescription} 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 prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setOriginalPrescriptionTarget(MedicationPrescription value) { + this.originalPrescriptionTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public PharmacyClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public PharmacyClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public PharmacyClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.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} (Patient Resource.) + */ + public PharmacyClaim 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. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.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. (Patient Resource.) + */ + public PharmacyClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public PharmacyClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public PharmacyClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public PharmacyClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public PharmacyClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public PharmacyClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "Prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("originalPrescription", "Reference(MedicationPrescription)", "Original prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public PharmacyClaim copy() { + PharmacyClaim dst = new PharmacyClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.prescription = prescription == null ? null : prescription.copy(); + dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected PharmacyClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) && (prescription == null || prescription.isEmpty()) + && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PharmacyClaim; + } + + @SearchParamDefinition(name="patient", path="PharmacyClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="PharmacyClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="PharmacyClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="PharmacyClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java index 6c929d7624b..caf8aa27d26 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java @@ -20,1060 +20,1060 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ -@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") -public class Practitioner extends DomainResource { - - public enum AdministrativeGender implements FhirEnum { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - - public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); - - public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) throws IllegalArgumentException { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - @Block() - public static class PractitionerQualificationComponent extends BackboneElement { - /** - * An identifier that applies to this person's qualification in this role. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." ) - protected List identifier; - - /** - * Coded representation of the qualification. - */ - @Child(name="code", type={CodeableConcept.class}, order=2, min=1, max=1) - @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." ) - protected CodeableConcept code; - - /** - * Period during which the qualification is valid. - */ - @Child(name="period", type={Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." ) - protected Period period; - - /** - * Organization that regulates and issues the qualification. - */ - @Child(name="issuer", type={Organization.class}, order=4, min=0, max=1) - @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." ) - protected Reference issuer; - - /** - * The actual object that is the target of the reference (Organization that regulates and issues the qualification.) - */ - protected Organization issuerTarget; - - private static final long serialVersionUID = 1095219071L; - - public PractitionerQualificationComponent() { - super(); - } - - public PractitionerQualificationComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (An identifier that applies to this person's qualification in this role.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #code} (Coded representation of the qualification.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Coded representation of the qualification.) - */ - public PractitionerQualificationComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #period} (Period during which the qualification is valid.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.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} (Period during which the qualification is valid.) - */ - public PractitionerQualificationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #issuer} (Organization that regulates and issues the qualification.) - */ - public Reference getIssuer() { - if (this.issuer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); - else if (Configuration.doAutoCreate()) - this.issuer = new Reference(); - return this.issuer; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (Organization that regulates and issues the qualification.) - */ - public PractitionerQualificationComponent setIssuer(Reference value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #issuer} 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. (Organization that regulates and issues the qualification.) - */ - public Organization getIssuerTarget() { - if (this.issuerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); - else if (Configuration.doAutoCreate()) - this.issuerTarget = new Organization(); - return this.issuerTarget; - } - - /** - * @param value {@link #issuer} 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. (Organization that regulates and issues the qualification.) - */ - public PractitionerQualificationComponent setIssuerTarget(Organization value) { - this.issuerTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer)); - } - - public PractitionerQualificationComponent copy() { - PractitionerQualificationComponent dst = new PractitionerQualificationComponent(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.period = period == null ? null : period.copy(); - dst.issuer = issuer == null ? null : issuer.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty()); - } - - } - - /** - * An identifier that applies to this person in this role. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." ) - protected List identifier; - - /** - * A name associated with the person. - */ - @Child(name="name", type={HumanName.class}, order=0, min=0, max=1) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected HumanName name; - - /** - * A contact detail for the practitioner, e.g. a telephone number or an email address. - */ - @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the practitioner", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * The postal address where the practitioner can be found or visited or to which mail can be delivered. - */ - @Child(name="address", type={Address.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." ) - protected List
address; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name="gender", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date and time of birth for the practitioner. - */ - @Child(name="birthDate", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The date and time of birth for the practitioner", formalDefinition="The date and time of birth for the practitioner." ) - protected DateTimeType birthDate; - - /** - * Image of the person. - */ - @Child(name="photo", type={Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - /** - * The organization that the practitioner represents. - */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="The represented organization", formalDefinition="The organization that the practitioner represents." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization that the practitioner represents.) - */ - protected Organization organizationTarget; - - /** - * Roles which this practitioner is authorized to perform for the organization. - */ - @Child(name="role", type={CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) - protected List role; - - /** - * Specific specialty of the practitioner. - */ - @Child(name="specialty", type={CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) - protected List specialty; - - /** - * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. - */ - @Child(name="period", type={Period.class}, order=9, min=0, max=1) - @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." ) - protected Period period; - - /** - * The location(s) at which this practitioner provides care. - */ - @Child(name="location", type={Location.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) - protected List location; - /** - * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) - */ - protected List locationTarget; - - - /** - * Qualifications obtained by training and certification. - */ - @Child(name="qualification", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." ) - protected List qualification; - - /** - * A language the practitioner is able to use in patient communication. - */ - @Child(name="communication", type={CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A language the practitioner is able to use in patient communication", formalDefinition="A language the practitioner is able to use in patient communication." ) - protected List communication; - - private static final long serialVersionUID = 1792768502L; - - public Practitioner() { - super(); - } - - /** - * @return {@link #identifier} (An identifier that applies to this person in this role.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (An identifier that applies to this person in this role.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the person.) - */ - public Practitioner setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(); - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Practitioner setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public Practitioner setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date and time of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateTimeType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateTimeType(); - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date and time of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Practitioner setBirthDateElement(DateTimeType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date and time of birth for the practitioner. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date and time of birth for the practitioner. - */ - public Practitioner setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateTimeType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - /** - * @return {@link #organization} (The organization that the practitioner represents.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization that the practitioner represents.) - */ - public Practitioner setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization that the practitioner represents.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 that the practitioner represents.) - */ - public Practitioner setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - /** - * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.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} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public Practitioner setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (Reference item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - // syntactic sugar - public Reference addLocation() { //3 - Reference t = new Reference(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @return {@link #location} (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 location(s) at which this practitioner provides care.) - */ - public List getLocationTarget() { - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - return this.locationTarget; - } - - // syntactic sugar - /** - * @return {@link #location} (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 location(s) at which this practitioner provides care.) - */ - public Location addLocationTarget() { - Location r = new Location(); - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - this.locationTarget.add(r); - return r; - } - - /** - * @return {@link #qualification} (Qualifications obtained by training and certification.) - */ - public List getQualification() { - if (this.qualification == null) - this.qualification = new ArrayList(); - return this.qualification; - } - - public boolean hasQualification() { - if (this.qualification == null) - return false; - for (PractitionerQualificationComponent item : this.qualification) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #qualification} (Qualifications obtained by training and certification.) - */ - // syntactic sugar - public PractitionerQualificationComponent addQualification() { //3 - PractitionerQualificationComponent t = new PractitionerQualificationComponent(); - if (this.qualification == null) - this.qualification = new ArrayList(); - this.qualification.add(t); - return t; - } - - /** - * @return {@link #communication} (A language the practitioner is able to use in patient communication.) - */ - public List getCommunication() { - if (this.communication == null) - this.communication = new ArrayList(); - return this.communication; - } - - public boolean hasCommunication() { - if (this.communication == null) - return false; - for (CodeableConcept item : this.communication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #communication} (A language the practitioner is able to use in patient communication.) - */ - // syntactic sugar - public CodeableConcept addCommunication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "The postal address where the practitioner can be found or visited or to which mail can be delivered.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "dateTime", "The date and time of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization that the practitioner represents.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification)); - childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication)); - } - - public Practitioner copy() { - Practitioner dst = new Practitioner(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - dst.organization = organization == null ? null : organization.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (Reference i : location) - dst.location.add(i.copy()); - }; - if (qualification != null) { - dst.qualification = new ArrayList(); - for (PractitionerQualificationComponent i : qualification) - dst.qualification.add(i.copy()); - }; - if (communication != null) { - dst.communication = new ArrayList(); - for (CodeableConcept i : communication) - dst.communication.add(i.copy()); - }; - return dst; - } - - protected Practitioner typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) - && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty()) && (organization == null || organization.isEmpty()) - && (role == null || role.isEmpty()) && (specialty == null || specialty.isEmpty()) && (period == null || period.isEmpty()) - && (location == null || location.isEmpty()) && (qualification == null || qualification.isEmpty()) - && (communication == null || communication.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Practitioner; - } - - @SearchParamDefinition(name="organization", path="Practitioner.organization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="given", path="Practitioner.name", description="A portion of the given name", type="string" ) - public static final String SP_GIVEN = "given"; - @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" ) - public static final String SP_COMMUNICATION = "communication"; - @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="family", path="Practitioner.name", description="A portion of the family name", type="string" ) - public static final String SP_FAMILY = "family"; - @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="Practitioner.telecom", description="The value in any kind of contact", type="string" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="identifier", path="Practitioner.identifier", description="A practitioner's Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ +@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") +public class Practitioner extends DomainResource { + + public enum AdministrativeGender implements FhirEnum { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) throws IllegalArgumentException { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + @Block() + public static class PractitionerQualificationComponent extends BackboneElement { + /** + * An identifier that applies to this person's qualification in this role. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." ) + protected List identifier; + + /** + * Coded representation of the qualification. + */ + @Child(name="code", type={CodeableConcept.class}, order=2, min=1, max=1) + @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." ) + protected CodeableConcept code; + + /** + * Period during which the qualification is valid. + */ + @Child(name="period", type={Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." ) + protected Period period; + + /** + * Organization that regulates and issues the qualification. + */ + @Child(name="issuer", type={Organization.class}, order=4, min=0, max=1) + @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." ) + protected Reference issuer; + + /** + * The actual object that is the target of the reference (Organization that regulates and issues the qualification.) + */ + protected Organization issuerTarget; + + private static final long serialVersionUID = 1095219071L; + + public PractitionerQualificationComponent() { + super(); + } + + public PractitionerQualificationComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (An identifier that applies to this person's qualification in this role.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #code} (Coded representation of the qualification.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Coded representation of the qualification.) + */ + public PractitionerQualificationComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #period} (Period during which the qualification is valid.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.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} (Period during which the qualification is valid.) + */ + public PractitionerQualificationComponent setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #issuer} (Organization that regulates and issues the qualification.) + */ + public Reference getIssuer() { + if (this.issuer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); + else if (Configuration.doAutoCreate()) + this.issuer = new Reference(); + return this.issuer; + } + + public boolean hasIssuer() { + return this.issuer != null && !this.issuer.isEmpty(); + } + + /** + * @param value {@link #issuer} (Organization that regulates and issues the qualification.) + */ + public PractitionerQualificationComponent setIssuer(Reference value) { + this.issuer = value; + return this; + } + + /** + * @return {@link #issuer} 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. (Organization that regulates and issues the qualification.) + */ + public Organization getIssuerTarget() { + if (this.issuerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); + else if (Configuration.doAutoCreate()) + this.issuerTarget = new Organization(); + return this.issuerTarget; + } + + /** + * @param value {@link #issuer} 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. (Organization that regulates and issues the qualification.) + */ + public PractitionerQualificationComponent setIssuerTarget(Organization value) { + this.issuerTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer)); + } + + public PractitionerQualificationComponent copy() { + PractitionerQualificationComponent dst = new PractitionerQualificationComponent(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.code = code == null ? null : code.copy(); + dst.period = period == null ? null : period.copy(); + dst.issuer = issuer == null ? null : issuer.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) + && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty()); + } + + } + + /** + * An identifier that applies to this person in this role. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." ) + protected List identifier; + + /** + * A name associated with the person. + */ + @Child(name="name", type={HumanName.class}, order=0, min=0, max=1) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected HumanName name; + + /** + * A contact detail for the practitioner, e.g. a telephone number or an email address. + */ + @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the practitioner", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * The postal address where the practitioner can be found or visited or to which mail can be delivered. + */ + @Child(name="address", type={Address.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." ) + protected List
address; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name="gender", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * The date and time of birth for the practitioner. + */ + @Child(name="birthDate", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The date and time of birth for the practitioner", formalDefinition="The date and time of birth for the practitioner." ) + protected DateTimeType birthDate; + + /** + * Image of the person. + */ + @Child(name="photo", type={Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + /** + * The organization that the practitioner represents. + */ + @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="The represented organization", formalDefinition="The organization that the practitioner represents." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization that the practitioner represents.) + */ + protected Organization organizationTarget; + + /** + * Roles which this practitioner is authorized to perform for the organization. + */ + @Child(name="role", type={CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) + protected List role; + + /** + * Specific specialty of the practitioner. + */ + @Child(name="specialty", type={CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) + protected List specialty; + + /** + * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. + */ + @Child(name="period", type={Period.class}, order=9, min=0, max=1) + @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." ) + protected Period period; + + /** + * The location(s) at which this practitioner provides care. + */ + @Child(name="location", type={Location.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) + protected List location; + /** + * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) + */ + protected List locationTarget; + + + /** + * Qualifications obtained by training and certification. + */ + @Child(name="qualification", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." ) + protected List qualification; + + /** + * A language the practitioner is able to use in patient communication. + */ + @Child(name="communication", type={CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A language the practitioner is able to use in patient communication", formalDefinition="A language the practitioner is able to use in patient communication." ) + protected List communication; + + private static final long serialVersionUID = 1792768502L; + + public Practitioner() { + super(); + } + + /** + * @return {@link #identifier} (An identifier that applies to this person in this role.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (An identifier that applies to this person in this role.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the person.) + */ + public Practitioner setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) + */ + public List
getAddress() { + if (this.address == null) + this.address = new ArrayList
(); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
(); + this.address.add(t); + return t; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Practitioner setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public Practitioner setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The date and time of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateTimeType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateTimeType(); + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The date and time of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Practitioner setBirthDateElement(DateTimeType value) { + this.birthDate = value; + return this; + } + + /** + * @return The date and time of birth for the practitioner. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The date and time of birth for the practitioner. + */ + public Practitioner setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateTimeType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + /** + * @return {@link #organization} (The organization that the practitioner represents.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization that the practitioner represents.) + */ + public Practitioner setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization that the practitioner represents.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 that the practitioner represents.) + */ + public Practitioner setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + public List getSpecialty() { + if (this.specialty == null) + this.specialty = new ArrayList(); + return this.specialty; + } + + public boolean hasSpecialty() { + if (this.specialty == null) + return false; + for (CodeableConcept item : this.specialty) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #specialty} (Specific specialty of the practitioner.) + */ + // syntactic sugar + public CodeableConcept addSpecialty() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.specialty == null) + this.specialty = new ArrayList(); + this.specialty.add(t); + return t; + } + + /** + * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Practitioner.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} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) + */ + public Practitioner setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + public List getLocation() { + if (this.location == null) + this.location = new ArrayList(); + return this.location; + } + + public boolean hasLocation() { + if (this.location == null) + return false; + for (Reference item : this.location) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #location} (The location(s) at which this practitioner provides care.) + */ + // syntactic sugar + public Reference addLocation() { //3 + Reference t = new Reference(); + if (this.location == null) + this.location = new ArrayList(); + this.location.add(t); + return t; + } + + /** + * @return {@link #location} (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 location(s) at which this practitioner provides care.) + */ + public List getLocationTarget() { + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + return this.locationTarget; + } + + // syntactic sugar + /** + * @return {@link #location} (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 location(s) at which this practitioner provides care.) + */ + public Location addLocationTarget() { + Location r = new Location(); + if (this.locationTarget == null) + this.locationTarget = new ArrayList(); + this.locationTarget.add(r); + return r; + } + + /** + * @return {@link #qualification} (Qualifications obtained by training and certification.) + */ + public List getQualification() { + if (this.qualification == null) + this.qualification = new ArrayList(); + return this.qualification; + } + + public boolean hasQualification() { + if (this.qualification == null) + return false; + for (PractitionerQualificationComponent item : this.qualification) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #qualification} (Qualifications obtained by training and certification.) + */ + // syntactic sugar + public PractitionerQualificationComponent addQualification() { //3 + PractitionerQualificationComponent t = new PractitionerQualificationComponent(); + if (this.qualification == null) + this.qualification = new ArrayList(); + this.qualification.add(t); + return t; + } + + /** + * @return {@link #communication} (A language the practitioner is able to use in patient communication.) + */ + public List getCommunication() { + if (this.communication == null) + this.communication = new ArrayList(); + return this.communication; + } + + public boolean hasCommunication() { + if (this.communication == null) + return false; + for (CodeableConcept item : this.communication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #communication} (A language the practitioner is able to use in patient communication.) + */ + // syntactic sugar + public CodeableConcept addCommunication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.communication == null) + this.communication = new ArrayList(); + this.communication.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("address", "Address", "The postal address where the practitioner can be found or visited or to which mail can be delivered.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "dateTime", "The date and time of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization that the practitioner represents.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification)); + childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication)); + } + + public Practitioner copy() { + Practitioner dst = new Practitioner(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + if (address != null) { + dst.address = new ArrayList
(); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + dst.organization = organization == null ? null : organization.copy(); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + if (specialty != null) { + dst.specialty = new ArrayList(); + for (CodeableConcept i : specialty) + dst.specialty.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + if (location != null) { + dst.location = new ArrayList(); + for (Reference i : location) + dst.location.add(i.copy()); + }; + if (qualification != null) { + dst.qualification = new ArrayList(); + for (PractitionerQualificationComponent i : qualification) + dst.qualification.add(i.copy()); + }; + if (communication != null) { + dst.communication = new ArrayList(); + for (CodeableConcept i : communication) + dst.communication.add(i.copy()); + }; + return dst; + } + + protected Practitioner typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) + && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty()) && (organization == null || organization.isEmpty()) + && (role == null || role.isEmpty()) && (specialty == null || specialty.isEmpty()) && (period == null || period.isEmpty()) + && (location == null || location.isEmpty()) && (qualification == null || qualification.isEmpty()) + && (communication == null || communication.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Practitioner; + } + + @SearchParamDefinition(name="organization", path="Practitioner.organization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="given", path="Practitioner.name", description="A portion of the given name", type="string" ) + public static final String SP_GIVEN = "given"; + @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" ) + public static final String SP_COMMUNICATION = "communication"; + @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="family", path="Practitioner.name", description="A portion of the family name", type="string" ) + public static final String SP_FAMILY = "family"; + @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="telecom", path="Practitioner.telecom", description="The value in any kind of contact", type="string" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="identifier", path="Practitioner.identifier", description="A practitioner's Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java index b39e080a773..bd57c53f4fe 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java @@ -20,117 +20,117 @@ package org.hl7.fhir.instance.model; * #L% */ - -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; - -public abstract class PrimitiveType extends Type implements IPrimitiveType { - - private static final long serialVersionUID = 2L; - - private T myCoercedValue; - private String myStringValue; - - @Override - public boolean equals(Object theObj) { - if (theObj == null) { - return false; - } - if (!(theObj.getClass() == getClass())) { - return false; - } - - PrimitiveType o = (PrimitiveType) theObj; - - EqualsBuilder b = new EqualsBuilder(); - b.append(getValue(), o.getValue()); - return b.isEquals(); - } - - public T getValue() { - return myCoercedValue; - } - - public String asStringValue() { - return myStringValue; - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getValue()).toHashCode(); - } - - @Override - public boolean isEmpty() { - return super.isEmpty() && getValue() == null; - } - - public PrimitiveType setValue(T theValue) { - myCoercedValue = theValue; - updateStringValue(); - return this; - } - - protected void updateStringValue() { - if (myCoercedValue == null) { - myStringValue = null; - } else { - // NB this might be null - myStringValue = encode(myCoercedValue); - } - } - - public void fromStringValue(String theValue) { - if (theValue == null) { - myCoercedValue = null; - } else { - // NB this might be null - myCoercedValue = parse(theValue); - } - myStringValue = theValue; - } - - /** - * Subclasses must override to convert an encoded representation of this datatype into a "coerced" one - * - * @param theValue - * Will not be null - * @return May return null if the value does not correspond to anything - */ - protected abstract T parse(String theValue); - - /** - * Subclasses must override to convert a "coerced" value into an encoded one. - * - * @param theValue - * Will not be null - * @return May return null if the value does not correspond to anything - */ - protected abstract String encode(T theValue); - - @Override - public String toString() { - return getClass().getSimpleName() + "[" + asStringValue() + "]"; - } - - public boolean hasValue() { - return !isEmpty(); - } - - public String getValueAsString() { - return asStringValue(); - } - - public void setValueAsString(String theValue) { - fromStringValue(theValue); - } - - - protected Type typedCopy() { - return copy(); - } - - public abstract Type copy(); - - -} + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +public abstract class PrimitiveType extends Type implements IPrimitiveType { + + private static final long serialVersionUID = 2L; + + private T myCoercedValue; + private String myStringValue; + + @Override + public boolean equals(Object theObj) { + if (theObj == null) { + return false; + } + if (!(theObj.getClass() == getClass())) { + return false; + } + + PrimitiveType o = (PrimitiveType) theObj; + + EqualsBuilder b = new EqualsBuilder(); + b.append(getValue(), o.getValue()); + return b.isEquals(); + } + + public T getValue() { + return myCoercedValue; + } + + public String asStringValue() { + return myStringValue; + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getValue()).toHashCode(); + } + + @Override + public boolean isEmpty() { + return super.isEmpty() && getValue() == null; + } + + public PrimitiveType setValue(T theValue) { + myCoercedValue = theValue; + updateStringValue(); + return this; + } + + protected void updateStringValue() { + if (myCoercedValue == null) { + myStringValue = null; + } else { + // NB this might be null + myStringValue = encode(myCoercedValue); + } + } + + public void fromStringValue(String theValue) { + if (theValue == null) { + myCoercedValue = null; + } else { + // NB this might be null + myCoercedValue = parse(theValue); + } + myStringValue = theValue; + } + + /** + * Subclasses must override to convert an encoded representation of this datatype into a "coerced" one + * + * @param theValue + * Will not be null + * @return May return null if the value does not correspond to anything + */ + protected abstract T parse(String theValue); + + /** + * Subclasses must override to convert a "coerced" value into an encoded one. + * + * @param theValue + * Will not be null + * @return May return null if the value does not correspond to anything + */ + protected abstract String encode(T theValue); + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + asStringValue() + "]"; + } + + public boolean hasValue() { + return !isEmpty(); + } + + public String getValueAsString() { + return asStringValue(); + } + + public void setValueAsString(String theValue) { + fromStringValue(theValue); + } + + + protected Type typedCopy() { + return copy(); + } + + public abstract Type copy(); + + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java index f9d5b203848..df526c7b6c5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java @@ -20,1109 +20,1109 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. - */ -@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") -public class Procedure extends DomainResource { - - public enum ProcedureRelationshipType implements FhirEnum { - /** - * This procedure had to be performed because of the related one. - */ - CAUSEDBY, - /** - * This procedure caused the related one to be performed. - */ - BECAUSEOF, - /** - * added to help the parsers - */ - NULL; - - public static final ProcedureRelationshipTypeEnumFactory ENUM_FACTORY = new ProcedureRelationshipTypeEnumFactory(); - - public static ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("caused-by".equals(codeString)) - return CAUSEDBY; - if ("because-of".equals(codeString)) - return BECAUSEOF; - throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case CAUSEDBY: return "caused-by"; - case BECAUSEOF: return "because-of"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CAUSEDBY: return ""; - case BECAUSEOF: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CAUSEDBY: return "This procedure had to be performed because of the related one."; - case BECAUSEOF: return "This procedure caused the related one to be performed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CAUSEDBY: return "caused-by"; - case BECAUSEOF: return "because-of"; - default: return "?"; - } - } - } - - public static class ProcedureRelationshipTypeEnumFactory implements EnumFactory { - public ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("caused-by".equals(codeString)) - return ProcedureRelationshipType.CAUSEDBY; - if ("because-of".equals(codeString)) - return ProcedureRelationshipType.BECAUSEOF; - throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); - } - public String toCode(ProcedureRelationshipType code) throws IllegalArgumentException { - if (code == ProcedureRelationshipType.CAUSEDBY) - return "caused-by"; - if (code == ProcedureRelationshipType.BECAUSEOF) - return "because-of"; - return "?"; - } - } - - @Block() - public static class ProcedurePerformerComponent extends BackboneElement { - /** - * The practitioner who was involved in the procedure. - */ - @Child(name="person", type={Practitioner.class}, order=1, min=0, max=1) - @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The practitioner who was involved in the procedure.) - */ - protected Practitioner personTarget; - - /** - * E.g. surgeon, anaethetist, endoscopist. - */ - @Child(name="role", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="The role the person was in", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) - protected CodeableConcept role; - - private static final long serialVersionUID = -749890249L; - - public ProcedurePerformerComponent() { - super(); - } - - /** - * @return {@link #person} (The practitioner who was involved in the procedure.) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The practitioner who was involved in the procedure.) - */ - public ProcedurePerformerComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} 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 practitioner who was involved in the procedure.) - */ - public Practitioner getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Practitioner(); - return this.personTarget; - } - - /** - * @param value {@link #person} 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 was involved in the procedure.) - */ - public ProcedurePerformerComponent setPersonTarget(Practitioner value) { - this.personTarget = value; - return this; - } - - /** - * @return {@link #role} (E.g. surgeon, anaethetist, endoscopist.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.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} (E.g. surgeon, anaethetist, endoscopist.) - */ - public ProcedurePerformerComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("person", "Reference(Practitioner)", "The practitioner who was involved in the procedure.", 0, java.lang.Integer.MAX_VALUE, person)); - childrenList.add(new Property("role", "CodeableConcept", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - public ProcedurePerformerComponent copy() { - ProcedurePerformerComponent dst = new ProcedurePerformerComponent(); - copyValues(dst); - dst.person = person == null ? null : person.copy(); - dst.role = role == null ? null : role.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (person == null || person.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - } - - @Block() - public static class ProcedureRelatedItemComponent extends BackboneElement { - /** - * The nature of the relationship. - */ - @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="caused-by | because-of", formalDefinition="The nature of the relationship." ) - protected Enumeration type; - - /** - * The related item - e.g. a procedure. - */ - @Child(name="target", type={AllergyIntolerance.class, CarePlan.class, Condition.class, DiagnosticReport.class, FamilyHistory.class, ImagingStudy.class, Immunization.class, ImmunizationRecommendation.class, MedicationAdministration.class, MedicationDispense.class, MedicationPrescription.class, MedicationStatement.class, Observation.class, Procedure.class}, order=2, min=0, max=1) - @Description(shortDefinition="The related item - e.g. a procedure", formalDefinition="The related item - e.g. a procedure." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The related item - e.g. a procedure.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = 41929784L; - - public ProcedureRelatedItemComponent() { - super(); - } - - /** - * @return {@link #type} (The nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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 nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ProcedureRelatedItemComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The nature of the relationship. - */ - public ProcedureRelationshipType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The nature of the relationship. - */ - public ProcedureRelatedItemComponent setType(ProcedureRelationshipType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(ProcedureRelationshipType.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The related item - e.g. a procedure.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The related item - e.g. a procedure.) - */ - public ProcedureRelatedItemComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 related item - e.g. a procedure.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @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 related item - e.g. a procedure.) - */ - public ProcedureRelatedItemComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The nature of the relationship.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "Reference(AllergyIntolerance|CarePlan|Condition|DiagnosticReport|FamilyHistory|ImagingStudy|Immunization|ImmunizationRecommendation|MedicationAdministration|MedicationDispense|MedicationPrescription|MedicationStatement|Observation|Procedure)", "The related item - e.g. a procedure.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public ProcedureRelatedItemComponent copy() { - ProcedureRelatedItemComponent dst = new ProcedureRelatedItemComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this procedure 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 procedure", formalDefinition="This records identifiers associated with this procedure 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; - - /** - * The person on whom the procedure was performed. - */ - @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Who procedure was performed on", formalDefinition="The person on whom the procedure was performed." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person on whom the procedure was performed.) - */ - protected Patient patientTarget; - - /** - * The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded." ) - protected CodeableConcept type; - - /** - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. - */ - @Child(name="bodySite", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Precise location details", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) - protected List bodySite; - - /** - * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text. - */ - @Child(name="indication", type={CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Reason procedure performed", formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text." ) - protected List indication; - - /** - * Limited to 'real' people rather than equipment. - */ - @Child(name="performer", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." ) - protected List performer; - - /** - * The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. - */ - @Child(name="date", type={Period.class}, order=5, min=0, max=1) - @Description(shortDefinition="The date the procedure was performed", formalDefinition="The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." ) - protected Period date; - - /** - * The encounter during which the procedure was performed. - */ - @Child(name="encounter", type={Encounter.class}, order=6, min=0, max=1) - @Description(shortDefinition="The encounter when procedure performed", formalDefinition="The encounter during which the procedure was performed." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter during which the procedure was performed.) - */ - protected Encounter encounterTarget; - - /** - * What was the outcome of the procedure - did it resolve reasons why the procedure was performed?. - */ - @Child(name="outcome", type={StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="What was result of procedure?", formalDefinition="What was the outcome of the procedure - did it resolve reasons why the procedure was performed?." ) - protected StringType outcome; - - /** - * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies. - */ - @Child(name="report", type={DiagnosticReport.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Any report that results from the procedure", formalDefinition="This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies." ) - protected List report; - /** - * The actual objects that are the target of the reference (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - protected List reportTarget; - - - /** - * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues. - */ - @Child(name="complication", type={CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues." ) - protected List complication; - - /** - * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. - */ - @Child(name="followUp", type={StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Instructions for follow up", formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used." ) - protected StringType followUp; - - /** - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure. - */ - @Child(name="relatedItem", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A procedure that is related to this one", formalDefinition="Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure." ) - protected List relatedItem; - - /** - * Any other notes about the procedure - e.g. the operative notes. - */ - @Child(name="notes", type={StringType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Additional information about procedure", formalDefinition="Any other notes about the procedure - e.g. the operative notes." ) - protected StringType notes; - - private static final long serialVersionUID = 1783571207L; - - public Procedure() { - super(); - } - - public Procedure(Reference patient, CodeableConcept type) { - super(); - this.patient = patient; - this.type = type; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this procedure 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 procedure 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #patient} (The person on whom the procedure was performed.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.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} (The person on whom the procedure was performed.) - */ - public Procedure 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. (The person on whom the procedure was performed.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.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. (The person on whom the procedure was performed.) - */ - public Procedure setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) - */ - public Procedure setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - /** - * @return {@link #indication} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - 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 why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - /** - * @return {@link #performer} (Limited to 'real' people rather than equipment.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (ProcedurePerformerComponent item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Limited to 'real' people rather than equipment.) - */ - // syntactic sugar - public ProcedurePerformerComponent addPerformer() { //3 - ProcedurePerformerComponent t = new ProcedurePerformerComponent(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - /** - * @return {@link #date} (The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Period getDate() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.date"); - else if (Configuration.doAutoCreate()) - this.date = new Period(); - return this.date; - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Procedure setDate(Period value) { - this.date = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter during which the procedure was performed.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.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 during which the procedure was performed.) - */ - public Procedure 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 during which the procedure was performed.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.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 during which the procedure was performed.) - */ - public Procedure setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public StringType getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new StringType(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Procedure setOutcomeElement(StringType value) { - this.outcome = value; - return this; - } - - /** - * @return What was the outcome of the procedure - did it resolve reasons why the procedure was performed?. - */ - public String getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value What was the outcome of the procedure - did it resolve reasons why the procedure was performed?. - */ - public Procedure setOutcome(String value) { - if (Utilities.noString(value)) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new StringType(); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - public List getReport() { - if (this.report == null) - this.report = new ArrayList(); - return this.report; - } - - public boolean hasReport() { - if (this.report == null) - return false; - for (Reference item : this.report) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - // syntactic sugar - public Reference addReport() { //3 - Reference t = new Reference(); - if (this.report == null) - this.report = new ArrayList(); - this.report.add(t); - return t; - } - - /** - * @return {@link #report} (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. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - public List getReportTarget() { - if (this.reportTarget == null) - this.reportTarget = new ArrayList(); - return this.reportTarget; - } - - // syntactic sugar - /** - * @return {@link #report} (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. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) - */ - public DiagnosticReport addReportTarget() { - DiagnosticReport r = new DiagnosticReport(); - if (this.reportTarget == null) - this.reportTarget = new ArrayList(); - this.reportTarget.add(r); - return r; - } - - /** - * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) - */ - public List getComplication() { - if (this.complication == null) - this.complication = new ArrayList(); - return this.complication; - } - - public boolean hasComplication() { - if (this.complication == null) - return false; - for (CodeableConcept item : this.complication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) - */ - // syntactic sugar - public CodeableConcept addComplication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.complication == null) - this.complication = new ArrayList(); - this.complication.add(t); - return t; - } - - /** - * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.). This is the underlying object with id, value and extensions. The accessor "getFollowUp" gives direct access to the value - */ - public StringType getFollowUpElement() { - if (this.followUp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.followUp"); - else if (Configuration.doAutoCreate()) - this.followUp = new StringType(); - return this.followUp; - } - - public boolean hasFollowUpElement() { - return this.followUp != null && !this.followUp.isEmpty(); - } - - public boolean hasFollowUp() { - return this.followUp != null && !this.followUp.isEmpty(); - } - - /** - * @param value {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.). This is the underlying object with id, value and extensions. The accessor "getFollowUp" gives direct access to the value - */ - public Procedure setFollowUpElement(StringType value) { - this.followUp = value; - return this; - } - - /** - * @return If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. - */ - public String getFollowUp() { - return this.followUp == null ? null : this.followUp.getValue(); - } - - /** - * @param value If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. - */ - public Procedure setFollowUp(String value) { - if (Utilities.noString(value)) - this.followUp = null; - else { - if (this.followUp == null) - this.followUp = new StringType(); - this.followUp.setValue(value); - } - return this; - } - - /** - * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) - */ - public List getRelatedItem() { - if (this.relatedItem == null) - this.relatedItem = new ArrayList(); - return this.relatedItem; - } - - public boolean hasRelatedItem() { - if (this.relatedItem == null) - return false; - for (ProcedureRelatedItemComponent item : this.relatedItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) - */ - // syntactic sugar - public ProcedureRelatedItemComponent addRelatedItem() { //3 - ProcedureRelatedItemComponent t = new ProcedureRelatedItemComponent(); - if (this.relatedItem == null) - this.relatedItem = new ArrayList(); - this.relatedItem.add(t); - return t; - } - - /** - * @return {@link #notes} (Any other notes about the procedure - e.g. the operative notes.). 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 Procedure.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 other notes about the procedure - e.g. the operative notes.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public Procedure setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Any other notes about the procedure - e.g. the operative notes. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Any other notes about the procedure - e.g. the operative notes. - */ - public Procedure 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; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this procedure 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)", "The person on whom the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("date", "Period", "The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter during which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("outcome", "string", "What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("report", "Reference(DiagnosticReport)", "This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.", 0, java.lang.Integer.MAX_VALUE, report)); - childrenList.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication)); - childrenList.add(new Property("followUp", "string", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp)); - childrenList.add(new Property("relatedItem", "", "Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.", 0, java.lang.Integer.MAX_VALUE, relatedItem)); - childrenList.add(new Property("notes", "string", "Any other notes about the procedure - e.g. the operative notes.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - public Procedure copy() { - Procedure dst = new Procedure(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.type = type == null ? null : type.copy(); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (performer != null) { - dst.performer = new ArrayList(); - for (ProcedurePerformerComponent i : performer) - dst.performer.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - if (report != null) { - dst.report = new ArrayList(); - for (Reference i : report) - dst.report.add(i.copy()); - }; - if (complication != null) { - dst.complication = new ArrayList(); - for (CodeableConcept i : complication) - dst.complication.add(i.copy()); - }; - dst.followUp = followUp == null ? null : followUp.copy(); - if (relatedItem != null) { - dst.relatedItem = new ArrayList(); - for (ProcedureRelatedItemComponent i : relatedItem) - dst.relatedItem.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - protected Procedure typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (type == null || type.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) - && (performer == null || performer.isEmpty()) && (date == null || date.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (report == null || report.isEmpty()) && (complication == null || complication.isEmpty()) - && (followUp == null || followUp.isEmpty()) && (relatedItem == null || relatedItem.isEmpty()) - && (notes == null || notes.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Procedure; - } - - @SearchParamDefinition(name="patient", path="Procedure.patient", description="The identity of a patient to list procedures for", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="date", path="Procedure.date", description="The date the procedure was performed on", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="type", path="Procedure.type", description="Type of procedure", type="token" ) - public static final String SP_TYPE = "type"; - -} - + +/* + 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 action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + */ +@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") +public class Procedure extends DomainResource { + + public enum ProcedureRelationshipType implements FhirEnum { + /** + * This procedure had to be performed because of the related one. + */ + CAUSEDBY, + /** + * This procedure caused the related one to be performed. + */ + BECAUSEOF, + /** + * added to help the parsers + */ + NULL; + + public static final ProcedureRelationshipTypeEnumFactory ENUM_FACTORY = new ProcedureRelationshipTypeEnumFactory(); + + public static ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("caused-by".equals(codeString)) + return CAUSEDBY; + if ("because-of".equals(codeString)) + return BECAUSEOF; + throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case CAUSEDBY: return "caused-by"; + case BECAUSEOF: return "because-of"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case CAUSEDBY: return ""; + case BECAUSEOF: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case CAUSEDBY: return "This procedure had to be performed because of the related one."; + case BECAUSEOF: return "This procedure caused the related one to be performed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case CAUSEDBY: return "caused-by"; + case BECAUSEOF: return "because-of"; + default: return "?"; + } + } + } + + public static class ProcedureRelationshipTypeEnumFactory implements EnumFactory { + public ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("caused-by".equals(codeString)) + return ProcedureRelationshipType.CAUSEDBY; + if ("because-of".equals(codeString)) + return ProcedureRelationshipType.BECAUSEOF; + throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); + } + public String toCode(ProcedureRelationshipType code) throws IllegalArgumentException { + if (code == ProcedureRelationshipType.CAUSEDBY) + return "caused-by"; + if (code == ProcedureRelationshipType.BECAUSEOF) + return "because-of"; + return "?"; + } + } + + @Block() + public static class ProcedurePerformerComponent extends BackboneElement { + /** + * The practitioner who was involved in the procedure. + */ + @Child(name="person", type={Practitioner.class}, order=1, min=0, max=1) + @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The practitioner who was involved in the procedure.) + */ + protected Practitioner personTarget; + + /** + * E.g. surgeon, anaethetist, endoscopist. + */ + @Child(name="role", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="The role the person was in", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) + protected CodeableConcept role; + + private static final long serialVersionUID = -749890249L; + + public ProcedurePerformerComponent() { + super(); + } + + /** + * @return {@link #person} (The practitioner who was involved in the procedure.) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The practitioner who was involved in the procedure.) + */ + public ProcedurePerformerComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} 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 practitioner who was involved in the procedure.) + */ + public Practitioner getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Practitioner(); + return this.personTarget; + } + + /** + * @param value {@link #person} 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 was involved in the procedure.) + */ + public ProcedurePerformerComponent setPersonTarget(Practitioner value) { + this.personTarget = value; + return this; + } + + /** + * @return {@link #role} (E.g. surgeon, anaethetist, endoscopist.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedurePerformerComponent.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} (E.g. surgeon, anaethetist, endoscopist.) + */ + public ProcedurePerformerComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("person", "Reference(Practitioner)", "The practitioner who was involved in the procedure.", 0, java.lang.Integer.MAX_VALUE, person)); + childrenList.add(new Property("role", "CodeableConcept", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, role)); + } + + public ProcedurePerformerComponent copy() { + ProcedurePerformerComponent dst = new ProcedurePerformerComponent(); + copyValues(dst); + dst.person = person == null ? null : person.copy(); + dst.role = role == null ? null : role.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (person == null || person.isEmpty()) && (role == null || role.isEmpty()) + ; + } + + } + + @Block() + public static class ProcedureRelatedItemComponent extends BackboneElement { + /** + * The nature of the relationship. + */ + @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="caused-by | because-of", formalDefinition="The nature of the relationship." ) + protected Enumeration type; + + /** + * The related item - e.g. a procedure. + */ + @Child(name="target", type={AllergyIntolerance.class, CarePlan.class, Condition.class, DiagnosticReport.class, FamilyHistory.class, ImagingStudy.class, Immunization.class, ImmunizationRecommendation.class, MedicationAdministration.class, MedicationDispense.class, MedicationPrescription.class, MedicationStatement.class, Observation.class, Procedure.class}, order=2, min=0, max=1) + @Description(shortDefinition="The related item - e.g. a procedure", formalDefinition="The related item - e.g. a procedure." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The related item - e.g. a procedure.) + */ + protected Resource targetTarget; + + private static final long serialVersionUID = 41929784L; + + public ProcedureRelatedItemComponent() { + super(); + } + + /** + * @return {@link #type} (The nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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 nature of the relationship.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public ProcedureRelatedItemComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The nature of the relationship. + */ + public ProcedureRelationshipType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The nature of the relationship. + */ + public ProcedureRelatedItemComponent setType(ProcedureRelationshipType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(ProcedureRelationshipType.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The related item - e.g. a procedure.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRelatedItemComponent.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The related item - e.g. a procedure.) + */ + public ProcedureRelatedItemComponent setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 related item - e.g. a procedure.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @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 related item - e.g. a procedure.) + */ + public ProcedureRelatedItemComponent setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "The nature of the relationship.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("target", "Reference(AllergyIntolerance|CarePlan|Condition|DiagnosticReport|FamilyHistory|ImagingStudy|Immunization|ImmunizationRecommendation|MedicationAdministration|MedicationDispense|MedicationPrescription|MedicationStatement|Observation|Procedure)", "The related item - e.g. a procedure.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public ProcedureRelatedItemComponent copy() { + ProcedureRelatedItemComponent dst = new ProcedureRelatedItemComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.target = target == null ? null : target.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this procedure 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 procedure", formalDefinition="This records identifiers associated with this procedure 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; + + /** + * The person on whom the procedure was performed. + */ + @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Who procedure was performed on", formalDefinition="The person on whom the procedure was performed." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The person on whom the procedure was performed.) + */ + protected Patient patientTarget; + + /** + * The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded." ) + protected CodeableConcept type; + + /** + * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. + */ + @Child(name="bodySite", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Precise location details", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) + protected List bodySite; + + /** + * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text. + */ + @Child(name="indication", type={CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Reason procedure performed", formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text." ) + protected List indication; + + /** + * Limited to 'real' people rather than equipment. + */ + @Child(name="performer", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." ) + protected List performer; + + /** + * The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. + */ + @Child(name="date", type={Period.class}, order=5, min=0, max=1) + @Description(shortDefinition="The date the procedure was performed", formalDefinition="The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." ) + protected Period date; + + /** + * The encounter during which the procedure was performed. + */ + @Child(name="encounter", type={Encounter.class}, order=6, min=0, max=1) + @Description(shortDefinition="The encounter when procedure performed", formalDefinition="The encounter during which the procedure was performed." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter during which the procedure was performed.) + */ + protected Encounter encounterTarget; + + /** + * What was the outcome of the procedure - did it resolve reasons why the procedure was performed?. + */ + @Child(name="outcome", type={StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="What was result of procedure?", formalDefinition="What was the outcome of the procedure - did it resolve reasons why the procedure was performed?." ) + protected StringType outcome; + + /** + * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies. + */ + @Child(name="report", type={DiagnosticReport.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Any report that results from the procedure", formalDefinition="This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies." ) + protected List report; + /** + * The actual objects that are the target of the reference (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + protected List reportTarget; + + + /** + * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues. + */ + @Child(name="complication", type={CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues." ) + protected List complication; + + /** + * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. + */ + @Child(name="followUp", type={StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Instructions for follow up", formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used." ) + protected StringType followUp; + + /** + * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure. + */ + @Child(name="relatedItem", type={}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A procedure that is related to this one", formalDefinition="Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure." ) + protected List relatedItem; + + /** + * Any other notes about the procedure - e.g. the operative notes. + */ + @Child(name="notes", type={StringType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Additional information about procedure", formalDefinition="Any other notes about the procedure - e.g. the operative notes." ) + protected StringType notes; + + private static final long serialVersionUID = 1783571207L; + + public Procedure() { + super(); + } + + public Procedure(Reference patient, CodeableConcept type) { + super(); + this.patient = patient; + this.type = type; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this procedure 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 procedure 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (The person on whom the procedure was performed.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.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} (The person on whom the procedure was performed.) + */ + public Procedure 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. (The person on whom the procedure was performed.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.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. (The person on whom the procedure was performed.) + */ + public Procedure setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.) + */ + public Procedure setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + /** + * @return {@link #indication} (The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + 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 why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + /** + * @return {@link #performer} (Limited to 'real' people rather than equipment.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (ProcedurePerformerComponent item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Limited to 'real' people rather than equipment.) + */ + // syntactic sugar + public ProcedurePerformerComponent addPerformer() { //3 + ProcedurePerformerComponent t = new ProcedurePerformerComponent(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + /** + * @return {@link #date} (The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Period getDate() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.date"); + else if (Configuration.doAutoCreate()) + this.date = new Period(); + return this.date; + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) + */ + public Procedure setDate(Period value) { + this.date = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter during which the procedure was performed.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.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 during which the procedure was performed.) + */ + public Procedure 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 during which the procedure was performed.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.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 during which the procedure was performed.) + */ + public Procedure setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public StringType getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new StringType(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Procedure setOutcomeElement(StringType value) { + this.outcome = value; + return this; + } + + /** + * @return What was the outcome of the procedure - did it resolve reasons why the procedure was performed?. + */ + public String getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value What was the outcome of the procedure - did it resolve reasons why the procedure was performed?. + */ + public Procedure setOutcome(String value) { + if (Utilities.noString(value)) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new StringType(); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + public List getReport() { + if (this.report == null) + this.report = new ArrayList(); + return this.report; + } + + public boolean hasReport() { + if (this.report == null) + return false; + for (Reference item : this.report) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #report} (This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + // syntactic sugar + public Reference addReport() { //3 + Reference t = new Reference(); + if (this.report == null) + this.report = new ArrayList(); + this.report.add(t); + return t; + } + + /** + * @return {@link #report} (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. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + public List getReportTarget() { + if (this.reportTarget == null) + this.reportTarget = new ArrayList(); + return this.reportTarget; + } + + // syntactic sugar + /** + * @return {@link #report} (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. This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.) + */ + public DiagnosticReport addReportTarget() { + DiagnosticReport r = new DiagnosticReport(); + if (this.reportTarget == null) + this.reportTarget = new ArrayList(); + this.reportTarget.add(r); + return r; + } + + /** + * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) + */ + public List getComplication() { + if (this.complication == null) + this.complication = new ArrayList(); + return this.complication; + } + + public boolean hasComplication() { + if (this.complication == null) + return false; + for (CodeableConcept item : this.complication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.) + */ + // syntactic sugar + public CodeableConcept addComplication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.complication == null) + this.complication = new ArrayList(); + this.complication.add(t); + return t; + } + + /** + * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.). This is the underlying object with id, value and extensions. The accessor "getFollowUp" gives direct access to the value + */ + public StringType getFollowUpElement() { + if (this.followUp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Procedure.followUp"); + else if (Configuration.doAutoCreate()) + this.followUp = new StringType(); + return this.followUp; + } + + public boolean hasFollowUpElement() { + return this.followUp != null && !this.followUp.isEmpty(); + } + + public boolean hasFollowUp() { + return this.followUp != null && !this.followUp.isEmpty(); + } + + /** + * @param value {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.). This is the underlying object with id, value and extensions. The accessor "getFollowUp" gives direct access to the value + */ + public Procedure setFollowUpElement(StringType value) { + this.followUp = value; + return this; + } + + /** + * @return If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. + */ + public String getFollowUp() { + return this.followUp == null ? null : this.followUp.getValue(); + } + + /** + * @param value If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. + */ + public Procedure setFollowUp(String value) { + if (Utilities.noString(value)) + this.followUp = null; + else { + if (this.followUp == null) + this.followUp = new StringType(); + this.followUp.setValue(value); + } + return this; + } + + /** + * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) + */ + public List getRelatedItem() { + if (this.relatedItem == null) + this.relatedItem = new ArrayList(); + return this.relatedItem; + } + + public boolean hasRelatedItem() { + if (this.relatedItem == null) + return false; + for (ProcedureRelatedItemComponent item : this.relatedItem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #relatedItem} (Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.) + */ + // syntactic sugar + public ProcedureRelatedItemComponent addRelatedItem() { //3 + ProcedureRelatedItemComponent t = new ProcedureRelatedItemComponent(); + if (this.relatedItem == null) + this.relatedItem = new ArrayList(); + this.relatedItem.add(t); + return t; + } + + /** + * @return {@link #notes} (Any other notes about the procedure - e.g. the operative notes.). 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 Procedure.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 other notes about the procedure - e.g. the operative notes.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Procedure setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Any other notes about the procedure - e.g. the operative notes. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Any other notes about the procedure - e.g. the operative notes. + */ + public Procedure 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; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this procedure 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)", "The person on whom the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("bodySite", "CodeableConcept", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("date", "Period", "The dates over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter during which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("outcome", "string", "What was the outcome of the procedure - did it resolve reasons why the procedure was performed?.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("report", "Reference(DiagnosticReport)", "This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies.", 0, java.lang.Integer.MAX_VALUE, report)); + childrenList.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication)); + childrenList.add(new Property("followUp", "string", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp)); + childrenList.add(new Property("relatedItem", "", "Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure.", 0, java.lang.Integer.MAX_VALUE, relatedItem)); + childrenList.add(new Property("notes", "string", "Any other notes about the procedure - e.g. the operative notes.", 0, java.lang.Integer.MAX_VALUE, notes)); + } + + public Procedure copy() { + Procedure dst = new Procedure(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.type = type == null ? null : type.copy(); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + if (performer != null) { + dst.performer = new ArrayList(); + for (ProcedurePerformerComponent i : performer) + dst.performer.add(i.copy()); + }; + dst.date = date == null ? null : date.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + if (report != null) { + dst.report = new ArrayList(); + for (Reference i : report) + dst.report.add(i.copy()); + }; + if (complication != null) { + dst.complication = new ArrayList(); + for (CodeableConcept i : complication) + dst.complication.add(i.copy()); + }; + dst.followUp = followUp == null ? null : followUp.copy(); + if (relatedItem != null) { + dst.relatedItem = new ArrayList(); + for (ProcedureRelatedItemComponent i : relatedItem) + dst.relatedItem.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + return dst; + } + + protected Procedure typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (type == null || type.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) + && (performer == null || performer.isEmpty()) && (date == null || date.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (report == null || report.isEmpty()) && (complication == null || complication.isEmpty()) + && (followUp == null || followUp.isEmpty()) && (relatedItem == null || relatedItem.isEmpty()) + && (notes == null || notes.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Procedure; + } + + @SearchParamDefinition(name="patient", path="Procedure.patient", description="The identity of a patient to list procedures for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="date", path="Procedure.date", description="The date the procedure was performed on", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="type", path="Procedure.type", description="Type of procedure", type="token" ) + public static final String SP_TYPE = "type"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java index 6fbda6297c0..e34938a6986 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java @@ -20,1248 +20,1248 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A request for a procedure to be performed. May be a proposal or an order. - */ -@ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") -public class ProcedureRequest extends DomainResource { - - public enum ProcedureRequestStatus implements FhirEnum { - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the request, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the request is happening. - */ - INPROGRESS, - /** - * The work is complete, and the outcomes are being reviewed for approval. - */ - REVIEW, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The request was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - - public static final ProcedureRequestStatusEnumFactory ENUM_FACTORY = new ProcedureRequestStatusEnumFactory(); - - public static ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("review".equals(codeString)) - return REVIEW; - 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 ProcedureRequestStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case RECEIVED: return ""; - case ACCEPTED: return ""; - case INPROGRESS: return ""; - case REVIEW: return ""; - case COMPLETED: return ""; - case SUSPENDED: return ""; - case REJECTED: return ""; - case FAILED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the request, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the request is happening."; - case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The request was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - } - - public static class ProcedureRequestStatusEnumFactory implements EnumFactory { - public ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return ProcedureRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return ProcedureRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return ProcedureRequestStatus.ACCEPTED; - if ("in progress".equals(codeString)) - return ProcedureRequestStatus.INPROGRESS; - if ("review".equals(codeString)) - return ProcedureRequestStatus.REVIEW; - if ("completed".equals(codeString)) - return ProcedureRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return ProcedureRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return ProcedureRequestStatus.REJECTED; - if ("failed".equals(codeString)) - return ProcedureRequestStatus.FAILED; - throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); - } - public String toCode(ProcedureRequestStatus code) throws IllegalArgumentException { - if (code == ProcedureRequestStatus.REQUESTED) - return "requested"; - if (code == ProcedureRequestStatus.RECEIVED) - return "received"; - if (code == ProcedureRequestStatus.ACCEPTED) - return "accepted"; - if (code == ProcedureRequestStatus.INPROGRESS) - return "in progress"; - if (code == ProcedureRequestStatus.REVIEW) - return "review"; - if (code == ProcedureRequestStatus.COMPLETED) - return "completed"; - if (code == ProcedureRequestStatus.SUSPENDED) - return "suspended"; - if (code == ProcedureRequestStatus.REJECTED) - return "rejected"; - if (code == ProcedureRequestStatus.FAILED) - return "failed"; - return "?"; - } - } - - public enum ProcedureRequestMode implements FhirEnum { - /** - * planned. - */ - PLANNED, - /** - * proposed. - */ - PROPOSED, - /** - * ordered. - */ - ORDERED, - /** - * added to help the parsers - */ - NULL; - - public static final ProcedureRequestModeEnumFactory ENUM_FACTORY = new ProcedureRequestModeEnumFactory(); - - public static ProcedureRequestMode 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 ProcedureRequestMode 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 ProcedureRequestModeEnumFactory implements EnumFactory { - public ProcedureRequestMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return ProcedureRequestMode.PLANNED; - if ("proposed".equals(codeString)) - return ProcedureRequestMode.PROPOSED; - if ("ordered".equals(codeString)) - return ProcedureRequestMode.ORDERED; - throw new IllegalArgumentException("Unknown ProcedureRequestMode code '"+codeString+"'"); - } - public String toCode(ProcedureRequestMode code) throws IllegalArgumentException { - if (code == ProcedureRequestMode.PLANNED) - return "planned"; - if (code == ProcedureRequestMode.PROPOSED) - return "proposed"; - if (code == ProcedureRequestMode.ORDERED) - return "ordered"; - return "?"; - } - } - - public enum ProcedureRequestPriority implements FhirEnum { - /** - * The request has a normal priority. - */ - ROUTINE, - /** - * The request should be done urgently. - */ - URGENT, - /** - * The request is time-critical. - */ - STAT, - /** - * The request should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - - public static final ProcedureRequestPriorityEnumFactory ENUM_FACTORY = new ProcedureRequestPriorityEnumFactory(); - - public static ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return ""; - case URGENT: return ""; - case STAT: return ""; - case ASAP: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The request has a normal priority."; - case URGENT: return "The request should be done urgently."; - case STAT: return "The request is time-critical."; - case ASAP: return "The request should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - } - - public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { - public ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ProcedureRequestPriority.ROUTINE; - if ("urgent".equals(codeString)) - return ProcedureRequestPriority.URGENT; - if ("stat".equals(codeString)) - return ProcedureRequestPriority.STAT; - if ("asap".equals(codeString)) - return ProcedureRequestPriority.ASAP; - throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - public String toCode(ProcedureRequestPriority code) throws IllegalArgumentException { - if (code == ProcedureRequestPriority.ROUTINE) - return "routine"; - if (code == ProcedureRequestPriority.URGENT) - return "urgent"; - if (code == ProcedureRequestPriority.STAT) - return "stat"; - if (code == ProcedureRequestPriority.ASAP) - return "asap"; - return "?"; - } - } - - /** - * Identifiers assigned to this order by the order or by the receiver. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) - protected List identifier; - - /** - * The patient who will receive the procedure. - */ - @Child(name="subject", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="Subject", formalDefinition="The patient who will receive the procedure." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who will receive the procedure.) - */ - protected Patient subjectTarget; - - /** - * The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Procedure Type", formalDefinition="The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded." ) - protected CodeableConcept type; - - /** - * The site where the procedure is to be performed. - */ - @Child(name="bodySite", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target Body Site", formalDefinition="The site where the procedure is to be performed." ) - protected List bodySite; - - /** - * The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance. - */ - @Child(name="indication", type={CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Indication", formalDefinition="The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance." ) - protected List indication; - - /** - * The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". - */ - @Child(name="timing", type={DateTimeType.class, Period.class, Timing.class}, order=4, min=0, max=1) - @Description(shortDefinition="Timing", formalDefinition="The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) - protected Type timing; - - /** - * The encounter within which the procedure proposal or request was created. - */ - @Child(name="encounter", type={Encounter.class}, order=5, min=0, max=1) - @Description(shortDefinition="Encounter", formalDefinition="The encounter within which the procedure proposal or request was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the procedure proposal or request was created.) - */ - protected Encounter encounterTarget; - - /** - * E.g. surgeon, anaethetist, endoscopist. - */ - @Child(name="performer", type={Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1) - @Description(shortDefinition="Performer", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (E.g. surgeon, anaethetist, endoscopist.) - */ - protected Resource performerTarget; - - /** - * The status of the order. - */ - @Child(name="status", type={CodeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the order." ) - protected Enumeration status; - - /** - * The status of the order. - */ - @Child(name="mode", type={CodeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="planned | proposed | ordered", formalDefinition="The status of the order." ) - protected Enumeration mode; - - /** - * Any other notes associated with this proposal or order - e.g., provider instructions. - */ - @Child(name="notes", type={StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notes", formalDefinition="Any other notes associated with this proposal or order - e.g., provider instructions." ) - protected List notes; - - /** - * If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. - */ - @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=10, min=0, max=1) - @Description(shortDefinition="PRN", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the procedure." ) - protected Type asNeeded; - - /** - * The time when the request was made. - */ - @Child(name="orderedOn", type={DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="When Requested", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The healthcare professional responsible for proposing or ordering the procedure. - */ - @Child(name="orderer", type={Practitioner.class, Patient.class, RelatedPerson.class, Device.class}, order=12, min=0, max=1) - @Description(shortDefinition="Ordering Party", formalDefinition="The healthcare professional responsible for proposing or ordering the procedure." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for proposing or ordering the procedure.) - */ - protected Resource ordererTarget; - - /** - * The clinical priority associated with this order. - */ - @Child(name="priority", type={CodeType.class}, order=13, min=0, max=1) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) - protected Enumeration priority; - - private static final long serialVersionUID = -1874623679L; - - public ProcedureRequest() { - super(); - } - - public ProcedureRequest(Reference subject, CodeableConcept type) { - super(); - this.subject = subject; - this.type = type; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 assigned to this order by the order or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #subject} (The patient who will receive the procedure.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.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 will receive the procedure.) - */ - public ProcedureRequest 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 will receive the procedure.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.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 will receive the procedure.) - */ - public ProcedureRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) - */ - public ProcedureRequest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #bodySite} (The site where the procedure is to be performed.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (The site where the procedure is to be performed.) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - /** - * @return {@link #indication} (The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - 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 why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public DateTimeType getTimingDateTimeType() throws Exception { - if (!(this.timing instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Period getTimingPeriod() throws Exception { - if (!(this.timing instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public Timing getTimingTiming() throws Exception { - if (!(this.timing instanceof Timing)) - throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) - */ - public ProcedureRequest setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the procedure proposal or request was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.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 procedure proposal or request was created.) - */ - public ProcedureRequest 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 procedure proposal or request was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.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 procedure proposal or request was created.) - */ - public ProcedureRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) - */ - public ProcedureRequest setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} 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. (E.g. surgeon, anaethetist, endoscopist.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} 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. (E.g. surgeon, anaethetist, endoscopist.) - */ - public ProcedureRequest setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ProcedureRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the order. - */ - public ProcedureRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the order. - */ - public ProcedureRequest setStatus(ProcedureRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(ProcedureRequestStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @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 getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(); - 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 ProcedureRequest setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return The status of the order. - */ - public ProcedureRequestMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value The status of the order. - */ - public ProcedureRequest setMode(ProcedureRequestMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(ProcedureRequestMode.ENUM_FACTORY); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - public ProcedureRequest addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public BooleanType getAsNeededBooleanType() throws Exception { - if (!(this.asNeeded instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws Exception { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public ProcedureRequest setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public ProcedureRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public ProcedureRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public ProcedureRequest setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} 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 healthcare professional responsible for proposing or ordering the procedure.) - */ - public Resource getOrdererTarget() { - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} 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 healthcare professional responsible for proposing or ordering the procedure.) - */ - public ProcedureRequest setOrdererTarget(Resource value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(); - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public ProcedureRequest setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The clinical priority associated with this order. - */ - public ProcedureRequestPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The clinical priority associated with this order. - */ - public ProcedureRequest setPriority(ProcedureRequestPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(ProcedureRequestPriority.ENUM_FACTORY); - this.priority.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will receive the procedure.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("bodySite", "CodeableConcept", "The site where the procedure is to be performed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("timing[x]", "dateTime|Period|Timing", "The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the procedure proposal or request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("mode", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("notes", "string", "Any other notes associated with this proposal or order - e.g., provider instructions.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("orderer", "Reference(Practitioner|Patient|RelatedPerson|Device)", "The healthcare professional responsible for proposing or ordering the procedure.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - public ProcedureRequest copy() { - ProcedureRequest dst = new ProcedureRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.type = type == null ? null : type.copy(); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - dst.timing = timing == null ? null : timing.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.status = status == null ? null : status.copy(); - dst.mode = mode == null ? null : mode.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected ProcedureRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (type == null || type.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) - && (timing == null || timing.isEmpty()) && (encounter == null || encounter.isEmpty()) && (performer == null || performer.isEmpty()) - && (status == null || status.isEmpty()) && (mode == null || mode.isEmpty()) && (notes == null || notes.isEmpty()) - && (asNeeded == null || asNeeded.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) - && (orderer == null || orderer.isEmpty()) && (priority == null || priority.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcedureRequest; - } - - @SearchParamDefinition(name="patient", path="", description="Search by subject - a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - -} - + +/* + 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; +/** + * A request for a procedure to be performed. May be a proposal or an order. + */ +@ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") +public class ProcedureRequest extends DomainResource { + + public enum ProcedureRequestStatus implements FhirEnum { + /** + * The request has been placed. + */ + REQUESTED, + /** + * The receiving system has received the request but not yet decided whether it will be performed. + */ + RECEIVED, + /** + * The receiving system has accepted the request, but work has not yet commenced. + */ + ACCEPTED, + /** + * The work to fulfill the request is happening. + */ + INPROGRESS, + /** + * The work is complete, and the outcomes are being reviewed for approval. + */ + REVIEW, + /** + * The work has been complete, the report(s) released, and no further work is planned. + */ + COMPLETED, + /** + * The request has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to fulfill the request. + */ + REJECTED, + /** + * The request was attempted, but due to some procedural error, it could not be completed. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + + public static final ProcedureRequestStatusEnumFactory ENUM_FACTORY = new ProcedureRequestStatusEnumFactory(); + + public static ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("received".equals(codeString)) + return RECEIVED; + if ("accepted".equals(codeString)) + return ACCEPTED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("review".equals(codeString)) + return REVIEW; + 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 ProcedureRequestStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case RECEIVED: return ""; + case ACCEPTED: return ""; + case INPROGRESS: return ""; + case REVIEW: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The request has been placed."; + case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; + case ACCEPTED: return "The receiving system has accepted the request, but work has not yet commenced."; + case INPROGRESS: return "The work to fulfill the request is happening."; + case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; + case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; + case SUSPENDED: return "The request has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to fulfill the request."; + case FAILED: return "The request was attempted, but due to some procedural error, it could not be completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "requested"; + case RECEIVED: return "received"; + case ACCEPTED: return "accepted"; + case INPROGRESS: return "in progress"; + case REVIEW: return "review"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + } + + public static class ProcedureRequestStatusEnumFactory implements EnumFactory { + public ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return ProcedureRequestStatus.REQUESTED; + if ("received".equals(codeString)) + return ProcedureRequestStatus.RECEIVED; + if ("accepted".equals(codeString)) + return ProcedureRequestStatus.ACCEPTED; + if ("in progress".equals(codeString)) + return ProcedureRequestStatus.INPROGRESS; + if ("review".equals(codeString)) + return ProcedureRequestStatus.REVIEW; + if ("completed".equals(codeString)) + return ProcedureRequestStatus.COMPLETED; + if ("suspended".equals(codeString)) + return ProcedureRequestStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return ProcedureRequestStatus.REJECTED; + if ("failed".equals(codeString)) + return ProcedureRequestStatus.FAILED; + throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); + } + public String toCode(ProcedureRequestStatus code) throws IllegalArgumentException { + if (code == ProcedureRequestStatus.REQUESTED) + return "requested"; + if (code == ProcedureRequestStatus.RECEIVED) + return "received"; + if (code == ProcedureRequestStatus.ACCEPTED) + return "accepted"; + if (code == ProcedureRequestStatus.INPROGRESS) + return "in progress"; + if (code == ProcedureRequestStatus.REVIEW) + return "review"; + if (code == ProcedureRequestStatus.COMPLETED) + return "completed"; + if (code == ProcedureRequestStatus.SUSPENDED) + return "suspended"; + if (code == ProcedureRequestStatus.REJECTED) + return "rejected"; + if (code == ProcedureRequestStatus.FAILED) + return "failed"; + return "?"; + } + } + + public enum ProcedureRequestMode implements FhirEnum { + /** + * planned. + */ + PLANNED, + /** + * proposed. + */ + PROPOSED, + /** + * ordered. + */ + ORDERED, + /** + * added to help the parsers + */ + NULL; + + public static final ProcedureRequestModeEnumFactory ENUM_FACTORY = new ProcedureRequestModeEnumFactory(); + + public static ProcedureRequestMode 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 ProcedureRequestMode 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 ProcedureRequestModeEnumFactory implements EnumFactory { + public ProcedureRequestMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return ProcedureRequestMode.PLANNED; + if ("proposed".equals(codeString)) + return ProcedureRequestMode.PROPOSED; + if ("ordered".equals(codeString)) + return ProcedureRequestMode.ORDERED; + throw new IllegalArgumentException("Unknown ProcedureRequestMode code '"+codeString+"'"); + } + public String toCode(ProcedureRequestMode code) throws IllegalArgumentException { + if (code == ProcedureRequestMode.PLANNED) + return "planned"; + if (code == ProcedureRequestMode.PROPOSED) + return "proposed"; + if (code == ProcedureRequestMode.ORDERED) + return "ordered"; + return "?"; + } + } + + public enum ProcedureRequestPriority implements FhirEnum { + /** + * The request has a normal priority. + */ + ROUTINE, + /** + * The request should be done urgently. + */ + URGENT, + /** + * The request is time-critical. + */ + STAT, + /** + * The request should be acted on as soon as possible. + */ + ASAP, + /** + * added to help the parsers + */ + NULL; + + public static final ProcedureRequestPriorityEnumFactory ENUM_FACTORY = new ProcedureRequestPriorityEnumFactory(); + + public static ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ROUTINE; + if ("urgent".equals(codeString)) + return URGENT; + if ("stat".equals(codeString)) + return STAT; + if ("asap".equals(codeString)) + return ASAP; + throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ROUTINE: return ""; + case URGENT: return ""; + case STAT: return ""; + case ASAP: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ROUTINE: return "The request has a normal priority."; + case URGENT: return "The request should be done urgently."; + case STAT: return "The request is time-critical."; + case ASAP: return "The request should be acted on as soon as possible."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ROUTINE: return "routine"; + case URGENT: return "urgent"; + case STAT: return "stat"; + case ASAP: return "asap"; + default: return "?"; + } + } + } + + public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { + public ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("routine".equals(codeString)) + return ProcedureRequestPriority.ROUTINE; + if ("urgent".equals(codeString)) + return ProcedureRequestPriority.URGENT; + if ("stat".equals(codeString)) + return ProcedureRequestPriority.STAT; + if ("asap".equals(codeString)) + return ProcedureRequestPriority.ASAP; + throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); + } + public String toCode(ProcedureRequestPriority code) throws IllegalArgumentException { + if (code == ProcedureRequestPriority.ROUTINE) + return "routine"; + if (code == ProcedureRequestPriority.URGENT) + return "urgent"; + if (code == ProcedureRequestPriority.STAT) + return "stat"; + if (code == ProcedureRequestPriority.ASAP) + return "asap"; + return "?"; + } + } + + /** + * Identifiers assigned to this order by the order or by the receiver. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) + protected List identifier; + + /** + * The patient who will receive the procedure. + */ + @Child(name="subject", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="Subject", formalDefinition="The patient who will receive the procedure." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who will receive the procedure.) + */ + protected Patient subjectTarget; + + /** + * The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Procedure Type", formalDefinition="The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded." ) + protected CodeableConcept type; + + /** + * The site where the procedure is to be performed. + */ + @Child(name="bodySite", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target Body Site", formalDefinition="The site where the procedure is to be performed." ) + protected List bodySite; + + /** + * The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance. + */ + @Child(name="indication", type={CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication", formalDefinition="The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance." ) + protected List indication; + + /** + * The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + */ + @Child(name="timing", type={DateTimeType.class, Period.class, Timing.class}, order=4, min=0, max=1) + @Description(shortDefinition="Timing", formalDefinition="The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'." ) + protected Type timing; + + /** + * The encounter within which the procedure proposal or request was created. + */ + @Child(name="encounter", type={Encounter.class}, order=5, min=0, max=1) + @Description(shortDefinition="Encounter", formalDefinition="The encounter within which the procedure proposal or request was created." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the procedure proposal or request was created.) + */ + protected Encounter encounterTarget; + + /** + * E.g. surgeon, anaethetist, endoscopist. + */ + @Child(name="performer", type={Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1) + @Description(shortDefinition="Performer", formalDefinition="E.g. surgeon, anaethetist, endoscopist." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (E.g. surgeon, anaethetist, endoscopist.) + */ + protected Resource performerTarget; + + /** + * The status of the order. + */ + @Child(name="status", type={CodeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", formalDefinition="The status of the order." ) + protected Enumeration status; + + /** + * The status of the order. + */ + @Child(name="mode", type={CodeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="planned | proposed | ordered", formalDefinition="The status of the order." ) + protected Enumeration mode; + + /** + * Any other notes associated with this proposal or order - e.g., provider instructions. + */ + @Child(name="notes", type={StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notes", formalDefinition="Any other notes associated with this proposal or order - e.g., provider instructions." ) + protected List notes; + + /** + * If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. + */ + @Child(name="asNeeded", type={BooleanType.class, CodeableConcept.class}, order=10, min=0, max=1) + @Description(shortDefinition="PRN", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the procedure." ) + protected Type asNeeded; + + /** + * The time when the request was made. + */ + @Child(name="orderedOn", type={DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="When Requested", formalDefinition="The time when the request was made." ) + protected DateTimeType orderedOn; + + /** + * The healthcare professional responsible for proposing or ordering the procedure. + */ + @Child(name="orderer", type={Practitioner.class, Patient.class, RelatedPerson.class, Device.class}, order=12, min=0, max=1) + @Description(shortDefinition="Ordering Party", formalDefinition="The healthcare professional responsible for proposing or ordering the procedure." ) + protected Reference orderer; + + /** + * The actual object that is the target of the reference (The healthcare professional responsible for proposing or ordering the procedure.) + */ + protected Resource ordererTarget; + + /** + * The clinical priority associated with this order. + */ + @Child(name="priority", type={CodeType.class}, order=13, min=0, max=1) + @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) + protected Enumeration priority; + + private static final long serialVersionUID = -1874623679L; + + public ProcedureRequest() { + super(); + } + + public ProcedureRequest(Reference subject, CodeableConcept type) { + super(); + this.subject = subject; + this.type = type; + } + + /** + * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 assigned to this order by the order or by the receiver.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #subject} (The patient who will receive the procedure.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.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 will receive the procedure.) + */ + public ProcedureRequest 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 will receive the procedure.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.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 will receive the procedure.) + */ + public ProcedureRequest setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.) + */ + public ProcedureRequest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #bodySite} (The site where the procedure is to be performed.) + */ + public List getBodySite() { + if (this.bodySite == null) + this.bodySite = new ArrayList(); + return this.bodySite; + } + + public boolean hasBodySite() { + if (this.bodySite == null) + return false; + for (CodeableConcept item : this.bodySite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #bodySite} (The site where the procedure is to be performed.) + */ + // syntactic sugar + public CodeableConcept addBodySite() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.bodySite == null) + this.bodySite = new ArrayList(); + this.bodySite.add(t); + return t; + } + + /** + * @return {@link #indication} (The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + 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 why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Type getTiming() { + return this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public DateTimeType getTimingDateTimeType() throws Exception { + if (!(this.timing instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (DateTimeType) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Period getTimingPeriod() throws Exception { + if (!(this.timing instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Period) this.timing; + } + + /** + * @return {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public Timing getTimingTiming() throws Exception { + if (!(this.timing instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); + return (Timing) this.timing; + } + + public boolean hasTiming() { + return this.timing != null && !this.timing.isEmpty(); + } + + /** + * @param value {@link #timing} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".) + */ + public ProcedureRequest setTiming(Type value) { + this.timing = value; + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the procedure proposal or request was created.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.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 procedure proposal or request was created.) + */ + public ProcedureRequest 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 procedure proposal or request was created.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.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 procedure proposal or request was created.) + */ + public ProcedureRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (E.g. surgeon, anaethetist, endoscopist.) + */ + public ProcedureRequest setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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. (E.g. surgeon, anaethetist, endoscopist.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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. (E.g. surgeon, anaethetist, endoscopist.) + */ + public ProcedureRequest setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ProcedureRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the order. + */ + public ProcedureRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the order. + */ + public ProcedureRequest setStatus(ProcedureRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(ProcedureRequestStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @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 getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + 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 ProcedureRequest setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return The status of the order. + */ + public ProcedureRequestMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value The status of the order. + */ + public ProcedureRequest setMode(ProcedureRequestMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(ProcedureRequestMode.ENUM_FACTORY); + this.mode.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StringType item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + // syntactic sugar + public StringType addNotesElement() {//2 + StringType t = new StringType(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + public ProcedureRequest addNotes(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return this; + } + + /** + * @param value {@link #notes} (Any other notes associated with this proposal or order - e.g., provider instructions.) + */ + public boolean hasNotes(String value) { + if (this.notes == null) + return false; + for (StringType v : this.notes) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public Type getAsNeeded() { + return this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public BooleanType getAsNeededBooleanType() throws Exception { + if (!(this.asNeeded instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (BooleanType) this.asNeeded; + } + + /** + * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public CodeableConcept getAsNeededCodeableConcept() throws Exception { + if (!(this.asNeeded instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); + return (CodeableConcept) this.asNeeded; + } + + public boolean hasAsNeeded() { + return this.asNeeded != null && !this.asNeeded.isEmpty(); + } + + /** + * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) + */ + public ProcedureRequest setAsNeeded(Type value) { + this.asNeeded = value; + return this; + } + + /** + * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public DateTimeType getOrderedOnElement() { + if (this.orderedOn == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.orderedOn"); + else if (Configuration.doAutoCreate()) + this.orderedOn = new DateTimeType(); + return this.orderedOn; + } + + public boolean hasOrderedOnElement() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + public boolean hasOrderedOn() { + return this.orderedOn != null && !this.orderedOn.isEmpty(); + } + + /** + * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value + */ + public ProcedureRequest setOrderedOnElement(DateTimeType value) { + this.orderedOn = value; + return this; + } + + /** + * @return The time when the request was made. + */ + public Date getOrderedOn() { + return this.orderedOn == null ? null : this.orderedOn.getValue(); + } + + /** + * @param value The time when the request was made. + */ + public ProcedureRequest setOrderedOn(Date value) { + if (value == null) + this.orderedOn = null; + else { + if (this.orderedOn == null) + this.orderedOn = new DateTimeType(); + this.orderedOn.setValue(value); + } + return this; + } + + /** + * @return {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public Reference getOrderer() { + if (this.orderer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.orderer"); + else if (Configuration.doAutoCreate()) + this.orderer = new Reference(); + return this.orderer; + } + + public boolean hasOrderer() { + return this.orderer != null && !this.orderer.isEmpty(); + } + + /** + * @param value {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) + */ + public ProcedureRequest setOrderer(Reference value) { + this.orderer = value; + return this; + } + + /** + * @return {@link #orderer} 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 healthcare professional responsible for proposing or ordering the procedure.) + */ + public Resource getOrdererTarget() { + return this.ordererTarget; + } + + /** + * @param value {@link #orderer} 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 healthcare professional responsible for proposing or ordering the procedure.) + */ + public ProcedureRequest setOrdererTarget(Resource value) { + this.ordererTarget = value; + return this; + } + + /** + * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public Enumeration getPriorityElement() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProcedureRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Enumeration(); + return this.priority; + } + + public boolean hasPriorityElement() { + return this.priority != null && !this.priority.isEmpty(); + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value + */ + public ProcedureRequest setPriorityElement(Enumeration value) { + this.priority = value; + return this; + } + + /** + * @return The clinical priority associated with this order. + */ + public ProcedureRequestPriority getPriority() { + return this.priority == null ? null : this.priority.getValue(); + } + + /** + * @param value The clinical priority associated with this order. + */ + public ProcedureRequest setPriority(ProcedureRequestPriority value) { + if (value == null) + this.priority = null; + else { + if (this.priority == null) + this.priority = new Enumeration(ProcedureRequestPriority.ENUM_FACTORY); + this.priority.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will receive the procedure.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("type", "CodeableConcept", "The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("bodySite", "CodeableConcept", "The site where the procedure is to be performed.", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("indication", "CodeableConcept", "The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("timing[x]", "dateTime|Period|Timing", "The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. 'Every 8 hours'; 'Three times a day'; '1/2 an hour before breakfast for 10 days from 23-Dec 2011:'; '15 Oct 2013, 17 Oct 2013 and 1 Nov 2013'.", 0, java.lang.Integer.MAX_VALUE, timing)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the procedure proposal or request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "E.g. surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("mode", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, mode)); + childrenList.add(new Property("notes", "string", "Any other notes associated with this proposal or order - e.g., provider instructions.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); + childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); + childrenList.add(new Property("orderer", "Reference(Practitioner|Patient|RelatedPerson|Device)", "The healthcare professional responsible for proposing or ordering the procedure.", 0, java.lang.Integer.MAX_VALUE, orderer)); + childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); + } + + public ProcedureRequest copy() { + ProcedureRequest dst = new ProcedureRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.type = type == null ? null : type.copy(); + if (bodySite != null) { + dst.bodySite = new ArrayList(); + for (CodeableConcept i : bodySite) + dst.bodySite.add(i.copy()); + }; + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + dst.timing = timing == null ? null : timing.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.status = status == null ? null : status.copy(); + dst.mode = mode == null ? null : mode.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (StringType i : notes) + dst.notes.add(i.copy()); + }; + dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); + dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); + dst.orderer = orderer == null ? null : orderer.copy(); + dst.priority = priority == null ? null : priority.copy(); + return dst; + } + + protected ProcedureRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) + && (type == null || type.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (indication == null || indication.isEmpty()) + && (timing == null || timing.isEmpty()) && (encounter == null || encounter.isEmpty()) && (performer == null || performer.isEmpty()) + && (status == null || status.isEmpty()) && (mode == null || mode.isEmpty()) && (notes == null || notes.isEmpty()) + && (asNeeded == null || asNeeded.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) + && (orderer == null || orderer.isEmpty()) && (priority == null || priority.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProcedureRequest; + } + + @SearchParamDefinition(name="patient", path="", description="Search by subject - a patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="", description="Search by subject", type="reference" ) + public static final String SP_SUBJECT = "subject"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java index 1d6ed2fb5b4..ff6db8602dc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java @@ -20,3788 +20,3788 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="ProfessionalClaim", profile="http://hl7.org/fhir/Profile/ProfessionalClaim") -public class ProfessionalClaim extends DomainResource { - - public enum UseLink implements FhirEnum { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case PROPOSED: return ""; - case EXPLORATORY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class UseLinkEnumFactory implements EnumFactory { - public UseLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return UseLink.COMPLETE; - if ("proposed".equals(codeString)) - return UseLink.PROPOSED; - if ("exploratory".equals(codeString)) - return UseLink.EXPLORATORY; - if ("other".equals(codeString)) - return UseLink.OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - public String toCode(UseLink code) throws IllegalArgumentException { - if (code == UseLink.COMPLETE) - return "complete"; - if (code == UseLink.PROPOSED) - return "proposed"; - if (code == UseLink.EXPLORATORY) - return "exploratory"; - if (code == UseLink.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class PayeeComponent extends BackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="person", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement { - /** - * Sequence of diagnosis. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) - protected IntegerType sequence; - - /** - * The diagnosis. - */ - @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -935927954L; - - public DiagnosisComponent() { - super(); - } - - public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement { - /** - * A service line item. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected IntegerType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agrement which describes the terms and conditions. - */ - @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preauthref; - - /** - * The Coverages adjudication details. - */ - @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - private static final long serialVersionUID = 450222500L; - - public CoverageComponent() { - super(); - } - - public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public boolean getFocal() { - return this.focal == null ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agrement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agrement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreauthref() { - if (this.preauthref == null) - this.preauthref = new ArrayList(); - return this.preauthref; - } - - public boolean hasPreauthref() { - if (this.preauthref == null) - return false; - for (StringType item : this.preauthref) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreauthrefElement() {//2 - StringType t = new StringType(); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return t; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreauthref(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return this; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreauthref(String value) { - if (this.preauthref == null) - return false; - for (StringType v : this.preauthref) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} 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 Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} 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 Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - 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)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preauthref != null) { - dst.preauthref = new ArrayList(); - for (StringType i : preauthref) - dst.preauthref.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; - - /** - * Second tier of goods and services. - */ - @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 detail; - - private static final long serialVersionUID = -1140048455L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 ItemsComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - 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(); - 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(); - 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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public DateType getServiceDateElement() { - if (this.serviceDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); - else if (Configuration.doAutoCreate()) - this.serviceDate = new DateType(); - return this.serviceDate; - } - - public boolean hasServiceDateElement() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - public boolean hasServiceDate() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - /** - * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public ItemsComponent setServiceDateElement(DateType value) { - this.serviceDate = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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(Date value) { - if (value == null) - this.serviceDate = null; - else { - if (this.serviceDate == null) - this.serviceDate = new DateType(); - this.serviceDate.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public ItemsComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubsite() { - if (this.subsite == null) - this.subsite = new ArrayList(); - return this.subsite; - } - - public boolean hasSubsite() { - if (this.subsite == null) - return false; - for (Coding item : this.subsite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubsite() { //3 - Coding t = new Coding(); - if (this.subsite == null) - this.subsite = new ArrayList(); - this.subsite.add(t); - return t; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - 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(); - 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(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subsite != null) { - dst.subsite = new ArrayList(); - for (Coding i : subsite) - dst.subsite.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) - && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class DetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * 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=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Total additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Third tier of goods and services. - */ - @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -342502025L; - - public DetailComponent() { - super(); - } - - public DetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public DetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="service", type={Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) - 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Net additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - private static final long serialVersionUID = 122809194L; - - public SubDetailComponent() { - super(); - } - - public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addtional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public SubDetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()); - } - - } - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) - */ - protected Organization targetTarget; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Organization organizationTarget; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - protected Practitioner entererTarget; - - /** - * Facility where the services were provided. - */ - @Child(name="facility", type={Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Reference facility; - - /** - * The actual object that is the target of the reference (Facility where the services were provided.) - */ - protected Location facilityTarget; - - /** - * Theparty to be reimbused for the services. - */ - @Child(name="payee", type={}, order=11, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - protected ReferralRequest referralTarget; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * List of patient conditions for which care is sought. - */ - @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) - protected List condition; - - /** - * Patient Resource. - */ - @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient patientTarget; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name="school", type={StringType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * Date of an accident which these services are addessing. - */ - @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) - @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) - protected DateType accident; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) - @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * First tier of goods and services. - */ - @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) - @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 additionalMaterials; - - private static final long serialVersionUID = 1113876752L; - - public ProfessionalClaim() { - super(); - } - - public ProfessionalClaim(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public ProfessionalClaim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public ProfessionalClaim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 ProfessionalClaim setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 ProfessionalClaim setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public ProfessionalClaim setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public ProfessionalClaim setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public ProfessionalClaim setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public ProfessionalClaim setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public ProfessionalClaim setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 bill, claim pre-determination, pre-authorization.) - */ - public ProfessionalClaim setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public ProfessionalClaim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public UseLink getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public ProfessionalClaim setUse(UseLink value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(UseLink.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public ProfessionalClaim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public ProfessionalClaim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public ProfessionalClaim setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); - return this.entererTarget; - } - - /** - * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public ProfessionalClaim setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacility() { - if (this.facility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public ProfessionalClaim setFacility(Reference value) { - this.facility = value; - return this; - } - - /** - * @return {@link #facility} 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. (Facility where the services were provided.) - */ - public Location getFacilityTarget() { - if (this.facilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); - return this.facilityTarget; - } - - /** - * @param value {@link #facility} 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. (Facility where the services were provided.) - */ - public ProfessionalClaim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - - /** - * @return {@link #payee} (Theparty to be reimbused for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (Theparty to be reimbused for the services.) - */ - public ProfessionalClaim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ProfessionalClaim setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); - return this.referralTarget; - } - - /** - * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ProfessionalClaim setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Coding item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - // syntactic sugar - public Coding addCondition() { //3 - Coding t = new Coding(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.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} (Patient Resource.) - */ - public ProfessionalClaim 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. (Patient Resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.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. (Patient Resource.) - */ - public ProfessionalClaim setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public ProfessionalClaim setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public ProfessionalClaim setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public DateType getAccidentElement() { - if (this.accident == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.accident"); - else if (Configuration.doAutoCreate()) - this.accident = new DateType(); - return this.accident; - } - - public boolean hasAccidentElement() { - return this.accident != null && !this.accident.isEmpty(); - } - - public boolean hasAccident() { - return this.accident != null && !this.accident.isEmpty(); - } - - /** - * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public ProfessionalClaim setAccidentElement(DateType value) { - this.accident = value; - return this; - } - - /** - * @return Date of an accident which these services are addessing. - */ - public Date getAccident() { - return this.accident == null ? null : this.accident.getValue(); - } - - /** - * @param value Date of an accident which these services are addessing. - */ - public ProfessionalClaim setAccident(Date value) { - if (value == null) - this.accident = null; - else { - if (this.accident == null) - this.accident = new DateType(); - this.accident.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfessionalClaim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public ProfessionalClaim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterials() { - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - return this.additionalMaterials; - } - - public boolean hasAdditionalMaterials() { - if (this.additionalMaterials == null) - return false; - for (Coding item : this.additionalMaterials) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterials() { //3 - Coding t = new Coding(); - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); - } - - public ProfessionalClaim copy() { - ProfessionalClaim dst = new ProfessionalClaim(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Coding i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.accident = accident == null ? null : accident.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additionalMaterials != null) { - dst.additionalMaterials = new ArrayList(); - for (Coding i : additionalMaterials) - dst.additionalMaterials.add(i.copy()); - }; - return dst; - } - - protected ProfessionalClaim typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) - && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProfessionalClaim; - } - - @SearchParamDefinition(name="patient", path="ProfessionalClaim.patient", description="Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="priority", path="ProfessionalClaim.priority", description="Processing priority requested", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="use", path="ProfessionalClaim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - @SearchParamDefinition(name="identifier", path="ProfessionalClaim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="ProfessionalClaim", profile="http://hl7.org/fhir/Profile/ProfessionalClaim") +public class ProfessionalClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} 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 Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} 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 Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + 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)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; + + /** + * Second tier of goods and services. + */ + @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 detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + 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(); + 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(); + 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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + 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(); + 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(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * 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=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Total additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Net additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @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 additionalMaterials; + + private static final long serialVersionUID = 1113876752L; + + public ProfessionalClaim() { + super(); + } + + public ProfessionalClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public ProfessionalClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public ProfessionalClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 ProfessionalClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 ProfessionalClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public ProfessionalClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public ProfessionalClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ProfessionalClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public ProfessionalClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public ProfessionalClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public ProfessionalClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public ProfessionalClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public ProfessionalClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public ProfessionalClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} 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. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} 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. (Facility where the services were provided.) + */ + public ProfessionalClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public ProfessionalClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ProfessionalClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ProfessionalClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.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} (Patient Resource.) + */ + public ProfessionalClaim 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. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.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. (Patient Resource.) + */ + public ProfessionalClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public ProfessionalClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public ProfessionalClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public ProfessionalClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public ProfessionalClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public ProfessionalClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public ProfessionalClaim copy() { + ProfessionalClaim dst = new ProfessionalClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected ProfessionalClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProfessionalClaim; + } + + @SearchParamDefinition(name="patient", path="ProfessionalClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="ProfessionalClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="ProfessionalClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="ProfessionalClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java index 65dbadfa90e..485881b8dcc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java @@ -20,1451 +20,1451 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions. - */ -@ResourceDef(name="Profile", profile="http://hl7.org/fhir/Profile/Profile") -public class Profile extends DomainResource { - - public enum ResourceProfileStatus implements FhirEnum { - /** - * This profile is still under development. - */ - DRAFT, - /** - * This profile is ready for normal use. - */ - ACTIVE, - /** - * This profile has been deprecated, withdrawn or superseded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This profile is still under development."; - case ACTIVE: return "This profile is ready for normal use."; - case RETIRED: return "This profile has been deprecated, withdrawn or superseded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class ResourceProfileStatusEnumFactory implements EnumFactory { - public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ResourceProfileStatus.DRAFT; - if ("active".equals(codeString)) - return ResourceProfileStatus.ACTIVE; - if ("retired".equals(codeString)) - return ResourceProfileStatus.RETIRED; - throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); - } - public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { - if (code == ResourceProfileStatus.DRAFT) - return "draft"; - if (code == ResourceProfileStatus.ACTIVE) - return "active"; - if (code == ResourceProfileStatus.RETIRED) - return "retired"; - return "?"; - } - } - - @Block() - public static class ProfileMappingComponent extends BackboneElement { - /** - * An Internal id that is used to identify this mapping set when specific mappings are made. - */ - @Child(name="identity", type={IdType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) - protected IdType identity; - - /** - * A URI that identifies the specification that this mapping is expressed to. - */ - @Child(name="uri", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="A URI that identifies the specification that this mapping is expressed to." ) - protected UriType uri; - - /** - * A name for the specification that is being mapped to. - */ - @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=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; - - private static final long serialVersionUID = 299630820L; - - public ProfileMappingComponent() { - super(); - } - - public ProfileMappingComponent(IdType identity) { - super(); - this.identity = identity; - } - - /** - * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfileMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public ProfileMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public ProfileMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfileMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public ProfileMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return A URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value A URI that identifies the specification that this mapping is expressed to. - */ - public ProfileMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.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 - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfileMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (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 - */ - public ProfileMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public ProfileMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProfileMappingComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ProfileMappingComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public ProfileMappingComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); - 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("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)); - } - - public ProfileMappingComponent copy() { - ProfileMappingComponent dst = new ProfileMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.uri = uri == null ? null : uri.copy(); - dst.name = name == null ? null : name.copy(); - dst.comments = comments == null ? null : comments.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) - && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); - } - - } - - @Block() - public static class ConstraintComponent extends BackboneElement { - /** - * Captures constraints on each element within the resource. - */ - @Child(name="element", type={ElementDefinition.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Definition of elements in the resource (if no profile)", formalDefinition="Captures constraints on each element within the resource." ) - protected List element; - - private static final long serialVersionUID = 53896641L; - - public ConstraintComponent() { - super(); - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - public ConstraintComponent copy() { - ConstraintComponent dst = new ConstraintComponent(); - copyValues(dst); - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()); - } - - } - - /** - * The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems. - */ - @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Literal URL used to reference this profile", formalDefinition="The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Other identifiers for the profile", formalDefinition="Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) - protected List identifier; - - /** - * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually. - */ - @Child(name="version", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the profile", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually." ) - protected StringType version; - - /** - * A free text natural language name identifying the Profile. - */ - @Child(name="name", type={StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Informal name for this profile", formalDefinition="A free text natural language name identifying the Profile." ) - protected StringType name; - - /** - * Details of the individual or organization who accepts responsibility for publishing the profile. - */ - @Child(name="publisher", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the profile." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A free text natural language description of the profile and its use. - */ - @Child(name="description", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Natural language description of the profile", formalDefinition="A free text natural language description of the profile and its use." ) - protected StringType description; - - /** - * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. - */ - @Child(name="code", type={Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) - protected List code; - - /** - * The status of the profile. - */ - @Child(name="status", type={CodeType.class}, order=7, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) - protected Enumeration status; - - /** - * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name="experimental", type={BooleanType.class}, order=8, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date that this version of the profile was published. - */ - @Child(name="date", type={DateTimeType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Date for this version of the profile", formalDefinition="The date that this version of the profile was published." ) - protected DateTimeType date; - - /** - * The Scope and Usage that this profile was created to meet. - */ - @Child(name="requirements", type={StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Scope and Usage this profile is for", formalDefinition="The Scope and Usage that this profile was created to meet." ) - protected StringType requirements; - - /** - * The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version. - */ - @Child(name="fhirVersion", type={IdType.class}, order=11, min=0, max=1) - @Description(shortDefinition="FHIR Version this profile targets", formalDefinition="The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version." ) - protected IdType fhirVersion; - - /** - * An external specification that the content is mapped to. - */ - @Child(name="mapping", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) - protected List mapping; - - /** - * The Resource or Data type being described. - */ - @Child(name="type", type={CodeType.class}, order=13, min=1, max=1) - @Description(shortDefinition="The Resource or Data Type being described", formalDefinition="The Resource or Data type being described." ) - protected CodeType type; - - /** - * The structure that is the base on which this set of constraints is derived from. - */ - @Child(name="base", type={UriType.class}, order=14, min=0, max=1) - @Description(shortDefinition="Structure that this set of constraints applies to", formalDefinition="The structure that is the base on which this set of constraints is derived from." ) - protected UriType base; - - /** - * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile. - */ - @Child(name="snapshot", type={}, order=15, min=0, max=1) - @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile." ) - protected ConstraintComponent snapshot; - - /** - * A differential view is expressed relative to the base profile - a statement of differences that it applies. - */ - @Child(name="differential", type={ConstraintComponent.class}, order=16, min=0, max=1) - @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base profile - a statement of differences that it applies." ) - protected ConstraintComponent differential; - - private static final long serialVersionUID = -1737882057L; - - public Profile() { - super(); - } - - public Profile(UriType url, StringType name, Enumeration status, CodeType type) { - super(); - this.url = url; - this.name = name; - this.status = status; - this.type = type; - } - - /** - * @return {@link #url} (The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Profile setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems. - */ - public Profile setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Profile setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually. - */ - public Profile setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Profile setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the Profile. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the Profile. - */ - public Profile setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Profile setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Details of the individual or organization who accepts responsibility for publishing the profile. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Details of the individual or organization who accepts responsibility for publishing the profile. - */ - public Profile setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #description} (A free text natural language description of the profile and its use.). 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 Profile.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} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Profile setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the profile and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the profile and its use. - */ - public Profile setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - /** - * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Profile setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the profile. - */ - public ResourceProfileStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the profile. - */ - public Profile setStatus(ResourceProfileStatus value) { - if (this.status == null) - this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public Profile setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null ? false : this.experimental.getValue(); - } - - /** - * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public Profile setExperimental(boolean value) { - if (value == false) - this.experimental = null; - else { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Profile setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this version of the profile was published. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that this version of the profile was published. - */ - public Profile setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (The Scope and Usage that this profile was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (The Scope and Usage that this profile was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public Profile setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return The Scope and Usage that this profile was created to meet. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value The Scope and Usage that this profile was created to meet. - */ - public Profile setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public Profile setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version. - */ - public Profile setFhirVersion(String value) { - if (Utilities.noString(value)) - this.fhirVersion = null; - else { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - } - return this; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (ProfileMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - // syntactic sugar - public ProfileMappingComponent addMapping() { //3 - ProfileMappingComponent t = new ProfileMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - /** - * @return {@link #type} (The Resource or Data type being described.). 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 Profile.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 Resource or Data type being described.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Profile setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The Resource or Data type being described. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The Resource or Data type being described. - */ - public Profile setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #base} (The structure that is the base on which this set of constraints is derived from.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public UriType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.base"); - else if (Configuration.doAutoCreate()) - this.base = new UriType(); - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The structure that is the base on which this set of constraints is derived from.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public Profile setBaseElement(UriType value) { - this.base = value; - return this; - } - - /** - * @return The structure that is the base on which this set of constraints is derived from. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The structure that is the base on which this set of constraints is derived from. - */ - public Profile setBase(String value) { - if (Utilities.noString(value)) - this.base = null; - else { - if (this.base == null) - this.base = new UriType(); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.) - */ - public ConstraintComponent getSnapshot() { - if (this.snapshot == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.snapshot"); - else if (Configuration.doAutoCreate()) - this.snapshot = new ConstraintComponent(); - return this.snapshot; - } - - public boolean hasSnapshot() { - return this.snapshot != null && !this.snapshot.isEmpty(); - } - - /** - * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.) - */ - public Profile setSnapshot(ConstraintComponent value) { - this.snapshot = value; - return this; - } - - /** - * @return {@link #differential} (A differential view is expressed relative to the base profile - a statement of differences that it applies.) - */ - public ConstraintComponent getDifferential() { - if (this.differential == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Profile.differential"); - else if (Configuration.doAutoCreate()) - this.differential = new ConstraintComponent(); - return this.differential; - } - - public boolean hasDifferential() { - return this.differential != null && !this.differential.isEmpty(); - } - - /** - * @param value {@link #differential} (A differential view is expressed relative to the base profile - a statement of differences that it applies.) - */ - public Profile setDifferential(ConstraintComponent value) { - this.differential = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the Profile.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the profile.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the profile was published.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("requirements", "string", "The Scope and Usage that this profile was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); - childrenList.add(new Property("type", "code", "The Resource or Data type being described.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("base", "uri", "The structure that is the base on which this set of constraints is derived from.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.", 0, java.lang.Integer.MAX_VALUE, snapshot)); - childrenList.add(new Property("differential", "@Profile.snapshot", "A differential view is expressed relative to the base profile - a statement of differences that it applies.", 0, java.lang.Integer.MAX_VALUE, differential)); - } - - public Profile copy() { - Profile dst = new Profile(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (ProfileMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.base = base == null ? null : base.copy(); - dst.snapshot = snapshot == null ? null : snapshot.copy(); - dst.differential = differential == null ? null : differential.copy(); - return dst; - } - - protected Profile typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (description == null || description.isEmpty()) - && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (requirements == null || requirements.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) - && (mapping == null || mapping.isEmpty()) && (type == null || type.isEmpty()) && (base == null || base.isEmpty()) - && (snapshot == null || snapshot.isEmpty()) && (differential == null || differential.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Profile; - } - - @SearchParamDefinition(name="valueset", path="Profile.snapshot.element.binding.reference[x]", description="A vocabulary binding code", type="reference" ) - public static final String SP_VALUESET = "valueset"; - @SearchParamDefinition(name="status", path="Profile.status", description="The current status of the profile", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="Profile.description", description="Text search in the description of the profile", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="Profile.name", description="Name of the profile", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="code", path="Profile.code", description="A code for the profile", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="type", path="Profile.type", description="Type of resource that is constrained in the profile", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="date", path="Profile.date", description="The profile publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="Profile.identifier", description="The identifier of the profile", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="url", path="Profile.url", description="Literal URL used to reference this profile", type="token" ) - public static final String SP_URL = "url"; - @SearchParamDefinition(name="publisher", path="Profile.publisher", description="Name of the publisher of the profile", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="version", path="Profile.version", description="The version identifier of the profile", type="token" ) - public static final String SP_VERSION = "version"; - -} - + +/* + 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; +/** + * A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions. + */ +@ResourceDef(name="Profile", profile="http://hl7.org/fhir/Profile/Profile") +public class Profile extends DomainResource { + + public enum ResourceProfileStatus implements FhirEnum { + /** + * This profile is still under development. + */ + DRAFT, + /** + * This profile is ready for normal use. + */ + ACTIVE, + /** + * This profile has been deprecated, withdrawn or superseded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This profile is still under development."; + case ACTIVE: return "This profile is ready for normal use."; + case RETIRED: return "This profile has been deprecated, withdrawn or superseded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class ResourceProfileStatusEnumFactory implements EnumFactory { + public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ResourceProfileStatus.DRAFT; + if ("active".equals(codeString)) + return ResourceProfileStatus.ACTIVE; + if ("retired".equals(codeString)) + return ResourceProfileStatus.RETIRED; + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); + } + public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { + if (code == ResourceProfileStatus.DRAFT) + return "draft"; + if (code == ResourceProfileStatus.ACTIVE) + return "active"; + if (code == ResourceProfileStatus.RETIRED) + return "retired"; + return "?"; + } + } + + @Block() + public static class ProfileMappingComponent extends BackboneElement { + /** + * An Internal id that is used to identify this mapping set when specific mappings are made. + */ + @Child(name="identity", type={IdType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) + protected IdType identity; + + /** + * A URI that identifies the specification that this mapping is expressed to. + */ + @Child(name="uri", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="A URI that identifies the specification that this mapping is expressed to." ) + protected UriType uri; + + /** + * A name for the specification that is being mapped to. + */ + @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=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; + + private static final long serialVersionUID = 299630820L; + + public ProfileMappingComponent() { + super(); + } + + public ProfileMappingComponent(IdType identity) { + super(); + this.identity = identity; + } + + /** + * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public IdType getIdentityElement() { + if (this.identity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfileMappingComponent.identity"); + else if (Configuration.doAutoCreate()) + this.identity = new IdType(); + return this.identity; + } + + public boolean hasIdentityElement() { + return this.identity != null && !this.identity.isEmpty(); + } + + public boolean hasIdentity() { + return this.identity != null && !this.identity.isEmpty(); + } + + /** + * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value + */ + public ProfileMappingComponent setIdentityElement(IdType value) { + this.identity = value; + return this; + } + + /** + * @return An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public String getIdentity() { + return this.identity == null ? null : this.identity.getValue(); + } + + /** + * @param value An Internal id that is used to identify this mapping set when specific mappings are made. + */ + public ProfileMappingComponent setIdentity(String value) { + if (this.identity == null) + this.identity = new IdType(); + this.identity.setValue(value); + return this; + } + + /** + * @return {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public UriType getUriElement() { + if (this.uri == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfileMappingComponent.uri"); + else if (Configuration.doAutoCreate()) + this.uri = new UriType(); + return this.uri; + } + + public boolean hasUriElement() { + return this.uri != null && !this.uri.isEmpty(); + } + + public boolean hasUri() { + return this.uri != null && !this.uri.isEmpty(); + } + + /** + * @param value {@link #uri} (A URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value + */ + public ProfileMappingComponent setUriElement(UriType value) { + this.uri = value; + return this; + } + + /** + * @return A URI that identifies the specification that this mapping is expressed to. + */ + public String getUri() { + return this.uri == null ? null : this.uri.getValue(); + } + + /** + * @param value A URI that identifies the specification that this mapping is expressed to. + */ + public ProfileMappingComponent setUri(String value) { + if (Utilities.noString(value)) + this.uri = null; + else { + if (this.uri == null) + this.uri = new UriType(); + this.uri.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 + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfileMappingComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (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 + */ + public ProfileMappingComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A name for the specification that is being mapped to. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A name for the specification that is being mapped to. + */ + public ProfileMappingComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public StringType getCommentsElement() { + if (this.comments == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfileMappingComponent.comments"); + else if (Configuration.doAutoCreate()) + this.comments = new StringType(); + return this.comments; + } + + public boolean hasCommentsElement() { + return this.comments != null && !this.comments.isEmpty(); + } + + public boolean hasComments() { + return this.comments != null && !this.comments.isEmpty(); + } + + /** + * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value + */ + public ProfileMappingComponent setCommentsElement(StringType value) { + this.comments = value; + return this; + } + + /** + * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public String getComments() { + return this.comments == null ? null : this.comments.getValue(); + } + + /** + * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + */ + public ProfileMappingComponent setComments(String value) { + if (Utilities.noString(value)) + this.comments = null; + else { + if (this.comments == null) + this.comments = new StringType(); + this.comments.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); + 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("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)); + } + + public ProfileMappingComponent copy() { + ProfileMappingComponent dst = new ProfileMappingComponent(); + copyValues(dst); + dst.identity = identity == null ? null : identity.copy(); + dst.uri = uri == null ? null : uri.copy(); + dst.name = name == null ? null : name.copy(); + dst.comments = comments == null ? null : comments.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); + } + + } + + @Block() + public static class ConstraintComponent extends BackboneElement { + /** + * Captures constraints on each element within the resource. + */ + @Child(name="element", type={ElementDefinition.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Definition of elements in the resource (if no profile)", formalDefinition="Captures constraints on each element within the resource." ) + protected List element; + + private static final long serialVersionUID = 53896641L; + + public ConstraintComponent() { + super(); + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + public List getElement() { + if (this.element == null) + this.element = new ArrayList(); + return this.element; + } + + public boolean hasElement() { + if (this.element == null) + return false; + for (ElementDefinition item : this.element) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #element} (Captures constraints on each element within the resource.) + */ + // syntactic sugar + public ElementDefinition addElement() { //3 + ElementDefinition t = new ElementDefinition(); + if (this.element == null) + this.element = new ArrayList(); + this.element.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); + } + + public ConstraintComponent copy() { + ConstraintComponent dst = new ConstraintComponent(); + copyValues(dst); + if (element != null) { + dst.element = new ArrayList(); + for (ElementDefinition i : element) + dst.element.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (element == null || element.isEmpty()); + } + + } + + /** + * The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems. + */ + @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Literal URL used to reference this profile", formalDefinition="The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems." ) + protected UriType url; + + /** + * Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Other identifiers for the profile", formalDefinition="Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) + protected List identifier; + + /** + * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually. + */ + @Child(name="version", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the profile", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually." ) + protected StringType version; + + /** + * A free text natural language name identifying the Profile. + */ + @Child(name="name", type={StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Informal name for this profile", formalDefinition="A free text natural language name identifying the Profile." ) + protected StringType name; + + /** + * Details of the individual or organization who accepts responsibility for publishing the profile. + */ + @Child(name="publisher", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the profile." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A free text natural language description of the profile and its use. + */ + @Child(name="description", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Natural language description of the profile", formalDefinition="A free text natural language description of the profile and its use." ) + protected StringType description; + + /** + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + */ + @Child(name="code", type={Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) + protected List code; + + /** + * The status of the profile. + */ + @Child(name="status", type={CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) + protected Enumeration status; + + /** + * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name="experimental", type={BooleanType.class}, order=8, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * The date that this version of the profile was published. + */ + @Child(name="date", type={DateTimeType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Date for this version of the profile", formalDefinition="The date that this version of the profile was published." ) + protected DateTimeType date; + + /** + * The Scope and Usage that this profile was created to meet. + */ + @Child(name="requirements", type={StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Scope and Usage this profile is for", formalDefinition="The Scope and Usage that this profile was created to meet." ) + protected StringType requirements; + + /** + * The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version. + */ + @Child(name="fhirVersion", type={IdType.class}, order=11, min=0, max=1) + @Description(shortDefinition="FHIR Version this profile targets", formalDefinition="The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version." ) + protected IdType fhirVersion; + + /** + * An external specification that the content is mapped to. + */ + @Child(name="mapping", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) + protected List mapping; + + /** + * The Resource or Data type being described. + */ + @Child(name="type", type={CodeType.class}, order=13, min=1, max=1) + @Description(shortDefinition="The Resource or Data Type being described", formalDefinition="The Resource or Data type being described." ) + protected CodeType type; + + /** + * The structure that is the base on which this set of constraints is derived from. + */ + @Child(name="base", type={UriType.class}, order=14, min=0, max=1) + @Description(shortDefinition="Structure that this set of constraints applies to", formalDefinition="The structure that is the base on which this set of constraints is derived from." ) + protected UriType base; + + /** + * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile. + */ + @Child(name="snapshot", type={}, order=15, min=0, max=1) + @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile." ) + protected ConstraintComponent snapshot; + + /** + * A differential view is expressed relative to the base profile - a statement of differences that it applies. + */ + @Child(name="differential", type={ConstraintComponent.class}, order=16, min=0, max=1) + @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base profile - a statement of differences that it applies." ) + protected ConstraintComponent differential; + + private static final long serialVersionUID = -1737882057L; + + public Profile() { + super(); + } + + public Profile(UriType url, StringType name, Enumeration status, CodeType type) { + super(); + this.url = url; + this.name = name; + this.status = status; + this.type = type; + } + + /** + * @return {@link #url} (The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public Profile setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems. + */ + public Profile setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Profile setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually. + */ + public Profile setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A free text natural language name identifying the Profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public Profile setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name identifying the Profile. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name identifying the Profile. + */ + public Profile setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Profile setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Details of the individual or organization who accepts responsibility for publishing the profile. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Details of the individual or organization who accepts responsibility for publishing the profile. + */ + public Profile setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #description} (A free text natural language description of the profile and its use.). 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 Profile.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} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Profile setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the profile and its use. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the profile and its use. + */ + public Profile setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + public List getCode() { + if (this.code == null) + this.code = new ArrayList(); + return this.code; + } + + public boolean hasCode() { + if (this.code == null) + return false; + for (Coding item : this.code) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) + */ + // syntactic sugar + public Coding addCode() { //3 + Coding t = new Coding(); + if (this.code == null) + this.code = new ArrayList(); + this.code.add(t); + return t; + } + + /** + * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Profile setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the profile. + */ + public ResourceProfileStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the profile. + */ + public Profile setStatus(ResourceProfileStatus value) { + if (this.status == null) + this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public Profile setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null ? false : this.experimental.getValue(); + } + + /** + * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public Profile setExperimental(boolean value) { + if (value == false) + this.experimental = null; + else { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this version of the profile was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Profile setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this version of the profile was published. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that this version of the profile was published. + */ + public Profile setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #requirements} (The Scope and Usage that this profile was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (The Scope and Usage that this profile was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public Profile setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return The Scope and Usage that this profile was created to meet. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value The Scope and Usage that this profile was created to meet. + */ + public Profile setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #fhirVersion} (The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public IdType getFhirVersionElement() { + if (this.fhirVersion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.fhirVersion"); + else if (Configuration.doAutoCreate()) + this.fhirVersion = new IdType(); + return this.fhirVersion; + } + + public boolean hasFhirVersionElement() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + public boolean hasFhirVersion() { + return this.fhirVersion != null && !this.fhirVersion.isEmpty(); + } + + /** + * @param value {@link #fhirVersion} (The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value + */ + public Profile setFhirVersionElement(IdType value) { + this.fhirVersion = value; + return this; + } + + /** + * @return The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version. + */ + public String getFhirVersion() { + return this.fhirVersion == null ? null : this.fhirVersion.getValue(); + } + + /** + * @param value The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version. + */ + public Profile setFhirVersion(String value) { + if (Utilities.noString(value)) + this.fhirVersion = null; + else { + if (this.fhirVersion == null) + this.fhirVersion = new IdType(); + this.fhirVersion.setValue(value); + } + return this; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + public List getMapping() { + if (this.mapping == null) + this.mapping = new ArrayList(); + return this.mapping; + } + + public boolean hasMapping() { + if (this.mapping == null) + return false; + for (ProfileMappingComponent item : this.mapping) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #mapping} (An external specification that the content is mapped to.) + */ + // syntactic sugar + public ProfileMappingComponent addMapping() { //3 + ProfileMappingComponent t = new ProfileMappingComponent(); + if (this.mapping == null) + this.mapping = new ArrayList(); + this.mapping.add(t); + return t; + } + + /** + * @return {@link #type} (The Resource or Data type being described.). 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 Profile.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 Resource or Data type being described.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Profile setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The Resource or Data type being described. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The Resource or Data type being described. + */ + public Profile setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #base} (The structure that is the base on which this set of constraints is derived from.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public UriType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.base"); + else if (Configuration.doAutoCreate()) + this.base = new UriType(); + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The structure that is the base on which this set of constraints is derived from.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public Profile setBaseElement(UriType value) { + this.base = value; + return this; + } + + /** + * @return The structure that is the base on which this set of constraints is derived from. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The structure that is the base on which this set of constraints is derived from. + */ + public Profile setBase(String value) { + if (Utilities.noString(value)) + this.base = null; + else { + if (this.base == null) + this.base = new UriType(); + this.base.setValue(value); + } + return this; + } + + /** + * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.) + */ + public ConstraintComponent getSnapshot() { + if (this.snapshot == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.snapshot"); + else if (Configuration.doAutoCreate()) + this.snapshot = new ConstraintComponent(); + return this.snapshot; + } + + public boolean hasSnapshot() { + return this.snapshot != null && !this.snapshot.isEmpty(); + } + + /** + * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.) + */ + public Profile setSnapshot(ConstraintComponent value) { + this.snapshot = value; + return this; + } + + /** + * @return {@link #differential} (A differential view is expressed relative to the base profile - a statement of differences that it applies.) + */ + public ConstraintComponent getDifferential() { + if (this.differential == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Profile.differential"); + else if (Configuration.doAutoCreate()) + this.differential = new ConstraintComponent(); + return this.differential; + } + + public boolean hasDifferential() { + return this.differential != null && !this.differential.isEmpty(); + } + + /** + * @param value {@link #differential} (A differential view is expressed relative to the base profile - a statement of differences that it applies.) + */ + public Profile setDifferential(ConstraintComponent value) { + this.differential = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "The URL at which this profile is (or will be) published, and which is used to reference this profile in extension urls and tag values in operational FHIR systems.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this profile when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name identifying the Profile.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the profile.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("date", "dateTime", "The date that this version of the profile was published.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("requirements", "string", "The Scope and Usage that this profile was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this profile is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.3.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); + childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); + childrenList.add(new Property("type", "code", "The Resource or Data type being described.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("base", "uri", "The structure that is the base on which this set of constraints is derived from.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base profile.", 0, java.lang.Integer.MAX_VALUE, snapshot)); + childrenList.add(new Property("differential", "@Profile.snapshot", "A differential view is expressed relative to the base profile - a statement of differences that it applies.", 0, java.lang.Integer.MAX_VALUE, differential)); + } + + public Profile copy() { + Profile dst = new Profile(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + if (code != null) { + dst.code = new ArrayList(); + for (Coding i : code) + dst.code.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.date = date == null ? null : date.copy(); + dst.requirements = requirements == null ? null : requirements.copy(); + dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); + if (mapping != null) { + dst.mapping = new ArrayList(); + for (ProfileMappingComponent i : mapping) + dst.mapping.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.base = base == null ? null : base.copy(); + dst.snapshot = snapshot == null ? null : snapshot.copy(); + dst.differential = differential == null ? null : differential.copy(); + return dst; + } + + protected Profile typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (description == null || description.isEmpty()) + && (code == null || code.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (date == null || date.isEmpty()) && (requirements == null || requirements.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) + && (mapping == null || mapping.isEmpty()) && (type == null || type.isEmpty()) && (base == null || base.isEmpty()) + && (snapshot == null || snapshot.isEmpty()) && (differential == null || differential.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Profile; + } + + @SearchParamDefinition(name="valueset", path="Profile.snapshot.element.binding.reference[x]", description="A vocabulary binding code", type="reference" ) + public static final String SP_VALUESET = "valueset"; + @SearchParamDefinition(name="status", path="Profile.status", description="The current status of the profile", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="description", path="Profile.description", description="Text search in the description of the profile", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="name", path="Profile.name", description="Name of the profile", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="code", path="Profile.code", description="A code for the profile", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="type", path="Profile.type", description="Type of resource that is constrained in the profile", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="date", path="Profile.date", description="The profile publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Profile.identifier", description="The identifier of the profile", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="url", path="Profile.url", description="Literal URL used to reference this profile", type="token" ) + public static final String SP_URL = "url"; + @SearchParamDefinition(name="publisher", path="Profile.publisher", description="Name of the publisher of the profile", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="version", path="Profile.version", description="The version identifier of the profile", type="token" ) + public static final String SP_VERSION = "version"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Property.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Property.java index 58e0d95c781..e6db00e1069 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Property.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Property.java @@ -20,129 +20,129 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.util.ArrayList; -import java.util.List; - -/** - * A child element or property defined by the FHIR specification - * This class is defined as a helper class when iterating the - * children of an element in a generic fashion - * - * At present, iteration is only based on the specification, but - * this may be changed to allow profile based expression at a - * later date - * - * note: there's no point in creating one of these classes outside this package - */ -public class Property { - - /** - * The name of the property as found in the FHIR specification - */ - private String name; - - /** - * The type of the property as specified in the FHIR specification (e.g. type|type|Reference(Name|Name) - */ - private String typeCode; - - /** - * The formal definition of the element given in the FHIR specification - */ - private String definition; - - /** - * The minimum allowed cardinality - 0 or 1 when based on the specification - */ - private int minCardinality; - - /** - * The maximum allowed cardinality - 1 or MAX_INT when based on the specification - */ - private int maxCardinality; - - /** - * The actual elements that exist on this instance - */ - public List values = new ArrayList(); - - - /** - * Internal constructor - */ - public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, Base value) { - super(); - this.name = name; - this.typeCode = typeCode; - this.definition = definition; - this.minCardinality = minCardinality; - this.maxCardinality = maxCardinality; - this.values.add(value); - } - - /** - * Internal constructor - */ - public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, List values) { - super(); - this.name = name; - this.typeCode = typeCode; - this.definition = definition; - this.minCardinality = minCardinality; - this.maxCardinality = maxCardinality; - if (values != null) - this.values.addAll(values); - } - - /** - * @return The name of this property in the FHIR Specification - */ - public String getName() { - return name; - } - - /** - * @return The stated type in the FHIR specification - */ - public String getTypeCode() { - return typeCode; - } - - /** - * @return The definition of this element in the FHIR spec - */ - public String getDefinition() { - return definition; - } - - /** - * @return the minimum cardinality for this element - */ - public int getMinCardinality() { - return minCardinality; - } - - /** - * @return the maximum cardinality for this element - */ - public int getMaxCardinality() { - return maxCardinality; - } - - /** - * @return the actual values - will only be 1 unless maximum cardinality == MAX_INT - */ - public List getValues() { - return values; - } - - public boolean hasValues() { - for (Base e : getValues()) - if (e != null) - return true; - return false; - } - - -} + +import java.util.ArrayList; +import java.util.List; + +/** + * A child element or property defined by the FHIR specification + * This class is defined as a helper class when iterating the + * children of an element in a generic fashion + * + * At present, iteration is only based on the specification, but + * this may be changed to allow profile based expression at a + * later date + * + * note: there's no point in creating one of these classes outside this package + */ +public class Property { + + /** + * The name of the property as found in the FHIR specification + */ + private String name; + + /** + * The type of the property as specified in the FHIR specification (e.g. type|type|Reference(Name|Name) + */ + private String typeCode; + + /** + * The formal definition of the element given in the FHIR specification + */ + private String definition; + + /** + * The minimum allowed cardinality - 0 or 1 when based on the specification + */ + private int minCardinality; + + /** + * The maximum allowed cardinality - 1 or MAX_INT when based on the specification + */ + private int maxCardinality; + + /** + * The actual elements that exist on this instance + */ + public List values = new ArrayList(); + + + /** + * Internal constructor + */ + public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, Base value) { + super(); + this.name = name; + this.typeCode = typeCode; + this.definition = definition; + this.minCardinality = minCardinality; + this.maxCardinality = maxCardinality; + this.values.add(value); + } + + /** + * Internal constructor + */ + public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, List values) { + super(); + this.name = name; + this.typeCode = typeCode; + this.definition = definition; + this.minCardinality = minCardinality; + this.maxCardinality = maxCardinality; + if (values != null) + this.values.addAll(values); + } + + /** + * @return The name of this property in the FHIR Specification + */ + public String getName() { + return name; + } + + /** + * @return The stated type in the FHIR specification + */ + public String getTypeCode() { + return typeCode; + } + + /** + * @return The definition of this element in the FHIR spec + */ + public String getDefinition() { + return definition; + } + + /** + * @return the minimum cardinality for this element + */ + public int getMinCardinality() { + return minCardinality; + } + + /** + * @return the maximum cardinality for this element + */ + public int getMaxCardinality() { + return maxCardinality; + } + + /** + * @return the actual values - will only be 1 unless maximum cardinality == MAX_INT + */ + public List getValues() { + return values; + } + + public boolean hasValues() { + for (Base e : getValues()) + if (e != null) + return true; + return false; + } + + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java index 2c66de5c08e..65c04e0c6ef 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java @@ -20,1128 +20,1128 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance. - */ -@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") -public class Provenance extends DomainResource { - - public enum ProvenanceEntityRole implements FhirEnum { - /** - * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity. - */ - DERIVATION, - /** - * A derivation for which the resulting entity is a revised version of some original. - */ - REVISION, - /** - * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author. - */ - QUOTATION, - /** - * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. - */ - SOURCE, - /** - * added to help the parsers - */ - NULL; - - public static final ProvenanceEntityRoleEnumFactory ENUM_FACTORY = new ProvenanceEntityRoleEnumFactory(); - - public static ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return DERIVATION; - if ("revision".equals(codeString)) - return REVISION; - if ("quotation".equals(codeString)) - return QUOTATION; - if ("source".equals(codeString)) - return SOURCE; - throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DERIVATION: return "derivation"; - case REVISION: return "revision"; - case QUOTATION: return "quotation"; - case SOURCE: return "source"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DERIVATION: return ""; - case REVISION: return ""; - case QUOTATION: return ""; - case SOURCE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DERIVATION: return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity."; - case REVISION: return "A derivation for which the resulting entity is a revised version of some original."; - case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author."; - case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DERIVATION: return "derivation"; - case REVISION: return "revision"; - case QUOTATION: return "quotation"; - case SOURCE: return "source"; - default: return "?"; - } - } - } - - public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { - public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return ProvenanceEntityRole.DERIVATION; - if ("revision".equals(codeString)) - return ProvenanceEntityRole.REVISION; - if ("quotation".equals(codeString)) - return ProvenanceEntityRole.QUOTATION; - if ("source".equals(codeString)) - return ProvenanceEntityRole.SOURCE; - throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - public String toCode(ProvenanceEntityRole code) throws IllegalArgumentException { - if (code == ProvenanceEntityRole.DERIVATION) - return "derivation"; - if (code == ProvenanceEntityRole.REVISION) - return "revision"; - if (code == ProvenanceEntityRole.QUOTATION) - return "quotation"; - if (code == ProvenanceEntityRole.SOURCE) - return "source"; - return "?"; - } - } - - @Block() - public static class ProvenanceAgentComponent extends BackboneElement { - /** - * The role that the participant played. - */ - @Child(name="role", type={Coding.class}, order=1, min=1, max=1) - @Description(shortDefinition="e.g. author | overseer | enterer | attester | source | cc: +", formalDefinition="The role that the participant played." ) - protected Coding role; - - /** - * The type of the participant. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="e.g. Resource | Person | Application | Record | Document +", formalDefinition="The type of the participant." ) - protected Coding type; - - /** - * Identity of participant. May be a logical or physical uri and maybe absolute or relative. - */ - @Child(name="reference", type={UriType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Identity of agent (urn or url)", formalDefinition="Identity of participant. May be a logical or physical uri and maybe absolute or relative." ) - protected UriType reference; - - /** - * Human-readable description of the participant. - */ - @Child(name="display", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human description of participant", formalDefinition="Human-readable description of the participant." ) - protected StringType display; - - private static final long serialVersionUID = 14713896L; - - public ProvenanceAgentComponent() { - super(); - } - - public ProvenanceAgentComponent(Coding role, Coding type, UriType reference) { - super(); - this.role = role; - this.type = type; - this.reference = reference; - } - - /** - * @return {@link #role} (The role that the participant played.) - */ - public Coding getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Coding(); - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (The role that the participant played.) - */ - public ProvenanceAgentComponent setRole(Coding value) { - this.role = value; - return this; - } - - /** - * @return {@link #type} (The type of the participant.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the participant.) - */ - public ProvenanceAgentComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProvenanceAgentComponent setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return Identity of participant. May be a logical or physical uri and maybe absolute or relative. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value Identity of participant. May be a logical or physical uri and maybe absolute or relative. - */ - public ProvenanceAgentComponent setReference(String value) { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - return this; - } - - /** - * @return {@link #display} (Human-readable description of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Human-readable description of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ProvenanceAgentComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Human-readable description of the participant. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Human-readable description of the participant. - */ - public ProvenanceAgentComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "Coding", "The role that the participant played.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("type", "Coding", "The type of the participant.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reference", "uri", "Identity of participant. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Human-readable description of the participant.", 0, java.lang.Integer.MAX_VALUE, display)); - } - - public ProvenanceAgentComponent copy() { - ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.type = type == null ? null : type.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) - && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()); - } - - } - - @Block() - public static class ProvenanceEntityComponent extends BackboneElement { - /** - * How the entity was used during the activity. - */ - @Child(name="role", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="derivation | revision | quotation | source", formalDefinition="How the entity was used during the activity." ) - protected Enumeration role; - - /** - * The type of the entity. If the entity is a resource, then this is a resource type. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Resource Type, or something else", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) - protected Coding type; - - /** - * Identity of participant. May be a logical or physical uri and maybe absolute or relative. - */ - @Child(name="reference", type={UriType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Identity of participant (urn or url)", formalDefinition="Identity of participant. May be a logical or physical uri and maybe absolute or relative." ) - protected UriType reference; - - /** - * Human-readable description of the entity. - */ - @Child(name="display", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Human description of participant", formalDefinition="Human-readable description of the entity." ) - protected StringType display; - - /** - * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. - */ - @Child(name="agent", type={ProvenanceAgentComponent.class}, order=5, min=0, max=1) - @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." ) - protected ProvenanceAgentComponent agent; - - private static final long serialVersionUID = 1533729633L; - - public ProvenanceEntityComponent() { - super(); - } - - public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { - super(); - this.role = role; - this.type = type; - this.reference = reference; - } - - /** - * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public Enumeration getRoleElement() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Enumeration(); - return this.role; - } - - public boolean hasRoleElement() { - return this.role != null && !this.role.isEmpty(); - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public ProvenanceEntityComponent setRoleElement(Enumeration value) { - this.role = value; - return this; - } - - /** - * @return How the entity was used during the activity. - */ - public ProvenanceEntityRole getRole() { - return this.role == null ? null : this.role.getValue(); - } - - /** - * @param value How the entity was used during the activity. - */ - public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { - if (this.role == null) - this.role = new Enumeration(ProvenanceEntityRole.ENUM_FACTORY); - this.role.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public ProvenanceEntityComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProvenanceEntityComponent setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return Identity of participant. May be a logical or physical uri and maybe absolute or relative. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value Identity of participant. May be a logical or physical uri and maybe absolute or relative. - */ - public ProvenanceEntityComponent setReference(String value) { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - return this; - } - - /** - * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ProvenanceEntityComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Human-readable description of the entity. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Human-readable description of the entity. - */ - public ProvenanceEntityComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) - */ - public ProvenanceAgentComponent getAgent() { - if (this.agent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent"); - else if (Configuration.doAutoCreate()) - this.agent = new ProvenanceAgentComponent(); - return this.agent; - } - - public boolean hasAgent() { - return this.agent != null && !this.agent.isEmpty(); - } - - /** - * @param value {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) - */ - public ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { - this.agent = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reference", "uri", "Identity of participant. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent)); - } - - public ProvenanceEntityComponent copy() { - ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.type = type == null ? null : type.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - dst.agent = agent == null ? null : agent.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) - && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty()) - ; - } - - } - - /** - * The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. - */ - @Child(name="target", type={}, order=-1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." ) - protected List target; - /** - * The actual objects that are the target of the reference (The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - protected List targetTarget; - - - /** - * The period during which the activity occurred. - */ - @Child(name="period", type={Period.class}, order=0, min=0, max=1) - @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) - protected Period period; - - /** - * The instant of time at which the activity was recorded. - */ - @Child(name="recorded", type={InstantType.class}, order=1, min=1, max=1) - @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." ) - protected InstantType recorded; - - /** - * The reason that the activity was taking place. - */ - @Child(name="reason", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) - protected CodeableConcept reason; - - /** - * Where the activity occurred, if relevant. - */ - @Child(name="location", type={Location.class}, order=3, min=0, max=1) - @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Where the activity occurred, if relevant.) - */ - protected Location locationTarget; - - /** - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - */ - @Child(name="policy", type={UriType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." ) - protected List policy; - - /** - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility. - */ - @Child(name="agent", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Person, organization, records, etc. involved in creating resource", formalDefinition="An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility." ) - protected List agent; - - /** - * An entity used in this activity. - */ - @Child(name="entity", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) - protected List entity; - - /** - * A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. - */ - @Child(name="integritySignature", type={StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Base64 signature (DigSig) - integrity check", formalDefinition="A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation." ) - protected StringType integritySignature; - - private static final long serialVersionUID = 1908377639L; - - public Provenance() { - super(); - } - - public Provenance(InstantType recorded) { - super(); - this.recorded = recorded; - } - - /** - * @return {@link #target} (The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (Reference item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - // syntactic sugar - public Reference addTarget() { //3 - Reference t = new Reference(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @return {@link #target} (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 Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) - */ - public List getTargetTarget() { - if (this.targetTarget == null) - this.targetTarget = new ArrayList(); - return this.targetTarget; - } - - /** - * @return {@link #period} (The period during which the activity occurred.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.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} (The period during which the activity occurred.) - */ - public Provenance setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public InstantType getRecordedElement() { - if (this.recorded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.recorded"); - else if (Configuration.doAutoCreate()) - this.recorded = new InstantType(); - return this.recorded; - } - - public boolean hasRecordedElement() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - public boolean hasRecorded() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - /** - * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public Provenance setRecordedElement(InstantType value) { - this.recorded = value; - return this; - } - - /** - * @return The instant of time at which the activity was recorded. - */ - public Date getRecorded() { - return this.recorded == null ? null : this.recorded.getValue(); - } - - /** - * @param value The instant of time at which the activity was recorded. - */ - public Provenance setRecorded(Date value) { - if (this.recorded == null) - this.recorded = new InstantType(); - this.recorded.setValue(value); - return this; - } - - /** - * @return {@link #reason} (The reason that the activity was taking place.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (The reason that the activity was taking place.) - */ - public Provenance setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #location} (Where the activity occurred, if relevant.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Where the activity occurred, if relevant.) - */ - public Provenance setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} 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. (Where the activity occurred, if relevant.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); - return this.locationTarget; - } - - /** - * @param value {@link #location} 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. (Where the activity occurred, if relevant.) - */ - public Provenance setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - public List getPolicy() { - if (this.policy == null) - this.policy = new ArrayList(); - return this.policy; - } - - public boolean hasPolicy() { - if (this.policy == null) - return false; - for (UriType item : this.policy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - // syntactic sugar - public UriType addPolicyElement() {//2 - UriType t = new UriType(); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return t; - } - - /** - * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - public Provenance addPolicy(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return this; - } - - /** - * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) - */ - public boolean hasPolicy(String value) { - if (this.policy == null) - return false; - for (UriType v : this.policy) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.) - */ - public List getAgent() { - if (this.agent == null) - this.agent = new ArrayList(); - return this.agent; - } - - public boolean hasAgent() { - if (this.agent == null) - return false; - for (ProvenanceAgentComponent item : this.agent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.) - */ - // syntactic sugar - public ProvenanceAgentComponent addAgent() { //3 - ProvenanceAgentComponent t = new ProvenanceAgentComponent(); - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return t; - } - - /** - * @return {@link #entity} (An entity used in this activity.) - */ - public List getEntity() { - if (this.entity == null) - this.entity = new ArrayList(); - return this.entity; - } - - public boolean hasEntity() { - if (this.entity == null) - return false; - for (ProvenanceEntityComponent item : this.entity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entity} (An entity used in this activity.) - */ - // syntactic sugar - public ProvenanceEntityComponent addEntity() { //3 - ProvenanceEntityComponent t = new ProvenanceEntityComponent(); - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return t; - } - - /** - * @return {@link #integritySignature} (A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.). This is the underlying object with id, value and extensions. The accessor "getIntegritySignature" gives direct access to the value - */ - public StringType getIntegritySignatureElement() { - if (this.integritySignature == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.integritySignature"); - else if (Configuration.doAutoCreate()) - this.integritySignature = new StringType(); - return this.integritySignature; - } - - public boolean hasIntegritySignatureElement() { - return this.integritySignature != null && !this.integritySignature.isEmpty(); - } - - public boolean hasIntegritySignature() { - return this.integritySignature != null && !this.integritySignature.isEmpty(); - } - - /** - * @param value {@link #integritySignature} (A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.). This is the underlying object with id, value and extensions. The accessor "getIntegritySignature" gives direct access to the value - */ - public Provenance setIntegritySignatureElement(StringType value) { - this.integritySignature = value; - return this; - } - - /** - * @return A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. - */ - public String getIntegritySignature() { - return this.integritySignature == null ? null : this.integritySignature.getValue(); - } - - /** - * @param value A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. - */ - public Provenance setIntegritySignature(String value) { - if (Utilities.noString(value)) - this.integritySignature = null; - else { - if (this.integritySignature == null) - this.integritySignature = new StringType(); - this.integritySignature.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("policy", "uri", "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 0, java.lang.Integer.MAX_VALUE, policy)); - childrenList.add(new Property("agent", "", "An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.", 0, java.lang.Integer.MAX_VALUE, agent)); - childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("integritySignature", "string", "A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.", 0, java.lang.Integer.MAX_VALUE, integritySignature)); - } - - public Provenance copy() { - Provenance dst = new Provenance(); - copyValues(dst); - if (target != null) { - dst.target = new ArrayList(); - for (Reference i : target) - dst.target.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.recorded = recorded == null ? null : recorded.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.location = location == null ? null : location.copy(); - if (policy != null) { - dst.policy = new ArrayList(); - for (UriType i : policy) - dst.policy.add(i.copy()); - }; - if (agent != null) { - dst.agent = new ArrayList(); - for (ProvenanceAgentComponent i : agent) - dst.agent.add(i.copy()); - }; - if (entity != null) { - dst.entity = new ArrayList(); - for (ProvenanceEntityComponent i : entity) - dst.entity.add(i.copy()); - }; - dst.integritySignature = integritySignature == null ? null : integritySignature.copy(); - return dst; - } - - protected Provenance typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty()) - && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (location == null || location.isEmpty()) - && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty()) && (entity == null || entity.isEmpty()) - && (integritySignature == null || integritySignature.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Provenance; - } - - @SearchParamDefinition(name="patient", path="", description="A patient that the target resource(s) refer to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" ) - public static final String SP_LOCATION = "location"; - @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" ) - public static final String SP_START = "start"; - @SearchParamDefinition(name="partytype", path="Provenance.agent.type", description="e.g. Resource | Person | Application | Record | Document +", type="token" ) - public static final String SP_PARTYTYPE = "partytype"; - @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="party", path="Provenance.agent.reference", description="Identity of agent (urn or url)", type="token" ) - public static final String SP_PARTY = "party"; - @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" ) - public static final String SP_END = "end"; - -} - + +/* + 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; +/** + * Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance. + */ +@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") +public class Provenance extends DomainResource { + + public enum ProvenanceEntityRole implements FhirEnum { + /** + * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity. + */ + DERIVATION, + /** + * A derivation for which the resulting entity is a revised version of some original. + */ + REVISION, + /** + * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author. + */ + QUOTATION, + /** + * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. + */ + SOURCE, + /** + * added to help the parsers + */ + NULL; + + public static final ProvenanceEntityRoleEnumFactory ENUM_FACTORY = new ProvenanceEntityRoleEnumFactory(); + + public static ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("derivation".equals(codeString)) + return DERIVATION; + if ("revision".equals(codeString)) + return REVISION; + if ("quotation".equals(codeString)) + return QUOTATION; + if ("source".equals(codeString)) + return SOURCE; + throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DERIVATION: return "derivation"; + case REVISION: return "revision"; + case QUOTATION: return "quotation"; + case SOURCE: return "source"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DERIVATION: return ""; + case REVISION: return ""; + case QUOTATION: return ""; + case SOURCE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DERIVATION: return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity."; + case REVISION: return "A derivation for which the resulting entity is a revised version of some original."; + case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author."; + case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DERIVATION: return "derivation"; + case REVISION: return "revision"; + case QUOTATION: return "quotation"; + case SOURCE: return "source"; + default: return "?"; + } + } + } + + public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { + public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("derivation".equals(codeString)) + return ProvenanceEntityRole.DERIVATION; + if ("revision".equals(codeString)) + return ProvenanceEntityRole.REVISION; + if ("quotation".equals(codeString)) + return ProvenanceEntityRole.QUOTATION; + if ("source".equals(codeString)) + return ProvenanceEntityRole.SOURCE; + throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); + } + public String toCode(ProvenanceEntityRole code) throws IllegalArgumentException { + if (code == ProvenanceEntityRole.DERIVATION) + return "derivation"; + if (code == ProvenanceEntityRole.REVISION) + return "revision"; + if (code == ProvenanceEntityRole.QUOTATION) + return "quotation"; + if (code == ProvenanceEntityRole.SOURCE) + return "source"; + return "?"; + } + } + + @Block() + public static class ProvenanceAgentComponent extends BackboneElement { + /** + * The role that the participant played. + */ + @Child(name="role", type={Coding.class}, order=1, min=1, max=1) + @Description(shortDefinition="e.g. author | overseer | enterer | attester | source | cc: +", formalDefinition="The role that the participant played." ) + protected Coding role; + + /** + * The type of the participant. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="e.g. Resource | Person | Application | Record | Document +", formalDefinition="The type of the participant." ) + protected Coding type; + + /** + * Identity of participant. May be a logical or physical uri and maybe absolute or relative. + */ + @Child(name="reference", type={UriType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Identity of agent (urn or url)", formalDefinition="Identity of participant. May be a logical or physical uri and maybe absolute or relative." ) + protected UriType reference; + + /** + * Human-readable description of the participant. + */ + @Child(name="display", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human description of participant", formalDefinition="Human-readable description of the participant." ) + protected StringType display; + + private static final long serialVersionUID = 14713896L; + + public ProvenanceAgentComponent() { + super(); + } + + public ProvenanceAgentComponent(Coding role, Coding type, UriType reference) { + super(); + this.role = role; + this.type = type; + this.reference = reference; + } + + /** + * @return {@link #role} (The role that the participant played.) + */ + public Coding getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Coding(); + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (The role that the participant played.) + */ + public ProvenanceAgentComponent setRole(Coding value) { + this.role = value; + return this; + } + + /** + * @return {@link #type} (The type of the participant.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the participant.) + */ + public ProvenanceAgentComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProvenanceAgentComponent setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return Identity of participant. May be a logical or physical uri and maybe absolute or relative. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value Identity of participant. May be a logical or physical uri and maybe absolute or relative. + */ + public ProvenanceAgentComponent setReference(String value) { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + return this; + } + + /** + * @return {@link #display} (Human-readable description of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceAgentComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Human-readable description of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ProvenanceAgentComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Human-readable description of the participant. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Human-readable description of the participant. + */ + public ProvenanceAgentComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "Coding", "The role that the participant played.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("type", "Coding", "The type of the participant.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reference", "uri", "Identity of participant. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Human-readable description of the participant.", 0, java.lang.Integer.MAX_VALUE, display)); + } + + public ProvenanceAgentComponent copy() { + ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.type = type == null ? null : type.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) + && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()); + } + + } + + @Block() + public static class ProvenanceEntityComponent extends BackboneElement { + /** + * How the entity was used during the activity. + */ + @Child(name="role", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="derivation | revision | quotation | source", formalDefinition="How the entity was used during the activity." ) + protected Enumeration role; + + /** + * The type of the entity. If the entity is a resource, then this is a resource type. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Resource Type, or something else", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) + protected Coding type; + + /** + * Identity of participant. May be a logical or physical uri and maybe absolute or relative. + */ + @Child(name="reference", type={UriType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Identity of participant (urn or url)", formalDefinition="Identity of participant. May be a logical or physical uri and maybe absolute or relative." ) + protected UriType reference; + + /** + * Human-readable description of the entity. + */ + @Child(name="display", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Human description of participant", formalDefinition="Human-readable description of the entity." ) + protected StringType display; + + /** + * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. + */ + @Child(name="agent", type={ProvenanceAgentComponent.class}, order=5, min=0, max=1) + @Description(shortDefinition="Entity is attributed to this agent", formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity." ) + protected ProvenanceAgentComponent agent; + + private static final long serialVersionUID = 1533729633L; + + public ProvenanceEntityComponent() { + super(); + } + + public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { + super(); + this.role = role; + this.type = type; + this.reference = reference; + } + + /** + * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public Enumeration getRoleElement() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Enumeration(); + return this.role; + } + + public boolean hasRoleElement() { + return this.role != null && !this.role.isEmpty(); + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public ProvenanceEntityComponent setRoleElement(Enumeration value) { + this.role = value; + return this; + } + + /** + * @return How the entity was used during the activity. + */ + public ProvenanceEntityRole getRole() { + return this.role == null ? null : this.role.getValue(); + } + + /** + * @param value How the entity was used during the activity. + */ + public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { + if (this.role == null) + this.role = new Enumeration(ProvenanceEntityRole.ENUM_FACTORY); + this.role.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) + */ + public ProvenanceEntityComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public UriType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new UriType(); + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identity of participant. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public ProvenanceEntityComponent setReferenceElement(UriType value) { + this.reference = value; + return this; + } + + /** + * @return Identity of participant. May be a logical or physical uri and maybe absolute or relative. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value Identity of participant. May be a logical or physical uri and maybe absolute or relative. + */ + public ProvenanceEntityComponent setReference(String value) { + if (this.reference == null) + this.reference = new UriType(); + this.reference.setValue(value); + return this; + } + + /** + * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ProvenanceEntityComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Human-readable description of the entity. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Human-readable description of the entity. + */ + public ProvenanceEntityComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) + */ + public ProvenanceAgentComponent getAgent() { + if (this.agent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent"); + else if (Configuration.doAutoCreate()) + this.agent = new ProvenanceAgentComponent(); + return this.agent; + } + + public boolean hasAgent() { + return this.agent != null && !this.agent.isEmpty(); + } + + /** + * @param value {@link #agent} (The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.) + */ + public ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { + this.agent = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("reference", "uri", "Identity of participant. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("agent", "@Provenance.agent", "The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.", 0, java.lang.Integer.MAX_VALUE, agent)); + } + + public ProvenanceEntityComponent copy() { + ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.type = type == null ? null : type.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + dst.agent = agent == null ? null : agent.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) + && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty()) + ; + } + + } + + /** + * The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. + */ + @Child(name="target", type={}, order=-1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity." ) + protected List target; + /** + * The actual objects that are the target of the reference (The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + protected List targetTarget; + + + /** + * The period during which the activity occurred. + */ + @Child(name="period", type={Period.class}, order=0, min=0, max=1) + @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) + protected Period period; + + /** + * The instant of time at which the activity was recorded. + */ + @Child(name="recorded", type={InstantType.class}, order=1, min=1, max=1) + @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." ) + protected InstantType recorded; + + /** + * The reason that the activity was taking place. + */ + @Child(name="reason", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) + protected CodeableConcept reason; + + /** + * Where the activity occurred, if relevant. + */ + @Child(name="location", type={Location.class}, order=3, min=0, max=1) + @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Where the activity occurred, if relevant.) + */ + protected Location locationTarget; + + /** + * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. + */ + @Child(name="policy", type={UriType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Policy or plan the activity was defined by", formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." ) + protected List policy; + + /** + * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility. + */ + @Child(name="agent", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Person, organization, records, etc. involved in creating resource", formalDefinition="An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility." ) + protected List agent; + + /** + * An entity used in this activity. + */ + @Child(name="entity", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) + protected List entity; + + /** + * A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. + */ + @Child(name="integritySignature", type={StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Base64 signature (DigSig) - integrity check", formalDefinition="A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation." ) + protected StringType integritySignature; + + private static final long serialVersionUID = 1908377639L; + + public Provenance() { + super(); + } + + public Provenance(InstantType recorded) { + super(); + this.recorded = recorded; + } + + /** + * @return {@link #target} (The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (Reference item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + // syntactic sugar + public Reference addTarget() { //3 + Reference t = new Reference(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @return {@link #target} (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 Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.) + */ + public List getTargetTarget() { + if (this.targetTarget == null) + this.targetTarget = new ArrayList(); + return this.targetTarget; + } + + /** + * @return {@link #period} (The period during which the activity occurred.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.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} (The period during which the activity occurred.) + */ + public Provenance setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public InstantType getRecordedElement() { + if (this.recorded == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.recorded"); + else if (Configuration.doAutoCreate()) + this.recorded = new InstantType(); + return this.recorded; + } + + public boolean hasRecordedElement() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + public boolean hasRecorded() { + return this.recorded != null && !this.recorded.isEmpty(); + } + + /** + * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value + */ + public Provenance setRecordedElement(InstantType value) { + this.recorded = value; + return this; + } + + /** + * @return The instant of time at which the activity was recorded. + */ + public Date getRecorded() { + return this.recorded == null ? null : this.recorded.getValue(); + } + + /** + * @param value The instant of time at which the activity was recorded. + */ + public Provenance setRecorded(Date value) { + if (this.recorded == null) + this.recorded = new InstantType(); + this.recorded.setValue(value); + return this; + } + + /** + * @return {@link #reason} (The reason that the activity was taking place.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (The reason that the activity was taking place.) + */ + public Provenance setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #location} (Where the activity occurred, if relevant.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Where the activity occurred, if relevant.) + */ + public Provenance setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} 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. (Where the activity occurred, if relevant.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} 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. (Where the activity occurred, if relevant.) + */ + public Provenance setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public List getPolicy() { + if (this.policy == null) + this.policy = new ArrayList(); + return this.policy; + } + + public boolean hasPolicy() { + if (this.policy == null) + return false; + for (UriType item : this.policy) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + // syntactic sugar + public UriType addPolicyElement() {//2 + UriType t = new UriType(); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return t; + } + + /** + * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public Provenance addPolicy(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.policy == null) + this.policy = new ArrayList(); + this.policy.add(t); + return this; + } + + /** + * @param value {@link #policy} (Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.) + */ + public boolean hasPolicy(String value) { + if (this.policy == null) + return false; + for (UriType v : this.policy) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.) + */ + public List getAgent() { + if (this.agent == null) + this.agent = new ArrayList(); + return this.agent; + } + + public boolean hasAgent() { + if (this.agent == null) + return false; + for (ProvenanceAgentComponent item : this.agent) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #agent} (An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.) + */ + // syntactic sugar + public ProvenanceAgentComponent addAgent() { //3 + ProvenanceAgentComponent t = new ProvenanceAgentComponent(); + if (this.agent == null) + this.agent = new ArrayList(); + this.agent.add(t); + return t; + } + + /** + * @return {@link #entity} (An entity used in this activity.) + */ + public List getEntity() { + if (this.entity == null) + this.entity = new ArrayList(); + return this.entity; + } + + public boolean hasEntity() { + if (this.entity == null) + return false; + for (ProvenanceEntityComponent item : this.entity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #entity} (An entity used in this activity.) + */ + // syntactic sugar + public ProvenanceEntityComponent addEntity() { //3 + ProvenanceEntityComponent t = new ProvenanceEntityComponent(); + if (this.entity == null) + this.entity = new ArrayList(); + this.entity.add(t); + return t; + } + + /** + * @return {@link #integritySignature} (A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.). This is the underlying object with id, value and extensions. The accessor "getIntegritySignature" gives direct access to the value + */ + public StringType getIntegritySignatureElement() { + if (this.integritySignature == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Provenance.integritySignature"); + else if (Configuration.doAutoCreate()) + this.integritySignature = new StringType(); + return this.integritySignature; + } + + public boolean hasIntegritySignatureElement() { + return this.integritySignature != null && !this.integritySignature.isEmpty(); + } + + public boolean hasIntegritySignature() { + return this.integritySignature != null && !this.integritySignature.isEmpty(); + } + + /** + * @param value {@link #integritySignature} (A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.). This is the underlying object with id, value and extensions. The accessor "getIntegritySignature" gives direct access to the value + */ + public Provenance setIntegritySignatureElement(StringType value) { + this.integritySignature = value; + return this; + } + + /** + * @return A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. + */ + public String getIntegritySignature() { + return this.integritySignature == null ? null : this.integritySignature.getValue(); + } + + /** + * @param value A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. + */ + public Provenance setIntegritySignature(String value) { + if (Utilities.noString(value)) + this.integritySignature = null; + else { + if (this.integritySignature == null) + this.integritySignature = new StringType(); + this.integritySignature.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded)); + childrenList.add(new Property("reason", "CodeableConcept", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("policy", "uri", "Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.", 0, java.lang.Integer.MAX_VALUE, policy)); + childrenList.add(new Property("agent", "", "An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility.", 0, java.lang.Integer.MAX_VALUE, agent)); + childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); + childrenList.add(new Property("integritySignature", "string", "A digital signature on the target Reference(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation.", 0, java.lang.Integer.MAX_VALUE, integritySignature)); + } + + public Provenance copy() { + Provenance dst = new Provenance(); + copyValues(dst); + if (target != null) { + dst.target = new ArrayList(); + for (Reference i : target) + dst.target.add(i.copy()); + }; + dst.period = period == null ? null : period.copy(); + dst.recorded = recorded == null ? null : recorded.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.location = location == null ? null : location.copy(); + if (policy != null) { + dst.policy = new ArrayList(); + for (UriType i : policy) + dst.policy.add(i.copy()); + }; + if (agent != null) { + dst.agent = new ArrayList(); + for (ProvenanceAgentComponent i : agent) + dst.agent.add(i.copy()); + }; + if (entity != null) { + dst.entity = new ArrayList(); + for (ProvenanceEntityComponent i : entity) + dst.entity.add(i.copy()); + }; + dst.integritySignature = integritySignature == null ? null : integritySignature.copy(); + return dst; + } + + protected Provenance typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty()) + && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (location == null || location.isEmpty()) + && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty()) && (entity == null || entity.isEmpty()) + && (integritySignature == null || integritySignature.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Provenance; + } + + @SearchParamDefinition(name="patient", path="", description="A patient that the target resource(s) refer to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" ) + public static final String SP_LOCATION = "location"; + @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" ) + public static final String SP_START = "start"; + @SearchParamDefinition(name="partytype", path="Provenance.agent.type", description="e.g. Resource | Person | Application | Record | Document +", type="token" ) + public static final String SP_PARTYTYPE = "partytype"; + @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="party", path="Provenance.agent.reference", description="Identity of agent (urn or url)", type="token" ) + public static final String SP_PARTY = "party"; + @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" ) + public static final String SP_END = "end"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java index 4f19beda3d2..5e817dbee34 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java @@ -20,471 +20,471 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Quantity") -public class Quantity extends Type implements ICompositeType{ - - public enum QuantityComparator implements FhirEnum { - /** - * The actual value is less than the given value. - */ - LESS_THAN, - /** - * The actual value is less than or equal to the given value. - */ - LESS_OR_EQUAL, - /** - * The actual value is greater than or equal to the given value. - */ - GREATER_OR_EQUAL, - /** - * The actual value is greater than the given value. - */ - GREATER_THAN, - /** - * added to help the parsers - */ - NULL; - - public static final QuantityComparatorEnumFactory ENUM_FACTORY = new QuantityComparatorEnumFactory(); - - public static QuantityComparator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return LESS_THAN; - if ("<=".equals(codeString)) - return LESS_OR_EQUAL; - if (">=".equals(codeString)) - return GREATER_OR_EQUAL; - if (">".equals(codeString)) - return GREATER_THAN; - throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case LESS_THAN: return "<"; - case LESS_OR_EQUAL: return "<="; - case GREATER_OR_EQUAL: return ">="; - case GREATER_THAN: return ">"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LESS_THAN: return ""; - case LESS_OR_EQUAL: return ""; - case GREATER_OR_EQUAL: return ""; - case GREATER_THAN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LESS_THAN: return "The actual value is less than the given value."; - case LESS_OR_EQUAL: return "The actual value is less than or equal to the given value."; - case GREATER_OR_EQUAL: return "The actual value is greater than or equal to the given value."; - case GREATER_THAN: return "The actual value is greater than the given value."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LESS_THAN: return "<"; - case LESS_OR_EQUAL: return "<="; - case GREATER_OR_EQUAL: return ">="; - case GREATER_THAN: return ">"; - default: return "?"; - } - } - } - - public static class QuantityComparatorEnumFactory implements EnumFactory { - public QuantityComparator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return QuantityComparator.LESS_THAN; - if ("<=".equals(codeString)) - return QuantityComparator.LESS_OR_EQUAL; - if (">=".equals(codeString)) - return QuantityComparator.GREATER_OR_EQUAL; - if (">".equals(codeString)) - return QuantityComparator.GREATER_THAN; - throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); - } - public String toCode(QuantityComparator code) throws IllegalArgumentException { - if (code == QuantityComparator.LESS_THAN) - return "<"; - if (code == QuantityComparator.LESS_OR_EQUAL) - return "<="; - if (code == QuantityComparator.GREATER_OR_EQUAL) - return ">="; - if (code == QuantityComparator.GREATER_THAN) - return ">"; - return "?"; - } - } - - /** - * The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - @Child(name="value", type={DecimalType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Numerical value (with implicit precision)", formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value." ) - protected DecimalType value; - - /** - * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. - */ - @Child(name="comparator", type={CodeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="< | <= | >= | > - how to understand the value", formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value." ) - protected Enumeration comparator; - - /** - * A human-readable form of the units. - */ - @Child(name="units", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Unit representation", formalDefinition="A human-readable form of the units." ) - protected StringType units; - - /** - * The identification of the system that provides the coded form of the unit. - */ - @Child(name="system", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="System that defines coded unit form", formalDefinition="The identification of the system that provides the coded form of the unit." ) - protected UriType system; - - /** - * A computer processable form of the units in some unit representation system. - */ - @Child(name="code", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Coded form of the unit", formalDefinition="A computer processable form of the units in some unit representation system." ) - protected CodeType code; - - private static final long serialVersionUID = -483422721L; - - public Quantity() { - super(); - } - - /** - * @return {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Quantity setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public Quantity setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value - */ - public Enumeration getComparatorElement() { - if (this.comparator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.comparator"); - else if (Configuration.doAutoCreate()) - this.comparator = new Enumeration(); - return this.comparator; - } - - public boolean hasComparatorElement() { - return this.comparator != null && !this.comparator.isEmpty(); - } - - public boolean hasComparator() { - return this.comparator != null && !this.comparator.isEmpty(); - } - - /** - * @param value {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value - */ - public Quantity setComparatorElement(Enumeration value) { - this.comparator = value; - return this; - } - - /** - * @return How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. - */ - public QuantityComparator getComparator() { - return this.comparator == null ? null : this.comparator.getValue(); - } - - /** - * @param value How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. - */ - public Quantity setComparator(QuantityComparator value) { - if (value == null) - this.comparator = null; - else { - if (this.comparator == null) - this.comparator = new Enumeration(QuantityComparator.ENUM_FACTORY); - this.comparator.setValue(value); - } - return this; - } - - /** - * @return {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value - */ - public StringType getUnitsElement() { - if (this.units == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.units"); - else if (Configuration.doAutoCreate()) - this.units = new StringType(); - return this.units; - } - - public boolean hasUnitsElement() { - return this.units != null && !this.units.isEmpty(); - } - - public boolean hasUnits() { - return this.units != null && !this.units.isEmpty(); - } - - /** - * @param value {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value - */ - public Quantity setUnitsElement(StringType value) { - this.units = value; - return this; - } - - /** - * @return A human-readable form of the units. - */ - public String getUnits() { - return this.units == null ? null : this.units.getValue(); - } - - /** - * @param value A human-readable form of the units. - */ - public Quantity setUnits(String value) { - if (Utilities.noString(value)) - this.units = null; - else { - if (this.units == null) - this.units = new StringType(); - this.units.setValue(value); - } - return this; - } - - /** - * @return {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Quantity setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The identification of the system that provides the coded form of the unit. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The identification of the system that provides the coded form of the unit. - */ - public Quantity setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Quantity setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A computer processable form of the units in some unit representation system. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A computer processable form of the units in some unit representation system. - */ - public Quantity setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value", "decimal", "The value of the measured amount. The value includes an implicit precision in the presentation of the value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("comparator", "code", "How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value.", 0, java.lang.Integer.MAX_VALUE, comparator)); - childrenList.add(new Property("units", "string", "A human-readable form of the units.", 0, java.lang.Integer.MAX_VALUE, units)); - childrenList.add(new Property("system", "uri", "The identification of the system that provides the coded form of the unit.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("code", "code", "A computer processable form of the units in some unit representation system.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - public Quantity copy() { - Quantity dst = new Quantity(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.units = units == null ? null : units.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Quantity typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - + +/* + 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 java.math.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + */ +@DatatypeDef(name="Quantity") +public class Quantity extends Type implements ICompositeType{ + + public enum QuantityComparator implements FhirEnum { + /** + * The actual value is less than the given value. + */ + LESS_THAN, + /** + * The actual value is less than or equal to the given value. + */ + LESS_OR_EQUAL, + /** + * The actual value is greater than or equal to the given value. + */ + GREATER_OR_EQUAL, + /** + * The actual value is greater than the given value. + */ + GREATER_THAN, + /** + * added to help the parsers + */ + NULL; + + public static final QuantityComparatorEnumFactory ENUM_FACTORY = new QuantityComparatorEnumFactory(); + + public static QuantityComparator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("<".equals(codeString)) + return LESS_THAN; + if ("<=".equals(codeString)) + return LESS_OR_EQUAL; + if (">=".equals(codeString)) + return GREATER_OR_EQUAL; + if (">".equals(codeString)) + return GREATER_THAN; + throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case LESS_THAN: return "<"; + case LESS_OR_EQUAL: return "<="; + case GREATER_OR_EQUAL: return ">="; + case GREATER_THAN: return ">"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LESS_THAN: return ""; + case LESS_OR_EQUAL: return ""; + case GREATER_OR_EQUAL: return ""; + case GREATER_THAN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LESS_THAN: return "The actual value is less than the given value."; + case LESS_OR_EQUAL: return "The actual value is less than or equal to the given value."; + case GREATER_OR_EQUAL: return "The actual value is greater than or equal to the given value."; + case GREATER_THAN: return "The actual value is greater than the given value."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LESS_THAN: return "<"; + case LESS_OR_EQUAL: return "<="; + case GREATER_OR_EQUAL: return ">="; + case GREATER_THAN: return ">"; + default: return "?"; + } + } + } + + public static class QuantityComparatorEnumFactory implements EnumFactory { + public QuantityComparator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("<".equals(codeString)) + return QuantityComparator.LESS_THAN; + if ("<=".equals(codeString)) + return QuantityComparator.LESS_OR_EQUAL; + if (">=".equals(codeString)) + return QuantityComparator.GREATER_OR_EQUAL; + if (">".equals(codeString)) + return QuantityComparator.GREATER_THAN; + throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); + } + public String toCode(QuantityComparator code) throws IllegalArgumentException { + if (code == QuantityComparator.LESS_THAN) + return "<"; + if (code == QuantityComparator.LESS_OR_EQUAL) + return "<="; + if (code == QuantityComparator.GREATER_OR_EQUAL) + return ">="; + if (code == QuantityComparator.GREATER_THAN) + return ">"; + return "?"; + } + } + + /** + * The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + @Child(name="value", type={DecimalType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Numerical value (with implicit precision)", formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value." ) + protected DecimalType value; + + /** + * How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + */ + @Child(name="comparator", type={CodeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="< | <= | >= | > - how to understand the value", formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value." ) + protected Enumeration comparator; + + /** + * A human-readable form of the units. + */ + @Child(name="units", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Unit representation", formalDefinition="A human-readable form of the units." ) + protected StringType units; + + /** + * The identification of the system that provides the coded form of the unit. + */ + @Child(name="system", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="System that defines coded unit form", formalDefinition="The identification of the system that provides the coded form of the unit." ) + protected UriType system; + + /** + * A computer processable form of the units in some unit representation system. + */ + @Child(name="code", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Coded form of the unit", formalDefinition="A computer processable form of the units in some unit representation system." ) + protected CodeType code; + + private static final long serialVersionUID = -483422721L; + + public Quantity() { + super(); + } + + /** + * @return {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public DecimalType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.value"); + else if (Configuration.doAutoCreate()) + this.value = new DecimalType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Quantity setValueElement(DecimalType value) { + this.value = value; + return this; + } + + /** + * @return The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public BigDecimal getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. + */ + public Quantity setValue(BigDecimal value) { + if (value == null) + this.value = null; + else { + if (this.value == null) + this.value = new DecimalType(); + this.value.setValue(value); + } + return this; + } + + /** + * @return {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value + */ + public Enumeration getComparatorElement() { + if (this.comparator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.comparator"); + else if (Configuration.doAutoCreate()) + this.comparator = new Enumeration(); + return this.comparator; + } + + public boolean hasComparatorElement() { + return this.comparator != null && !this.comparator.isEmpty(); + } + + public boolean hasComparator() { + return this.comparator != null && !this.comparator.isEmpty(); + } + + /** + * @param value {@link #comparator} (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value + */ + public Quantity setComparatorElement(Enumeration value) { + this.comparator = value; + return this; + } + + /** + * @return How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + */ + public QuantityComparator getComparator() { + return this.comparator == null ? null : this.comparator.getValue(); + } + + /** + * @param value How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + */ + public Quantity setComparator(QuantityComparator value) { + if (value == null) + this.comparator = null; + else { + if (this.comparator == null) + this.comparator = new Enumeration(QuantityComparator.ENUM_FACTORY); + this.comparator.setValue(value); + } + return this; + } + + /** + * @return {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value + */ + public StringType getUnitsElement() { + if (this.units == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.units"); + else if (Configuration.doAutoCreate()) + this.units = new StringType(); + return this.units; + } + + public boolean hasUnitsElement() { + return this.units != null && !this.units.isEmpty(); + } + + public boolean hasUnits() { + return this.units != null && !this.units.isEmpty(); + } + + /** + * @param value {@link #units} (A human-readable form of the units.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value + */ + public Quantity setUnitsElement(StringType value) { + this.units = value; + return this; + } + + /** + * @return A human-readable form of the units. + */ + public String getUnits() { + return this.units == null ? null : this.units.getValue(); + } + + /** + * @param value A human-readable form of the units. + */ + public Quantity setUnits(String value) { + if (Utilities.noString(value)) + this.units = null; + else { + if (this.units == null) + this.units = new StringType(); + this.units.setValue(value); + } + return this; + } + + /** + * @return {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public Quantity setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The identification of the system that provides the coded form of the unit. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The identification of the system that provides the coded form of the unit. + */ + public Quantity setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Quantity.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A computer processable form of the units in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public Quantity setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return A computer processable form of the units in some unit representation system. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value A computer processable form of the units in some unit representation system. + */ + public Quantity setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value", "decimal", "The value of the measured amount. The value includes an implicit precision in the presentation of the value.", 0, java.lang.Integer.MAX_VALUE, value)); + childrenList.add(new Property("comparator", "code", "How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is '<' , then the real value is < stated value.", 0, java.lang.Integer.MAX_VALUE, comparator)); + childrenList.add(new Property("units", "string", "A human-readable form of the units.", 0, java.lang.Integer.MAX_VALUE, units)); + childrenList.add(new Property("system", "uri", "The identification of the system that provides the coded form of the unit.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("code", "code", "A computer processable form of the units in some unit representation system.", 0, java.lang.Integer.MAX_VALUE, code)); + } + + public Quantity copy() { + Quantity dst = new Quantity(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + dst.comparator = comparator == null ? null : comparator.copy(); + dst.units = units == null ? null : units.copy(); + dst.system = system == null ? null : system.copy(); + dst.code = code == null ? null : code.copy(); + return dst; + } + + protected Quantity typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) + && (units == null || units.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java index 9739a17cb07..e598e6af5cf 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java @@ -20,1648 +20,1648 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ -@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") -public class Questionnaire extends DomainResource { - - public enum QuestionnaireStatus implements FhirEnum { - /** - * This Questionnaire is not ready for official use. - */ - DRAFT, - /** - * This Questionnaire is ready for use. - */ - PUBLISHED, - /** - * This Questionnaire should no longer be used to gather data. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - public static final QuestionnaireStatusEnumFactory ENUM_FACTORY = new QuestionnaireStatusEnumFactory(); - - public static QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("published".equals(codeString)) - return PUBLISHED; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case PUBLISHED: return "published"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case PUBLISHED: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This Questionnaire is not ready for official use."; - case PUBLISHED: return "This Questionnaire is ready for use."; - case RETIRED: return "This Questionnaire should no longer be used to gather data."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case PUBLISHED: return "published"; - case RETIRED: return "retired"; - default: return "?"; - } - } - } - - public static class QuestionnaireStatusEnumFactory implements EnumFactory { - public QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return QuestionnaireStatus.DRAFT; - if ("published".equals(codeString)) - return QuestionnaireStatus.PUBLISHED; - if ("retired".equals(codeString)) - return QuestionnaireStatus.RETIRED; - throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - public String toCode(QuestionnaireStatus code) throws IllegalArgumentException { - if (code == QuestionnaireStatus.DRAFT) - return "draft"; - if (code == QuestionnaireStatus.PUBLISHED) - return "published"; - if (code == QuestionnaireStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum AnswerFormat implements FhirEnum { - /** - * Answer is a yes/no answer. - */ - BOOLEAN, - /** - * Answer is a floating point number. - */ - DECIMAL, - /** - * Answer is an integer. - */ - INTEGER, - /** - * Answer is a date. - */ - DATE, - /** - * Answer is a date and time. - */ - DATETIME, - /** - * Answer is a system timestamp. - */ - INSTANT, - /** - * Answer is a time independent of date. - */ - TIME, - /** - * Answer is a short (few words to short sentence) free-text entry. - */ - STRING, - /** - * Answer is a long (potentially multi-paragram) free-text entry. - */ - TEXT, - /** - * Answer is a choice from a list of options. - */ - CHOICE, - /** - * Answer is a choice from a list of options or a free-text entry. - */ - OPENCHOICE, - /** - * Answer is binary content such as a image, PDF, etc. - */ - ATTACHMENT, - /** - * Answer is a reference to another resource (practitioner, organization, etc.). - */ - REFERENCE, - /** - * Answer is a combination of a numeric value and unit. - */ - QUANTITY, - /** - * added to help the parsers - */ - NULL; - - public static final AnswerFormatEnumFactory ENUM_FACTORY = new AnswerFormatEnumFactory(); - - public static AnswerFormat fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("decimal".equals(codeString)) - return DECIMAL; - if ("integer".equals(codeString)) - return INTEGER; - if ("date".equals(codeString)) - return DATE; - if ("dateTime".equals(codeString)) - return DATETIME; - if ("instant".equals(codeString)) - return INSTANT; - if ("time".equals(codeString)) - return TIME; - if ("string".equals(codeString)) - return STRING; - if ("text".equals(codeString)) - return TEXT; - if ("choice".equals(codeString)) - return CHOICE; - if ("open-choice".equals(codeString)) - return OPENCHOICE; - if ("attachment".equals(codeString)) - return ATTACHMENT; - if ("reference".equals(codeString)) - return REFERENCE; - if ("quantity".equals(codeString)) - return QUANTITY; - throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case BOOLEAN: return "boolean"; - case DECIMAL: return "decimal"; - case INTEGER: return "integer"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case INSTANT: return "instant"; - case TIME: return "time"; - case STRING: return "string"; - case TEXT: return "text"; - case CHOICE: return "choice"; - case OPENCHOICE: return "open-choice"; - case ATTACHMENT: return "attachment"; - case REFERENCE: return "reference"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BOOLEAN: return ""; - case DECIMAL: return ""; - case INTEGER: return ""; - case DATE: return ""; - case DATETIME: return ""; - case INSTANT: return ""; - case TIME: return ""; - case STRING: return ""; - case TEXT: return ""; - case CHOICE: return ""; - case OPENCHOICE: return ""; - case ATTACHMENT: return ""; - case REFERENCE: return ""; - case QUANTITY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BOOLEAN: return "Answer is a yes/no answer."; - case DECIMAL: return "Answer is a floating point number."; - case INTEGER: return "Answer is an integer."; - case DATE: return "Answer is a date."; - case DATETIME: return "Answer is a date and time."; - case INSTANT: return "Answer is a system timestamp."; - case TIME: return "Answer is a time independent of date."; - case STRING: return "Answer is a short (few words to short sentence) free-text entry."; - case TEXT: return "Answer is a long (potentially multi-paragram) free-text entry."; - case CHOICE: return "Answer is a choice from a list of options."; - case OPENCHOICE: return "Answer is a choice from a list of options or a free-text entry."; - case ATTACHMENT: return "Answer is binary content such as a image, PDF, etc."; - case REFERENCE: return "Answer is a reference to another resource (practitioner, organization, etc.)."; - case QUANTITY: return "Answer is a combination of a numeric value and unit."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BOOLEAN: return "boolean"; - case DECIMAL: return "decimal"; - case INTEGER: return "integer"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case INSTANT: return "instant"; - case TIME: return "time"; - case STRING: return "string"; - case TEXT: return "text"; - case CHOICE: return "choice"; - case OPENCHOICE: return "open-choice"; - case ATTACHMENT: return "attachment"; - case REFERENCE: return "reference"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - } - - public static class AnswerFormatEnumFactory implements EnumFactory { - public AnswerFormat fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("boolean".equals(codeString)) - return AnswerFormat.BOOLEAN; - if ("decimal".equals(codeString)) - return AnswerFormat.DECIMAL; - if ("integer".equals(codeString)) - return AnswerFormat.INTEGER; - if ("date".equals(codeString)) - return AnswerFormat.DATE; - if ("dateTime".equals(codeString)) - return AnswerFormat.DATETIME; - if ("instant".equals(codeString)) - return AnswerFormat.INSTANT; - if ("time".equals(codeString)) - return AnswerFormat.TIME; - if ("string".equals(codeString)) - return AnswerFormat.STRING; - if ("text".equals(codeString)) - return AnswerFormat.TEXT; - if ("choice".equals(codeString)) - return AnswerFormat.CHOICE; - if ("open-choice".equals(codeString)) - return AnswerFormat.OPENCHOICE; - if ("attachment".equals(codeString)) - return AnswerFormat.ATTACHMENT; - if ("reference".equals(codeString)) - return AnswerFormat.REFERENCE; - if ("quantity".equals(codeString)) - return AnswerFormat.QUANTITY; - throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); - } - public String toCode(AnswerFormat code) throws IllegalArgumentException { - if (code == AnswerFormat.BOOLEAN) - return "boolean"; - if (code == AnswerFormat.DECIMAL) - return "decimal"; - if (code == AnswerFormat.INTEGER) - return "integer"; - if (code == AnswerFormat.DATE) - return "date"; - if (code == AnswerFormat.DATETIME) - return "dateTime"; - if (code == AnswerFormat.INSTANT) - return "instant"; - if (code == AnswerFormat.TIME) - return "time"; - if (code == AnswerFormat.STRING) - return "string"; - if (code == AnswerFormat.TEXT) - return "text"; - if (code == AnswerFormat.CHOICE) - return "choice"; - if (code == AnswerFormat.OPENCHOICE) - return "open-choice"; - if (code == AnswerFormat.ATTACHMENT) - return "attachment"; - if (code == AnswerFormat.REFERENCE) - return "reference"; - if (code == AnswerFormat.QUANTITY) - return "quantity"; - return "?"; - } - } - - @Block() - public static class GroupComponent extends BackboneElement { - /** - * A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. - */ - @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource." ) - protected StringType linkId; - - /** - * The human-readable name for this section of the questionnaire. - */ - @Child(name="title", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name to be displayed for group", formalDefinition="The human-readable name for this section of the questionnaire." ) - protected StringType title; - - /** - * Identifies a how this group of questions is known in a particular terminology such as LOINC. - */ - @Child(name="concept", type={Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concept that represents this section on a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) - protected List concept; - - /** - * Additional text for the group, used for display purposes. - */ - @Child(name="text", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) - protected StringType text; - - /** - * If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - @Child(name="required", type={BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Must group be included in data results?", formalDefinition="If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire." ) - protected BooleanType required; - - /** - * Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - @Child(name="repeats", type={BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Whether the group may repeat", formalDefinition="Whether the group may occur multiple times in the instance, containing multiple sets of answers." ) - protected BooleanType repeats; - - /** - * A sub-group within a group. The ordering of groups within this group is relevant. - */ - @Child(name="group", type={GroupComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) - protected List group; - - /** - * Set of questions within this group. The order of questions within the group is relevant. - */ - @Child(name="question", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) - protected List question; - - private static final long serialVersionUID = 494129548L; - - public GroupComponent() { - super(); - } - - /** - * @return {@link #linkId} (A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public GroupComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. - */ - public GroupComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public GroupComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The human-readable name for this section of the questionnaire. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The human-readable name for this section of the questionnaire. - */ - public GroupComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (Coding item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) - */ - // syntactic sugar - public Coding addConcept() { //3 - Coding t = new Coding(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - /** - * @return {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public GroupComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Additional text for the group, used for display purposes. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Additional text for the group, used for display purposes. - */ - public GroupComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public GroupComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - public boolean getRequired() { - return this.required == null ? false : this.required.getValue(); - } - - /** - * @param value If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - public GroupComponent setRequired(boolean value) { - if (value == false) - this.required = null; - else { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - } - return this; - } - - /** - * @return {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public BooleanType getRepeatsElement() { - if (this.repeats == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.repeats"); - else if (Configuration.doAutoCreate()) - this.repeats = new BooleanType(); - return this.repeats; - } - - public boolean hasRepeatsElement() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - public boolean hasRepeats() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - /** - * @param value {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public GroupComponent setRepeatsElement(BooleanType value) { - this.repeats = value; - return this; - } - - /** - * @return Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - public boolean getRepeats() { - return this.repeats == null ? false : this.repeats.getValue(); - } - - /** - * @param value Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - public GroupComponent setRepeats(boolean value) { - if (value == false) - this.repeats = null; - else { - if (this.repeats == null) - this.repeats = new BooleanType(); - this.repeats.setValue(value); - } - return this; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - public List getQuestion() { - if (this.question == null) - this.question = new ArrayList(); - return this.question; - } - - public boolean hasQuestion() { - if (this.question == null) - return false; - for (QuestionComponent item : this.question) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - // syntactic sugar - public QuestionComponent addQuestion() { //3 - QuestionComponent t = new QuestionComponent(); - if (this.question == null) - this.question = new ArrayList(); - this.question.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("title", "string", "The human-readable name for this section of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("repeats", "boolean", "Whether the group may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); - childrenList.add(new Property("group", "@Questionnaire.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); - } - - public GroupComponent copy() { - GroupComponent dst = new GroupComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.title = title == null ? null : title.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (Coding i : concept) - dst.concept.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - dst.required = required == null ? null : required.copy(); - dst.repeats = repeats == null ? null : repeats.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - if (question != null) { - dst.question = new ArrayList(); - for (QuestionComponent i : question) - dst.question.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) - && (concept == null || concept.isEmpty()) && (text == null || text.isEmpty()) && (required == null || required.isEmpty()) - && (repeats == null || repeats.isEmpty()) && (group == null || group.isEmpty()) && (question == null || question.isEmpty()) - ; - } - - } - - @Block() - public static class QuestionComponent extends BackboneElement { - /** - * An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. - */ - @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource." ) - protected StringType linkId; - - /** - * Identifies a how this question is known in a particular terminology such as LOINC. - */ - @Child(name="concept", type={Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concept that represents this question on a questionnaire", formalDefinition="Identifies a how this question is known in a particular terminology such as LOINC." ) - protected List concept; - - /** - * Text of the question as it is shown to the user. - */ - @Child(name="text", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="Text of the question as it is shown to the user." ) - protected StringType text; - - /** - * The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. - */ - @Child(name="type", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="boolean | decimal | integer | date | dateTime +", formalDefinition="The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected." ) - protected Enumeration type; - - /** - * If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - @Child(name="required", type={BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Must group be included in data results?", formalDefinition="If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire." ) - protected BooleanType required; - - /** - * Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - @Child(name="repeats", type={BooleanType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Whether the group may repeat", formalDefinition="Whether the group may occur multiple times in the instance, containing multiple sets of answers." ) - protected BooleanType repeats; - - /** - * Reference to a valueset containing the possible options. - */ - @Child(name="options", type={ValueSet.class}, order=7, min=0, max=1) - @Description(shortDefinition="Valueset containing the possible options", formalDefinition="Reference to a valueset containing the possible options." ) - protected Reference options; - - /** - * The actual object that is the target of the reference (Reference to a valueset containing the possible options.) - */ - protected ValueSet optionsTarget; - - /** - * Nested group, containing nested question for this question. The order of groups within the question is relevant. - */ - @Child(name="group", type={GroupComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) - protected List group; - - private static final long serialVersionUID = 1655002985L; - - public QuestionComponent() { - super(); - } - - /** - * @return {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public QuestionComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. - */ - public QuestionComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (Coding item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) - */ - // syntactic sugar - public Coding addConcept() { //3 - Coding t = new Coding(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - /** - * @return {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public QuestionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Text of the question as it is shown to the user. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Text of the question as it is shown to the user. - */ - public QuestionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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 expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public QuestionComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. - */ - public AnswerFormat getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. - */ - public QuestionComponent setType(AnswerFormat value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(AnswerFormat.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public QuestionComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - public boolean getRequired() { - return this.required == null ? false : this.required.getValue(); - } - - /** - * @param value If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. - */ - public QuestionComponent setRequired(boolean value) { - if (value == false) - this.required = null; - else { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - } - return this; - } - - /** - * @return {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public BooleanType getRepeatsElement() { - if (this.repeats == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.repeats"); - else if (Configuration.doAutoCreate()) - this.repeats = new BooleanType(); - return this.repeats; - } - - public boolean hasRepeatsElement() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - public boolean hasRepeats() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - /** - * @param value {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public QuestionComponent setRepeatsElement(BooleanType value) { - this.repeats = value; - return this; - } - - /** - * @return Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - public boolean getRepeats() { - return this.repeats == null ? false : this.repeats.getValue(); - } - - /** - * @param value Whether the group may occur multiple times in the instance, containing multiple sets of answers. - */ - public QuestionComponent setRepeats(boolean value) { - if (value == false) - this.repeats = null; - else { - if (this.repeats == null) - this.repeats = new BooleanType(); - this.repeats.setValue(value); - } - return this; - } - - /** - * @return {@link #options} (Reference to a valueset containing the possible options.) - */ - public Reference getOptions() { - if (this.options == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.options"); - else if (Configuration.doAutoCreate()) - this.options = new Reference(); - return this.options; - } - - public boolean hasOptions() { - return this.options != null && !this.options.isEmpty(); - } - - /** - * @param value {@link #options} (Reference to a valueset containing the possible options.) - */ - public QuestionComponent setOptions(Reference value) { - this.options = value; - return this; - } - - /** - * @return {@link #options} 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. (Reference to a valueset containing the possible options.) - */ - public ValueSet getOptionsTarget() { - if (this.optionsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.options"); - else if (Configuration.doAutoCreate()) - this.optionsTarget = new ValueSet(); - return this.optionsTarget; - } - - /** - * @param value {@link #options} 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 a valueset containing the possible options.) - */ - public QuestionComponent setOptionsTarget(ValueSet value) { - this.optionsTarget = value; - return this; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this question is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("text", "string", "Text of the question as it is shown to the user.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("type", "code", "The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("repeats", "boolean", "Whether the group may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); - childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a valueset containing the possible options.", 0, java.lang.Integer.MAX_VALUE, options)); - childrenList.add(new Property("group", "@Questionnaire.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public QuestionComponent copy() { - QuestionComponent dst = new QuestionComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (Coding i : concept) - dst.concept.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - dst.type = type == null ? null : type.copy(); - dst.required = required == null ? null : required.copy(); - dst.repeats = repeats == null ? null : repeats.copy(); - dst.options = options == null ? null : options.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (concept == null || concept.isEmpty()) - && (text == null || text.isEmpty()) && (type == null || type.isEmpty()) && (required == null || required.isEmpty()) - && (repeats == null || repeats.isEmpty()) && (options == null || options.isEmpty()) && (group == null || group.isEmpty()) - ; - } - - } - - /** - * This records identifiers associated with this question set 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 questionnaire", formalDefinition="This records identifiers associated with this question set 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; - - /** - * The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id for this version of Questionnaire", formalDefinition="The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated." ) - protected StringType version; - - /** - * The lifecycle status of the questionnaire as a whole. - */ - @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="draft | published | retired", formalDefinition="The lifecycle status of the questionnaire as a whole." ) - protected Enumeration status; - - /** - * The date that this questionnaire was last changed. - */ - @Child(name="date", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) - protected DateTimeType date; - - /** - * Organization responsible for developing and maintaining the questionnaire. - */ - @Child(name="publisher", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who designed the questionnaire", formalDefinition="Organization responsible for developing and maintaining the questionnaire." ) - protected StringType publisher; - - /** - * A collection of related questions (or further groupings of questions). - */ - @Child(name="group", type={}, order=4, min=1, max=1) - @Description(shortDefinition="Grouped questions", formalDefinition="A collection of related questions (or further groupings of questions)." ) - protected GroupComponent group; - - private static final long serialVersionUID = 2121035996L; - - public Questionnaire() { - super(); - } - - public Questionnaire(Enumeration status, GroupComponent group) { - super(); - this.status = status; - this.group = group; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this question set 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 getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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 question set 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(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Questionnaire setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - public Questionnaire setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Questionnaire setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The lifecycle status of the questionnaire as a whole. - */ - public QuestionnaireStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The lifecycle status of the questionnaire as a whole. - */ - public Questionnaire setStatus(QuestionnaireStatus value) { - if (this.status == null) - this.status = new Enumeration(QuestionnaireStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Questionnaire setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this questionnaire was last changed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that this questionnaire was last changed. - */ - public Questionnaire setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (Organization responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Organization responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Questionnaire setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Organization responsible for developing and maintaining the questionnaire. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Organization responsible for developing and maintaining the questionnaire. - */ - public Questionnaire setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #group} (A collection of related questions (or further groupings of questions).) - */ - public GroupComponent getGroup() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.group"); - else if (Configuration.doAutoCreate()) - this.group = new GroupComponent(); - return this.group; - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (A collection of related questions (or further groupings of questions).) - */ - public Questionnaire setGroup(GroupComponent value) { - this.group = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set 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("version", "string", "The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that this questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "Organization responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("group", "", "A collection of related questions (or further groupings of questions).", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public Questionnaire copy() { - Questionnaire dst = new Questionnaire(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - dst.group = group == null ? null : group.copy(); - return dst; - } - - protected Questionnaire typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (group == null || group.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Questionnaire; - } - - @SearchParamDefinition(name="title", path="", description="All or part of the name of the questionnaire (title for the root group of the questionnaire)", type="string" ) - public static final String SP_TITLE = "title"; - @SearchParamDefinition(name="status", path="Questionnaire.status", description="The status of the questionnaire", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="code", path="Questionnaire.group.concept", description="A code that corresponds to the questionnaire or one of its groups", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="Questionnaire.date", description="When the questionnaire was last changed", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="An identifier for the questionnaire", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="string" ) - public static final String SP_VERSION = "version"; - @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="The author of the questionnaire", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - -} - + +/* + 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; +/** + * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ +@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") +public class Questionnaire extends DomainResource { + + public enum QuestionnaireStatus implements FhirEnum { + /** + * This Questionnaire is not ready for official use. + */ + DRAFT, + /** + * This Questionnaire is ready for use. + */ + PUBLISHED, + /** + * This Questionnaire should no longer be used to gather data. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + public static final QuestionnaireStatusEnumFactory ENUM_FACTORY = new QuestionnaireStatusEnumFactory(); + + public static QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("published".equals(codeString)) + return PUBLISHED; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case PUBLISHED: return "published"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case PUBLISHED: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This Questionnaire is not ready for official use."; + case PUBLISHED: return "This Questionnaire is ready for use."; + case RETIRED: return "This Questionnaire should no longer be used to gather data."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case PUBLISHED: return "published"; + case RETIRED: return "retired"; + default: return "?"; + } + } + } + + public static class QuestionnaireStatusEnumFactory implements EnumFactory { + public QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return QuestionnaireStatus.DRAFT; + if ("published".equals(codeString)) + return QuestionnaireStatus.PUBLISHED; + if ("retired".equals(codeString)) + return QuestionnaireStatus.RETIRED; + throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); + } + public String toCode(QuestionnaireStatus code) throws IllegalArgumentException { + if (code == QuestionnaireStatus.DRAFT) + return "draft"; + if (code == QuestionnaireStatus.PUBLISHED) + return "published"; + if (code == QuestionnaireStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum AnswerFormat implements FhirEnum { + /** + * Answer is a yes/no answer. + */ + BOOLEAN, + /** + * Answer is a floating point number. + */ + DECIMAL, + /** + * Answer is an integer. + */ + INTEGER, + /** + * Answer is a date. + */ + DATE, + /** + * Answer is a date and time. + */ + DATETIME, + /** + * Answer is a system timestamp. + */ + INSTANT, + /** + * Answer is a time independent of date. + */ + TIME, + /** + * Answer is a short (few words to short sentence) free-text entry. + */ + STRING, + /** + * Answer is a long (potentially multi-paragram) free-text entry. + */ + TEXT, + /** + * Answer is a choice from a list of options. + */ + CHOICE, + /** + * Answer is a choice from a list of options or a free-text entry. + */ + OPENCHOICE, + /** + * Answer is binary content such as a image, PDF, etc. + */ + ATTACHMENT, + /** + * Answer is a reference to another resource (practitioner, organization, etc.). + */ + REFERENCE, + /** + * Answer is a combination of a numeric value and unit. + */ + QUANTITY, + /** + * added to help the parsers + */ + NULL; + + public static final AnswerFormatEnumFactory ENUM_FACTORY = new AnswerFormatEnumFactory(); + + public static AnswerFormat fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("boolean".equals(codeString)) + return BOOLEAN; + if ("decimal".equals(codeString)) + return DECIMAL; + if ("integer".equals(codeString)) + return INTEGER; + if ("date".equals(codeString)) + return DATE; + if ("dateTime".equals(codeString)) + return DATETIME; + if ("instant".equals(codeString)) + return INSTANT; + if ("time".equals(codeString)) + return TIME; + if ("string".equals(codeString)) + return STRING; + if ("text".equals(codeString)) + return TEXT; + if ("choice".equals(codeString)) + return CHOICE; + if ("open-choice".equals(codeString)) + return OPENCHOICE; + if ("attachment".equals(codeString)) + return ATTACHMENT; + if ("reference".equals(codeString)) + return REFERENCE; + if ("quantity".equals(codeString)) + return QUANTITY; + throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case BOOLEAN: return "boolean"; + case DECIMAL: return "decimal"; + case INTEGER: return "integer"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case INSTANT: return "instant"; + case TIME: return "time"; + case STRING: return "string"; + case TEXT: return "text"; + case CHOICE: return "choice"; + case OPENCHOICE: return "open-choice"; + case ATTACHMENT: return "attachment"; + case REFERENCE: return "reference"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BOOLEAN: return ""; + case DECIMAL: return ""; + case INTEGER: return ""; + case DATE: return ""; + case DATETIME: return ""; + case INSTANT: return ""; + case TIME: return ""; + case STRING: return ""; + case TEXT: return ""; + case CHOICE: return ""; + case OPENCHOICE: return ""; + case ATTACHMENT: return ""; + case REFERENCE: return ""; + case QUANTITY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BOOLEAN: return "Answer is a yes/no answer."; + case DECIMAL: return "Answer is a floating point number."; + case INTEGER: return "Answer is an integer."; + case DATE: return "Answer is a date."; + case DATETIME: return "Answer is a date and time."; + case INSTANT: return "Answer is a system timestamp."; + case TIME: return "Answer is a time independent of date."; + case STRING: return "Answer is a short (few words to short sentence) free-text entry."; + case TEXT: return "Answer is a long (potentially multi-paragram) free-text entry."; + case CHOICE: return "Answer is a choice from a list of options."; + case OPENCHOICE: return "Answer is a choice from a list of options or a free-text entry."; + case ATTACHMENT: return "Answer is binary content such as a image, PDF, etc."; + case REFERENCE: return "Answer is a reference to another resource (practitioner, organization, etc.)."; + case QUANTITY: return "Answer is a combination of a numeric value and unit."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BOOLEAN: return "boolean"; + case DECIMAL: return "decimal"; + case INTEGER: return "integer"; + case DATE: return "date"; + case DATETIME: return "dateTime"; + case INSTANT: return "instant"; + case TIME: return "time"; + case STRING: return "string"; + case TEXT: return "text"; + case CHOICE: return "choice"; + case OPENCHOICE: return "open-choice"; + case ATTACHMENT: return "attachment"; + case REFERENCE: return "reference"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + } + + public static class AnswerFormatEnumFactory implements EnumFactory { + public AnswerFormat fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("boolean".equals(codeString)) + return AnswerFormat.BOOLEAN; + if ("decimal".equals(codeString)) + return AnswerFormat.DECIMAL; + if ("integer".equals(codeString)) + return AnswerFormat.INTEGER; + if ("date".equals(codeString)) + return AnswerFormat.DATE; + if ("dateTime".equals(codeString)) + return AnswerFormat.DATETIME; + if ("instant".equals(codeString)) + return AnswerFormat.INSTANT; + if ("time".equals(codeString)) + return AnswerFormat.TIME; + if ("string".equals(codeString)) + return AnswerFormat.STRING; + if ("text".equals(codeString)) + return AnswerFormat.TEXT; + if ("choice".equals(codeString)) + return AnswerFormat.CHOICE; + if ("open-choice".equals(codeString)) + return AnswerFormat.OPENCHOICE; + if ("attachment".equals(codeString)) + return AnswerFormat.ATTACHMENT; + if ("reference".equals(codeString)) + return AnswerFormat.REFERENCE; + if ("quantity".equals(codeString)) + return AnswerFormat.QUANTITY; + throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); + } + public String toCode(AnswerFormat code) throws IllegalArgumentException { + if (code == AnswerFormat.BOOLEAN) + return "boolean"; + if (code == AnswerFormat.DECIMAL) + return "decimal"; + if (code == AnswerFormat.INTEGER) + return "integer"; + if (code == AnswerFormat.DATE) + return "date"; + if (code == AnswerFormat.DATETIME) + return "dateTime"; + if (code == AnswerFormat.INSTANT) + return "instant"; + if (code == AnswerFormat.TIME) + return "time"; + if (code == AnswerFormat.STRING) + return "string"; + if (code == AnswerFormat.TEXT) + return "text"; + if (code == AnswerFormat.CHOICE) + return "choice"; + if (code == AnswerFormat.OPENCHOICE) + return "open-choice"; + if (code == AnswerFormat.ATTACHMENT) + return "attachment"; + if (code == AnswerFormat.REFERENCE) + return "reference"; + if (code == AnswerFormat.QUANTITY) + return "quantity"; + return "?"; + } + } + + @Block() + public static class GroupComponent extends BackboneElement { + /** + * A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + */ + @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource." ) + protected StringType linkId; + + /** + * The human-readable name for this section of the questionnaire. + */ + @Child(name="title", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name to be displayed for group", formalDefinition="The human-readable name for this section of the questionnaire." ) + protected StringType title; + + /** + * Identifies a how this group of questions is known in a particular terminology such as LOINC. + */ + @Child(name="concept", type={Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Concept that represents this section on a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) + protected List concept; + + /** + * Additional text for the group, used for display purposes. + */ + @Child(name="text", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) + protected StringType text; + + /** + * If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + @Child(name="required", type={BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Must group be included in data results?", formalDefinition="If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire." ) + protected BooleanType required; + + /** + * Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + @Child(name="repeats", type={BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Whether the group may repeat", formalDefinition="Whether the group may occur multiple times in the instance, containing multiple sets of answers." ) + protected BooleanType repeats; + + /** + * A sub-group within a group. The ordering of groups within this group is relevant. + */ + @Child(name="group", type={GroupComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) + protected List group; + + /** + * Set of questions within this group. The order of questions within the group is relevant. + */ + @Child(name="question", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) + protected List question; + + private static final long serialVersionUID = 494129548L; + + public GroupComponent() { + super(); + } + + /** + * @return {@link #linkId} (A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public GroupComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + */ + public GroupComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (The human-readable name for this section of the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public GroupComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return The human-readable name for this section of the questionnaire. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value The human-readable name for this section of the questionnaire. + */ + public GroupComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (Coding item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + */ + // syntactic sugar + public Coding addConcept() { //3 + Coding t = new Coding(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + /** + * @return {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public GroupComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Additional text for the group, used for display purposes. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Additional text for the group, used for display purposes. + */ + public GroupComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public GroupComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + public boolean getRequired() { + return this.required == null ? false : this.required.getValue(); + } + + /** + * @param value If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + public GroupComponent setRequired(boolean value) { + if (value == false) + this.required = null; + else { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + } + return this; + } + + /** + * @return {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public BooleanType getRepeatsElement() { + if (this.repeats == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.repeats"); + else if (Configuration.doAutoCreate()) + this.repeats = new BooleanType(); + return this.repeats; + } + + public boolean hasRepeatsElement() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + public boolean hasRepeats() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + /** + * @param value {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public GroupComponent setRepeatsElement(BooleanType value) { + this.repeats = value; + return this; + } + + /** + * @return Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + public boolean getRepeats() { + return this.repeats == null ? false : this.repeats.getValue(); + } + + /** + * @param value Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + public GroupComponent setRepeats(boolean value) { + if (value == false) + this.repeats = null; + else { + if (this.repeats == null) + this.repeats = new BooleanType(); + this.repeats.setValue(value); + } + return this; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + public List getQuestion() { + if (this.question == null) + this.question = new ArrayList(); + return this.question; + } + + public boolean hasQuestion() { + if (this.question == null) + return false; + for (QuestionComponent item : this.question) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + // syntactic sugar + public QuestionComponent addQuestion() { //3 + QuestionComponent t = new QuestionComponent(); + if (this.question == null) + this.question = new ArrayList(); + this.question.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "A identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("title", "string", "The human-readable name for this section of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("concept", "Coding", "Identifies a how this group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("repeats", "boolean", "Whether the group may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); + childrenList.add(new Property("group", "@Questionnaire.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); + } + + public GroupComponent copy() { + GroupComponent dst = new GroupComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.title = title == null ? null : title.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (Coding i : concept) + dst.concept.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + dst.required = required == null ? null : required.copy(); + dst.repeats = repeats == null ? null : repeats.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + if (question != null) { + dst.question = new ArrayList(); + for (QuestionComponent i : question) + dst.question.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) + && (concept == null || concept.isEmpty()) && (text == null || text.isEmpty()) && (required == null || required.isEmpty()) + && (repeats == null || repeats.isEmpty()) && (group == null || group.isEmpty()) && (question == null || question.isEmpty()) + ; + } + + } + + @Block() + public static class QuestionComponent extends BackboneElement { + /** + * An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + */ + @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="To link questionnaire with questionnaire answers", formalDefinition="An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource." ) + protected StringType linkId; + + /** + * Identifies a how this question is known in a particular terminology such as LOINC. + */ + @Child(name="concept", type={Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Concept that represents this question on a questionnaire", formalDefinition="Identifies a how this question is known in a particular terminology such as LOINC." ) + protected List concept; + + /** + * Text of the question as it is shown to the user. + */ + @Child(name="text", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="Text of the question as it is shown to the user." ) + protected StringType text; + + /** + * The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + */ + @Child(name="type", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="boolean | decimal | integer | date | dateTime +", formalDefinition="The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected." ) + protected Enumeration type; + + /** + * If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + @Child(name="required", type={BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Must group be included in data results?", formalDefinition="If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire." ) + protected BooleanType required; + + /** + * Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + @Child(name="repeats", type={BooleanType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Whether the group may repeat", formalDefinition="Whether the group may occur multiple times in the instance, containing multiple sets of answers." ) + protected BooleanType repeats; + + /** + * Reference to a valueset containing the possible options. + */ + @Child(name="options", type={ValueSet.class}, order=7, min=0, max=1) + @Description(shortDefinition="Valueset containing the possible options", formalDefinition="Reference to a valueset containing the possible options." ) + protected Reference options; + + /** + * The actual object that is the target of the reference (Reference to a valueset containing the possible options.) + */ + protected ValueSet optionsTarget; + + /** + * Nested group, containing nested question for this question. The order of groups within the question is relevant. + */ + @Child(name="group", type={GroupComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) + protected List group; + + private static final long serialVersionUID = 1655002985L; + + public QuestionComponent() { + super(); + } + + /** + * @return {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public QuestionComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + */ + public QuestionComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (Coding item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) + */ + // syntactic sugar + public Coding addConcept() { //3 + Coding t = new Coding(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + /** + * @return {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public QuestionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Text of the question as it is shown to the user. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Text of the question as it is shown to the user. + */ + public QuestionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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 expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public QuestionComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + */ + public AnswerFormat getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + */ + public QuestionComponent setType(AnswerFormat value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(AnswerFormat.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public BooleanType getRequiredElement() { + if (this.required == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.required"); + else if (Configuration.doAutoCreate()) + this.required = new BooleanType(); + return this.required; + } + + public boolean hasRequiredElement() { + return this.required != null && !this.required.isEmpty(); + } + + public boolean hasRequired() { + return this.required != null && !this.required.isEmpty(); + } + + /** + * @param value {@link #required} (If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value + */ + public QuestionComponent setRequiredElement(BooleanType value) { + this.required = value; + return this; + } + + /** + * @return If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + public boolean getRequired() { + return this.required == null ? false : this.required.getValue(); + } + + /** + * @param value If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + */ + public QuestionComponent setRequired(boolean value) { + if (value == false) + this.required = null; + else { + if (this.required == null) + this.required = new BooleanType(); + this.required.setValue(value); + } + return this; + } + + /** + * @return {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public BooleanType getRepeatsElement() { + if (this.repeats == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.repeats"); + else if (Configuration.doAutoCreate()) + this.repeats = new BooleanType(); + return this.repeats; + } + + public boolean hasRepeatsElement() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + public boolean hasRepeats() { + return this.repeats != null && !this.repeats.isEmpty(); + } + + /** + * @param value {@link #repeats} (Whether the group may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value + */ + public QuestionComponent setRepeatsElement(BooleanType value) { + this.repeats = value; + return this; + } + + /** + * @return Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + public boolean getRepeats() { + return this.repeats == null ? false : this.repeats.getValue(); + } + + /** + * @param value Whether the group may occur multiple times in the instance, containing multiple sets of answers. + */ + public QuestionComponent setRepeats(boolean value) { + if (value == false) + this.repeats = null; + else { + if (this.repeats == null) + this.repeats = new BooleanType(); + this.repeats.setValue(value); + } + return this; + } + + /** + * @return {@link #options} (Reference to a valueset containing the possible options.) + */ + public Reference getOptions() { + if (this.options == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.options"); + else if (Configuration.doAutoCreate()) + this.options = new Reference(); + return this.options; + } + + public boolean hasOptions() { + return this.options != null && !this.options.isEmpty(); + } + + /** + * @param value {@link #options} (Reference to a valueset containing the possible options.) + */ + public QuestionComponent setOptions(Reference value) { + this.options = value; + return this; + } + + /** + * @return {@link #options} 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. (Reference to a valueset containing the possible options.) + */ + public ValueSet getOptionsTarget() { + if (this.optionsTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.options"); + else if (Configuration.doAutoCreate()) + this.optionsTarget = new ValueSet(); + return this.optionsTarget; + } + + /** + * @param value {@link #options} 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 a valueset containing the possible options.) + */ + public QuestionComponent setOptionsTarget(ValueSet value) { + this.optionsTarget = value; + return this; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("concept", "Coding", "Identifies a how this question is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("text", "string", "Text of the question as it is shown to the user.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("type", "code", "The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); + childrenList.add(new Property("repeats", "boolean", "Whether the group may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); + childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a valueset containing the possible options.", 0, java.lang.Integer.MAX_VALUE, options)); + childrenList.add(new Property("group", "@Questionnaire.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public QuestionComponent copy() { + QuestionComponent dst = new QuestionComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (Coding i : concept) + dst.concept.add(i.copy()); + }; + dst.text = text == null ? null : text.copy(); + dst.type = type == null ? null : type.copy(); + dst.required = required == null ? null : required.copy(); + dst.repeats = repeats == null ? null : repeats.copy(); + dst.options = options == null ? null : options.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (concept == null || concept.isEmpty()) + && (text == null || text.isEmpty()) && (type == null || type.isEmpty()) && (required == null || required.isEmpty()) + && (repeats == null || repeats.isEmpty()) && (options == null || options.isEmpty()) && (group == null || group.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this question set 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 questionnaire", formalDefinition="This records identifiers associated with this question set 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; + + /** + * The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id for this version of Questionnaire", formalDefinition="The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated." ) + protected StringType version; + + /** + * The lifecycle status of the questionnaire as a whole. + */ + @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="draft | published | retired", formalDefinition="The lifecycle status of the questionnaire as a whole." ) + protected Enumeration status; + + /** + * The date that this questionnaire was last changed. + */ + @Child(name="date", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) + protected DateTimeType date; + + /** + * Organization responsible for developing and maintaining the questionnaire. + */ + @Child(name="publisher", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who designed the questionnaire", formalDefinition="Organization responsible for developing and maintaining the questionnaire." ) + protected StringType publisher; + + /** + * A collection of related questions (or further groupings of questions). + */ + @Child(name="group", type={}, order=4, min=1, max=1) + @Description(shortDefinition="Grouped questions", formalDefinition="A collection of related questions (or further groupings of questions)." ) + protected GroupComponent group; + + private static final long serialVersionUID = 2121035996L; + + public Questionnaire() { + super(); + } + + public Questionnaire(Enumeration status, GroupComponent group) { + super(); + this.status = status; + this.group = group; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this question set 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 getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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 question set 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(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public Questionnaire setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + */ + public Questionnaire setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Questionnaire setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The lifecycle status of the questionnaire as a whole. + */ + public QuestionnaireStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The lifecycle status of the questionnaire as a whole. + */ + public Questionnaire setStatus(QuestionnaireStatus value) { + if (this.status == null) + this.status = new Enumeration(QuestionnaireStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public Questionnaire setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that this questionnaire was last changed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that this questionnaire was last changed. + */ + public Questionnaire setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (Organization responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Organization responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public Questionnaire setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Organization responsible for developing and maintaining the questionnaire. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Organization responsible for developing and maintaining the questionnaire. + */ + public Questionnaire setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #group} (A collection of related questions (or further groupings of questions).) + */ + public GroupComponent getGroup() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Questionnaire.group"); + else if (Configuration.doAutoCreate()) + this.group = new GroupComponent(); + return this.group; + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (A collection of related questions (or further groupings of questions).) + */ + public Questionnaire setGroup(GroupComponent value) { + this.group = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set 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("version", "string", "The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("date", "dateTime", "The date that this questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("publisher", "string", "Organization responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("group", "", "A collection of related questions (or further groupings of questions).", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public Questionnaire copy() { + Questionnaire dst = new Questionnaire(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.version = version == null ? null : version.copy(); + dst.status = status == null ? null : status.copy(); + dst.date = date == null ? null : date.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + dst.group = group == null ? null : group.copy(); + return dst; + } + + protected Questionnaire typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) + && (group == null || group.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Questionnaire; + } + + @SearchParamDefinition(name="title", path="", description="All or part of the name of the questionnaire (title for the root group of the questionnaire)", type="string" ) + public static final String SP_TITLE = "title"; + @SearchParamDefinition(name="status", path="Questionnaire.status", description="The status of the questionnaire", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="code", path="Questionnaire.group.concept", description="A code that corresponds to the questionnaire or one of its groups", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="Questionnaire.date", description="When the questionnaire was last changed", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="An identifier for the questionnaire", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="string" ) + public static final String SP_VERSION = "version"; + @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="The author of the questionnaire", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java index f75643de843..7fdea52f38e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java @@ -20,1369 +20,1369 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ -@ResourceDef(name="QuestionnaireAnswers", profile="http://hl7.org/fhir/Profile/QuestionnaireAnswers") -public class QuestionnaireAnswers extends DomainResource { - - public enum QuestionnaireAnswersStatus implements FhirEnum { - /** - * This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it. - */ - INPROGRESS, - /** - * This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive. - */ - COMPLETED, - /** - * This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. - */ - AMENDED, - /** - * added to help the parsers - */ - NULL; - - public static final QuestionnaireAnswersStatusEnumFactory ENUM_FACTORY = new QuestionnaireAnswersStatusEnumFactory(); - - public static QuestionnaireAnswersStatus 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 ("amended".equals(codeString)) - return AMENDED; - throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case INPROGRESS: return "in progress"; - case COMPLETED: return "completed"; - case AMENDED: return "amended"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case COMPLETED: return ""; - case AMENDED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it."; - case COMPLETED: return "This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive."; - case AMENDED: return "This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "in progress"; - case COMPLETED: return "completed"; - case AMENDED: return "amended"; - default: return "?"; - } - } - } - - public static class QuestionnaireAnswersStatusEnumFactory implements EnumFactory { - public QuestionnaireAnswersStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in progress".equals(codeString)) - return QuestionnaireAnswersStatus.INPROGRESS; - if ("completed".equals(codeString)) - return QuestionnaireAnswersStatus.COMPLETED; - if ("amended".equals(codeString)) - return QuestionnaireAnswersStatus.AMENDED; - throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); - } - public String toCode(QuestionnaireAnswersStatus code) throws IllegalArgumentException { - if (code == QuestionnaireAnswersStatus.INPROGRESS) - return "in progress"; - if (code == QuestionnaireAnswersStatus.COMPLETED) - return "completed"; - if (code == QuestionnaireAnswersStatus.AMENDED) - return "amended"; - return "?"; - } - } - - @Block() - public static class GroupComponent extends BackboneElement { - /** - * Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. - */ - @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Corresponding group within Questionnaire", formalDefinition="Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource." ) - protected StringType linkId; - - /** - * Text that is displayed above the contents of the group. - */ - @Child(name="title", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Name for this group", formalDefinition="Text that is displayed above the contents of the group." ) - protected StringType title; - - /** - * Additional text for the group, used for display purposes. - */ - @Child(name="text", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) - protected StringType text; - - /** - * More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers. - */ - @Child(name="subject", type={}, order=4, min=0, max=1) - @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - protected Resource subjectTarget; - - /** - * A sub-group within a group. The ordering of groups within this group is relevant. - */ - @Child(name="group", type={GroupComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire answers group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) - protected List group; - - /** - * Set of questions within this group. The order of questions within the group is relevant. - */ - @Child(name="question", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) - protected List question; - - private static final long serialVersionUID = -1045990435L; - - public GroupComponent() { - super(); - } - - /** - * @return {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public GroupComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. - */ - public GroupComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (Text that is displayed above the contents of the group.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (Text that is displayed above the contents of the group.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public GroupComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return Text that is displayed above the contents of the group. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value Text that is displayed above the contents of the group. - */ - public GroupComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public GroupComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Additional text for the group, used for display purposes. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Additional text for the group, used for display purposes. - */ - public GroupComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupComponent.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} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public GroupComponent 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. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public Resource getSubjectTarget() { - 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. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) - */ - public GroupComponent setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - public List getQuestion() { - if (this.question == null) - this.question = new ArrayList(); - return this.question; - } - - public boolean hasQuestion() { - if (this.question == null) - return false; - for (QuestionComponent item : this.question) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) - */ - // syntactic sugar - public QuestionComponent addQuestion() { //3 - QuestionComponent t = new QuestionComponent(); - if (this.question == null) - this.question = new ArrayList(); - this.question.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("title", "string", "Text that is displayed above the contents of the group.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); - } - - public GroupComponent copy() { - GroupComponent dst = new GroupComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.title = title == null ? null : title.copy(); - dst.text = text == null ? null : text.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - if (question != null) { - dst.question = new ArrayList(); - for (QuestionComponent i : question) - dst.question.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) - && (text == null || text.isEmpty()) && (subject == null || subject.isEmpty()) && (group == null || group.isEmpty()) - && (question == null || question.isEmpty()); - } - - } - - @Block() - public static class QuestionComponent extends BackboneElement { - /** - * Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. - */ - @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Corresponding question within Questionnaire", formalDefinition="Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource." ) - protected StringType linkId; - - /** - * Text of the question as it is shown to the user. - */ - @Child(name="text", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="Text of the question as it is shown to the user." ) - protected StringType text; - - /** - * The respondent's answer(s) to the question. - */ - @Child(name="answer", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) - protected List answer; - - /** - * Nested group, containing nested question for this question. The order of groups within the question is relevant. - */ - @Child(name="group", type={GroupComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) - protected List group; - - private static final long serialVersionUID = -564009278L; - - public QuestionComponent() { - super(); - } - - /** - * @return {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public QuestionComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. - */ - public QuestionComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public QuestionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Text of the question as it is shown to the user. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Text of the question as it is shown to the user. - */ - public QuestionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #answer} (The respondent's answer(s) to the question.) - */ - public List getAnswer() { - if (this.answer == null) - this.answer = new ArrayList(); - return this.answer; - } - - public boolean hasAnswer() { - if (this.answer == null) - return false; - for (QuestionAnswerComponent item : this.answer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #answer} (The respondent's answer(s) to the question.) - */ - // syntactic sugar - public QuestionAnswerComponent addAnswer() { //3 - QuestionAnswerComponent t = new QuestionAnswerComponent(); - if (this.answer == null) - this.answer = new ArrayList(); - this.answer.add(t); - return t; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (GroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) - */ - // syntactic sugar - public GroupComponent addGroup() { //3 - GroupComponent t = new GroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("text", "string", "Text of the question as it is shown to the user.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); - childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public QuestionComponent copy() { - QuestionComponent dst = new QuestionComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.text = text == null ? null : text.copy(); - if (answer != null) { - dst.answer = new ArrayList(); - for (QuestionAnswerComponent i : answer) - dst.answer.add(i.copy()); - }; - if (group != null) { - dst.group = new ArrayList(); - for (GroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty()) - && (answer == null || answer.isEmpty()) && (group == null || group.isEmpty()); - } - - } - - @Block() - public static class QuestionAnswerComponent extends BackboneElement { - /** - * Single-valued answer to the question. - */ - @Child(name="value", type={BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1) - @Description(shortDefinition="Single-valued answer to the question", formalDefinition="Single-valued answer to the question." ) - protected Type value; - - private static final long serialVersionUID = -732981989L; - - public QuestionAnswerComponent() { - super(); - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public BooleanType getValueBooleanType() throws Exception { - if (!(this.value instanceof BooleanType)) - throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public DecimalType getValueDecimalType() throws Exception { - if (!(this.value instanceof DecimalType)) - throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DecimalType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public IntegerType getValueIntegerType() throws Exception { - if (!(this.value instanceof IntegerType)) - throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public DateType getValueDateType() throws Exception { - if (!(this.value instanceof DateType)) - throw new Exception("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public DateTimeType getValueDateTimeType() throws Exception { - if (!(this.value instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public InstantType getValueInstantType() throws Exception { - if (!(this.value instanceof InstantType)) - throw new Exception("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (InstantType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public TimeType getValueTimeType() throws Exception { - if (!(this.value instanceof TimeType)) - throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public StringType getValueStringType() throws Exception { - if (!(this.value instanceof StringType)) - throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public Attachment getValueAttachment() throws Exception { - if (!(this.value instanceof Attachment)) - throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public Coding getValueCoding() throws Exception { - if (!(this.value instanceof Coding)) - throw new Exception("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Coding) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public Quantity getValueQuantity() throws Exception { - if (!(this.value instanceof Quantity)) - throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - /** - * @return {@link #value} (Single-valued answer to the question.) - */ - public Reference getValueReference() throws Exception { - if (!(this.value instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Reference) this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Single-valued answer to the question.) - */ - public QuestionAnswerComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|Attachment|Coding|Quantity|Reference(Any)", "Single-valued answer to the question.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public QuestionAnswerComponent copy() { - QuestionAnswerComponent dst = new QuestionAnswerComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()); - } - - } - - /** - * A business identifier assigned to a particular completed (or partially completed) questionnaire. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." ) - protected Identifier identifier; - - /** - * Indicates the Questionnaire resource that defines the form for which answers are being provided. - */ - @Child(name="questionnaire", type={Questionnaire.class}, order=0, min=0, max=1) - @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." ) - protected Reference questionnaire; - - /** - * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - protected Questionnaire questionnaireTarget; - - /** - * The lifecycle status of the questionnaire answers as a whole. - */ - @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="in progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire answers as a whole." ) - protected Enumeration status; - - /** - * The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. - */ - @Child(name="subject", type={}, order=2, min=0, max=1) - @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - protected Resource subjectTarget; - - /** - * Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system. - */ - @Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1) - @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - protected Resource authorTarget; - - /** - * The date and/or time that this version of the questionnaire answers was authored. - */ - @Child(name="authored", type={DateTimeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire answers was authored." ) - protected DateTimeType authored; - - /** - * The person who answered the questions about the subject. Only used when this is not the subject him/herself. - */ - @Child(name="source", type={Patient.class, Practitioner.class, RelatedPerson.class}, order=5, min=0, max=1) - @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject. Only used when this is not the subject him/herself." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) - */ - protected Resource sourceTarget; - - /** - * Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. - */ - @Child(name="encounter", type={Encounter.class}, order=6, min=0, max=1) - @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - protected Encounter encounterTarget; - - /** - * A group of questions to a possibly similarly grouped set of questions in the questionnaire answers. - */ - @Child(name="group", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Grouped questions", formalDefinition="A group of questions to a possibly similarly grouped set of questions in the questionnaire answers." ) - protected GroupComponent group; - - private static final long serialVersionUID = -949684393L; - - public QuestionnaireAnswers() { - super(); - } - - public QuestionnaireAnswers(Enumeration status, DateTimeType authored) { - super(); - this.status = status; - this.authored = authored; - } - - /** - * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) - */ - public QuestionnaireAnswers setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public Reference getQuestionnaire() { - if (this.questionnaire == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); - else if (Configuration.doAutoCreate()) - this.questionnaire = new Reference(); - return this.questionnaire; - } - - public boolean hasQuestionnaire() { - return this.questionnaire != null && !this.questionnaire.isEmpty(); - } - - /** - * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public QuestionnaireAnswers setQuestionnaire(Reference value) { - this.questionnaire = value; - return this; - } - - /** - * @return {@link #questionnaire} 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. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public Questionnaire getQuestionnaireTarget() { - if (this.questionnaireTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); - else if (Configuration.doAutoCreate()) - this.questionnaireTarget = new Questionnaire(); - return this.questionnaireTarget; - } - - /** - * @param value {@link #questionnaire} 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. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public QuestionnaireAnswers setQuestionnaireTarget(Questionnaire value) { - this.questionnaireTarget = value; - return this; - } - - /** - * @return {@link #status} (The lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public QuestionnaireAnswers setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The lifecycle status of the questionnaire answers as a whole. - */ - public QuestionnaireAnswersStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The lifecycle status of the questionnaire answers as a whole. - */ - public QuestionnaireAnswers setStatus(QuestionnaireAnswersStatus value) { - if (this.status == null) - this.status = new Enumeration(QuestionnaireAnswersStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #subject} (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.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 subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public QuestionnaireAnswers 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 subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public Resource getSubjectTarget() { - 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 subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public QuestionnaireAnswers setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public QuestionnaireAnswers setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) - */ - public QuestionnaireAnswers setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public DateTimeType getAuthoredElement() { - if (this.authored == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.authored"); - else if (Configuration.doAutoCreate()) - this.authored = new DateTimeType(); - return this.authored; - } - - public boolean hasAuthoredElement() { - return this.authored != null && !this.authored.isEmpty(); - } - - public boolean hasAuthored() { - return this.authored != null && !this.authored.isEmpty(); - } - - /** - * @param value {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public QuestionnaireAnswers setAuthoredElement(DateTimeType value) { - this.authored = value; - return this; - } - - /** - * @return The date and/or time that this version of the questionnaire answers was authored. - */ - public Date getAuthored() { - return this.authored == null ? null : this.authored.getValue(); - } - - /** - * @param value The date and/or time that this version of the questionnaire answers was authored. - */ - public QuestionnaireAnswers setAuthored(Date value) { - if (this.authored == null) - this.authored = new DateTimeType(); - this.authored.setValue(value); - return this; - } - - /** - * @return {@link #source} (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) - */ - public QuestionnaireAnswers setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) - */ - public QuestionnaireAnswers setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.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} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public QuestionnaireAnswers 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. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.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. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public QuestionnaireAnswers setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) - */ - public GroupComponent getGroup() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireAnswers.group"); - else if (Configuration.doAutoCreate()) - this.group = new GroupComponent(); - return this.group; - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) - */ - public QuestionnaireAnswers setGroup(GroupComponent value) { - this.group = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); - childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire answers as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire answers was authored.", 0, java.lang.Integer.MAX_VALUE, authored)); - childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject. Only used when this is not the subject him/herself.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("group", "", "A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - public QuestionnaireAnswers copy() { - QuestionnaireAnswers dst = new QuestionnaireAnswers(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.questionnaire = questionnaire == null ? null : questionnaire.copy(); - dst.status = status == null ? null : status.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.author = author == null ? null : author.copy(); - dst.authored = authored == null ? null : authored.copy(); - dst.source = source == null ? null : source.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.group = group == null ? null : group.copy(); - return dst; - } - - protected QuestionnaireAnswers typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty()) - && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) - && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (group == null || group.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.QuestionnaireAnswers; - } - - @SearchParamDefinition(name="author", path="QuestionnaireAnswers.author", description="The author of the questionnaire", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="questionnaire", path="QuestionnaireAnswers.questionnaire", description="The questionnaire the answers are provided for", type="reference" ) - public static final String SP_QUESTIONNAIRE = "questionnaire"; - @SearchParamDefinition(name="patient", path="QuestionnaireAnswers.subject", description="The patient that is the subject of the questionnaire", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="authored", path="QuestionnaireAnswers.authored", description="When the questionnaire was authored", type="date" ) - public static final String SP_AUTHORED = "authored"; - @SearchParamDefinition(name="status", path="QuestionnaireAnswers.status", description="The status of the questionnaire answers", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="subject", path="QuestionnaireAnswers.subject", description="The subject of the questionnaire", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="encounter", path="QuestionnaireAnswers.encounter", description="Encounter during which questionnaire was authored", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - -} - + +/* + 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; +/** + * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ +@ResourceDef(name="QuestionnaireAnswers", profile="http://hl7.org/fhir/Profile/QuestionnaireAnswers") +public class QuestionnaireAnswers extends DomainResource { + + public enum QuestionnaireAnswersStatus implements FhirEnum { + /** + * This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it. + */ + INPROGRESS, + /** + * This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive. + */ + COMPLETED, + /** + * This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. + */ + AMENDED, + /** + * added to help the parsers + */ + NULL; + + public static final QuestionnaireAnswersStatusEnumFactory ENUM_FACTORY = new QuestionnaireAnswersStatusEnumFactory(); + + public static QuestionnaireAnswersStatus 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 ("amended".equals(codeString)) + return AMENDED; + throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case COMPLETED: return "completed"; + case AMENDED: return "amended"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case AMENDED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it."; + case COMPLETED: return "This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive."; + case AMENDED: return "This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in progress"; + case COMPLETED: return "completed"; + case AMENDED: return "amended"; + default: return "?"; + } + } + } + + public static class QuestionnaireAnswersStatusEnumFactory implements EnumFactory { + public QuestionnaireAnswersStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return QuestionnaireAnswersStatus.INPROGRESS; + if ("completed".equals(codeString)) + return QuestionnaireAnswersStatus.COMPLETED; + if ("amended".equals(codeString)) + return QuestionnaireAnswersStatus.AMENDED; + throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); + } + public String toCode(QuestionnaireAnswersStatus code) throws IllegalArgumentException { + if (code == QuestionnaireAnswersStatus.INPROGRESS) + return "in progress"; + if (code == QuestionnaireAnswersStatus.COMPLETED) + return "completed"; + if (code == QuestionnaireAnswersStatus.AMENDED) + return "amended"; + return "?"; + } + } + + @Block() + public static class GroupComponent extends BackboneElement { + /** + * Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + */ + @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Corresponding group within Questionnaire", formalDefinition="Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource." ) + protected StringType linkId; + + /** + * Text that is displayed above the contents of the group. + */ + @Child(name="title", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Name for this group", formalDefinition="Text that is displayed above the contents of the group." ) + protected StringType title; + + /** + * Additional text for the group, used for display purposes. + */ + @Child(name="text", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Additional text for the group", formalDefinition="Additional text for the group, used for display purposes." ) + protected StringType text; + + /** + * More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers. + */ + @Child(name="subject", type={}, order=4, min=0, max=1) + @Description(shortDefinition="The subject this group's answers are about", formalDefinition="More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + protected Resource subjectTarget; + + /** + * A sub-group within a group. The ordering of groups within this group is relevant. + */ + @Child(name="group", type={GroupComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire answers group", formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant." ) + protected List group; + + /** + * Set of questions within this group. The order of questions within the group is relevant. + */ + @Child(name="question", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Questions in this group", formalDefinition="Set of questions within this group. The order of questions within the group is relevant." ) + protected List question; + + private static final long serialVersionUID = -1045990435L; + + public GroupComponent() { + super(); + } + + /** + * @return {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public GroupComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + */ + public GroupComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #title} (Text that is displayed above the contents of the group.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public StringType getTitleElement() { + if (this.title == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.title"); + else if (Configuration.doAutoCreate()) + this.title = new StringType(); + return this.title; + } + + public boolean hasTitleElement() { + return this.title != null && !this.title.isEmpty(); + } + + public boolean hasTitle() { + return this.title != null && !this.title.isEmpty(); + } + + /** + * @param value {@link #title} (Text that is displayed above the contents of the group.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value + */ + public GroupComponent setTitleElement(StringType value) { + this.title = value; + return this; + } + + /** + * @return Text that is displayed above the contents of the group. + */ + public String getTitle() { + return this.title == null ? null : this.title.getValue(); + } + + /** + * @param value Text that is displayed above the contents of the group. + */ + public GroupComponent setTitle(String value) { + if (Utilities.noString(value)) + this.title = null; + else { + if (this.title == null) + this.title = new StringType(); + this.title.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Additional text for the group, used for display purposes.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public GroupComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Additional text for the group, used for display purposes. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Additional text for the group, used for display purposes. + */ + public GroupComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GroupComponent.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} (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public GroupComponent 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. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public Resource getSubjectTarget() { + 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. (More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.) + */ + public GroupComponent setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (A sub-group within a group. The ordering of groups within this group is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + public List getQuestion() { + if (this.question == null) + this.question = new ArrayList(); + return this.question; + } + + public boolean hasQuestion() { + if (this.question == null) + return false; + for (QuestionComponent item : this.question) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #question} (Set of questions within this group. The order of questions within the group is relevant.) + */ + // syntactic sugar + public QuestionComponent addQuestion() { //3 + QuestionComponent t = new QuestionComponent(); + if (this.question == null) + this.question = new ArrayList(); + this.question.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("title", "string", "Text that is displayed above the contents of the group.", 0, java.lang.Integer.MAX_VALUE, title)); + childrenList.add(new Property("text", "string", "Additional text for the group, used for display purposes.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "A sub-group within a group. The ordering of groups within this group is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + childrenList.add(new Property("question", "", "Set of questions within this group. The order of questions within the group is relevant.", 0, java.lang.Integer.MAX_VALUE, question)); + } + + public GroupComponent copy() { + GroupComponent dst = new GroupComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.title = title == null ? null : title.copy(); + dst.text = text == null ? null : text.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + if (question != null) { + dst.question = new ArrayList(); + for (QuestionComponent i : question) + dst.question.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (title == null || title.isEmpty()) + && (text == null || text.isEmpty()) && (subject == null || subject.isEmpty()) && (group == null || group.isEmpty()) + && (question == null || question.isEmpty()); + } + + } + + @Block() + public static class QuestionComponent extends BackboneElement { + /** + * Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + */ + @Child(name="linkId", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Corresponding question within Questionnaire", formalDefinition="Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource." ) + protected StringType linkId; + + /** + * Text of the question as it is shown to the user. + */ + @Child(name="text", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Text of the question as it is shown to the user", formalDefinition="Text of the question as it is shown to the user." ) + protected StringType text; + + /** + * The respondent's answer(s) to the question. + */ + @Child(name="answer", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) + protected List answer; + + /** + * Nested group, containing nested question for this question. The order of groups within the question is relevant. + */ + @Child(name="group", type={GroupComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Nested questionnaire group", formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant." ) + protected List group; + + private static final long serialVersionUID = -564009278L; + + public QuestionComponent() { + super(); + } + + /** + * @return {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public StringType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new StringType(); + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public QuestionComponent setLinkIdElement(StringType value) { + this.linkId = value; + return this; + } + + /** + * @return Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + */ + public String getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + */ + public QuestionComponent setLinkId(String value) { + if (Utilities.noString(value)) + this.linkId = null; + else { + if (this.linkId == null) + this.linkId = new StringType(); + this.linkId.setValue(value); + } + return this; + } + + /** + * @return {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (Text of the question as it is shown to the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public QuestionComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return Text of the question as it is shown to the user. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value Text of the question as it is shown to the user. + */ + public QuestionComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + /** + * @return {@link #answer} (The respondent's answer(s) to the question.) + */ + public List getAnswer() { + if (this.answer == null) + this.answer = new ArrayList(); + return this.answer; + } + + public boolean hasAnswer() { + if (this.answer == null) + return false; + for (QuestionAnswerComponent item : this.answer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #answer} (The respondent's answer(s) to the question.) + */ + // syntactic sugar + public QuestionAnswerComponent addAnswer() { //3 + QuestionAnswerComponent t = new QuestionAnswerComponent(); + if (this.answer == null) + this.answer = new ArrayList(); + this.answer.add(t); + return t; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + public List getGroup() { + if (this.group == null) + this.group = new ArrayList(); + return this.group; + } + + public boolean hasGroup() { + if (this.group == null) + return false; + for (GroupComponent item : this.group) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #group} (Nested group, containing nested question for this question. The order of groups within the question is relevant.) + */ + // syntactic sugar + public GroupComponent addGroup() { //3 + GroupComponent t = new GroupComponent(); + if (this.group == null) + this.group = new ArrayList(); + this.group.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "string", "Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("text", "string", "Text of the question as it is shown to the user.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); + childrenList.add(new Property("group", "@QuestionnaireAnswers.group", "Nested group, containing nested question for this question. The order of groups within the question is relevant.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public QuestionComponent copy() { + QuestionComponent dst = new QuestionComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.text = text == null ? null : text.copy(); + if (answer != null) { + dst.answer = new ArrayList(); + for (QuestionAnswerComponent i : answer) + dst.answer.add(i.copy()); + }; + if (group != null) { + dst.group = new ArrayList(); + for (GroupComponent i : group) + dst.group.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty()) + && (answer == null || answer.isEmpty()) && (group == null || group.isEmpty()); + } + + } + + @Block() + public static class QuestionAnswerComponent extends BackboneElement { + /** + * Single-valued answer to the question. + */ + @Child(name="value", type={BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1) + @Description(shortDefinition="Single-valued answer to the question", formalDefinition="Single-valued answer to the question." ) + protected Type value; + + private static final long serialVersionUID = -732981989L; + + public QuestionAnswerComponent() { + super(); + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public Type getValue() { + return this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public BooleanType getValueBooleanType() throws Exception { + if (!(this.value instanceof BooleanType)) + throw new Exception("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (BooleanType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public DecimalType getValueDecimalType() throws Exception { + if (!(this.value instanceof DecimalType)) + throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DecimalType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public IntegerType getValueIntegerType() throws Exception { + if (!(this.value instanceof IntegerType)) + throw new Exception("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (IntegerType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public DateType getValueDateType() throws Exception { + if (!(this.value instanceof DateType)) + throw new Exception("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public DateTimeType getValueDateTimeType() throws Exception { + if (!(this.value instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (DateTimeType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public InstantType getValueInstantType() throws Exception { + if (!(this.value instanceof InstantType)) + throw new Exception("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (InstantType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public TimeType getValueTimeType() throws Exception { + if (!(this.value instanceof TimeType)) + throw new Exception("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (TimeType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public StringType getValueStringType() throws Exception { + if (!(this.value instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); + return (StringType) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public Attachment getValueAttachment() throws Exception { + if (!(this.value instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Attachment) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public Coding getValueCoding() throws Exception { + if (!(this.value instanceof Coding)) + throw new Exception("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Coding) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public Quantity getValueQuantity() throws Exception { + if (!(this.value instanceof Quantity)) + throw new Exception("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Quantity) this.value; + } + + /** + * @return {@link #value} (Single-valued answer to the question.) + */ + public Reference getValueReference() throws Exception { + if (!(this.value instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); + return (Reference) this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Single-valued answer to the question.) + */ + public QuestionAnswerComponent setValue(Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|Attachment|Coding|Quantity|Reference(Any)", "Single-valued answer to the question.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public QuestionAnswerComponent copy() { + QuestionAnswerComponent dst = new QuestionAnswerComponent(); + copyValues(dst); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (value == null || value.isEmpty()); + } + + } + + /** + * A business identifier assigned to a particular completed (or partially completed) questionnaire. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." ) + protected Identifier identifier; + + /** + * Indicates the Questionnaire resource that defines the form for which answers are being provided. + */ + @Child(name="questionnaire", type={Questionnaire.class}, order=0, min=0, max=1) + @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." ) + protected Reference questionnaire; + + /** + * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + protected Questionnaire questionnaireTarget; + + /** + * The lifecycle status of the questionnaire answers as a whole. + */ + @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="in progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire answers as a whole." ) + protected Enumeration status; + + /** + * The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. + */ + @Child(name="subject", type={}, order=2, min=0, max=1) + @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + protected Resource subjectTarget; + + /** + * Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system. + */ + @Child(name="author", type={Practitioner.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1) + @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + protected Resource authorTarget; + + /** + * The date and/or time that this version of the questionnaire answers was authored. + */ + @Child(name="authored", type={DateTimeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire answers was authored." ) + protected DateTimeType authored; + + /** + * The person who answered the questions about the subject. Only used when this is not the subject him/herself. + */ + @Child(name="source", type={Patient.class, Practitioner.class, RelatedPerson.class}, order=5, min=0, max=1) + @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject. Only used when this is not the subject him/herself." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) + */ + protected Resource sourceTarget; + + /** + * Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. + */ + @Child(name="encounter", type={Encounter.class}, order=6, min=0, max=1) + @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + protected Encounter encounterTarget; + + /** + * A group of questions to a possibly similarly grouped set of questions in the questionnaire answers. + */ + @Child(name="group", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Grouped questions", formalDefinition="A group of questions to a possibly similarly grouped set of questions in the questionnaire answers." ) + protected GroupComponent group; + + private static final long serialVersionUID = -949684393L; + + public QuestionnaireAnswers() { + super(); + } + + public QuestionnaireAnswers(Enumeration status, DateTimeType authored) { + super(); + this.status = status; + this.authored = authored; + } + + /** + * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) + */ + public QuestionnaireAnswers setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public Reference getQuestionnaire() { + if (this.questionnaire == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); + else if (Configuration.doAutoCreate()) + this.questionnaire = new Reference(); + return this.questionnaire; + } + + public boolean hasQuestionnaire() { + return this.questionnaire != null && !this.questionnaire.isEmpty(); + } + + /** + * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public QuestionnaireAnswers setQuestionnaire(Reference value) { + this.questionnaire = value; + return this; + } + + /** + * @return {@link #questionnaire} 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. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public Questionnaire getQuestionnaireTarget() { + if (this.questionnaireTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.questionnaire"); + else if (Configuration.doAutoCreate()) + this.questionnaireTarget = new Questionnaire(); + return this.questionnaireTarget; + } + + /** + * @param value {@link #questionnaire} 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. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) + */ + public QuestionnaireAnswers setQuestionnaireTarget(Questionnaire value) { + this.questionnaireTarget = value; + return this; + } + + /** + * @return {@link #status} (The lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 lifecycle status of the questionnaire answers as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public QuestionnaireAnswers setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The lifecycle status of the questionnaire answers as a whole. + */ + public QuestionnaireAnswersStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The lifecycle status of the questionnaire answers as a whole. + */ + public QuestionnaireAnswers setStatus(QuestionnaireAnswersStatus value) { + if (this.status == null) + this.status = new Enumeration(QuestionnaireAnswersStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #subject} (The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.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 subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public QuestionnaireAnswers 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 subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public Resource getSubjectTarget() { + 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 subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) + */ + public QuestionnaireAnswers setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public QuestionnaireAnswers setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public Resource getAuthorTarget() { + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.) + */ + public QuestionnaireAnswers setAuthorTarget(Resource value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public DateTimeType getAuthoredElement() { + if (this.authored == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.authored"); + else if (Configuration.doAutoCreate()) + this.authored = new DateTimeType(); + return this.authored; + } + + public boolean hasAuthoredElement() { + return this.authored != null && !this.authored.isEmpty(); + } + + public boolean hasAuthored() { + return this.authored != null && !this.authored.isEmpty(); + } + + /** + * @param value {@link #authored} (The date and/or time that this version of the questionnaire answers was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value + */ + public QuestionnaireAnswers setAuthoredElement(DateTimeType value) { + this.authored = value; + return this; + } + + /** + * @return The date and/or time that this version of the questionnaire answers was authored. + */ + public Date getAuthored() { + return this.authored == null ? null : this.authored.getValue(); + } + + /** + * @param value The date and/or time that this version of the questionnaire answers was authored. + */ + public QuestionnaireAnswers setAuthored(Date value) { + if (this.authored == null) + this.authored = new DateTimeType(); + this.authored.setValue(value); + return this; + } + + /** + * @return {@link #source} (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) + */ + public QuestionnaireAnswers setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) + */ + public Resource getSourceTarget() { + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject. Only used when this is not the subject him/herself.) + */ + public QuestionnaireAnswers setSourceTarget(Resource value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #encounter} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.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} (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public QuestionnaireAnswers 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. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.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. (Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) + */ + public QuestionnaireAnswers setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) + */ + public GroupComponent getGroup() { + if (this.group == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create QuestionnaireAnswers.group"); + else if (Configuration.doAutoCreate()) + this.group = new GroupComponent(); + return this.group; + } + + public boolean hasGroup() { + return this.group != null && !this.group.isEmpty(); + } + + /** + * @param value {@link #group} (A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.) + */ + public QuestionnaireAnswers setGroup(GroupComponent value) { + this.group = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); + childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire answers as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire answers was authored.", 0, java.lang.Integer.MAX_VALUE, authored)); + childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject. Only used when this is not the subject him/herself.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("group", "", "A group of questions to a possibly similarly grouped set of questions in the questionnaire answers.", 0, java.lang.Integer.MAX_VALUE, group)); + } + + public QuestionnaireAnswers copy() { + QuestionnaireAnswers dst = new QuestionnaireAnswers(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.questionnaire = questionnaire == null ? null : questionnaire.copy(); + dst.status = status == null ? null : status.copy(); + dst.subject = subject == null ? null : subject.copy(); + dst.author = author == null ? null : author.copy(); + dst.authored = authored == null ? null : authored.copy(); + dst.source = source == null ? null : source.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.group = group == null ? null : group.copy(); + return dst; + } + + protected QuestionnaireAnswers typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty()) + && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) + && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (group == null || group.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.QuestionnaireAnswers; + } + + @SearchParamDefinition(name="author", path="QuestionnaireAnswers.author", description="The author of the questionnaire", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="questionnaire", path="QuestionnaireAnswers.questionnaire", description="The questionnaire the answers are provided for", type="reference" ) + public static final String SP_QUESTIONNAIRE = "questionnaire"; + @SearchParamDefinition(name="patient", path="QuestionnaireAnswers.subject", description="The patient that is the subject of the questionnaire", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="authored", path="QuestionnaireAnswers.authored", description="When the questionnaire was authored", type="date" ) + public static final String SP_AUTHORED = "authored"; + @SearchParamDefinition(name="status", path="QuestionnaireAnswers.status", description="The status of the questionnaire answers", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="QuestionnaireAnswers.subject", description="The subject of the questionnaire", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="encounter", path="QuestionnaireAnswers.encounter", description="Encounter during which questionnaire was authored", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java index fc8a9880326..c60fd03f471 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java @@ -20,140 +20,140 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A set of ordered Quantities defined by a low and high limit. - */ -@DatatypeDef(name="Range") -public class Range extends Type implements ICompositeType{ - - /** - * The low limit. The boundary is inclusive. - */ - @Child(name="low", type={Quantity.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Low limit", formalDefinition="The low limit. The boundary is inclusive." ) - protected Quantity low; - - /** - * The high limit. The boundary is inclusive. - */ - @Child(name="high", type={Quantity.class}, order=0, min=0, max=1) - @Description(shortDefinition="High limit", formalDefinition="The high limit. The boundary is inclusive." ) - protected Quantity high; - - private static final long serialVersionUID = -474933350L; - - public Range() { - super(); - } - - /** - * @return {@link #low} (The low limit. The boundary is inclusive.) - */ - public Quantity getLow() { - if (this.low == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Range.low"); - else if (Configuration.doAutoCreate()) - this.low = new Quantity(); - return this.low; - } - - public boolean hasLow() { - return this.low != null && !this.low.isEmpty(); - } - - /** - * @param value {@link #low} (The low limit. The boundary is inclusive.) - */ - public Range setLow(Quantity value) { - this.low = value; - return this; - } - - /** - * @return {@link #high} (The high limit. The boundary is inclusive.) - */ - public Quantity getHigh() { - if (this.high == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Range.high"); - else if (Configuration.doAutoCreate()) - this.high = new Quantity(); - return this.high; - } - - public boolean hasHigh() { - return this.high != null && !this.high.isEmpty(); - } - - /** - * @param value {@link #high} (The high limit. The boundary is inclusive.) - */ - public Range setHigh(Quantity value) { - this.high = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("low", "Quantity", "The low limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, low)); - childrenList.add(new Property("high", "Quantity", "The high limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, high)); - } - - public Range copy() { - Range dst = new Range(); - copyValues(dst); - dst.low = low == null ? null : low.copy(); - dst.high = high == null ? null : high.copy(); - return dst; - } - - protected Range typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) - ; - } - - -} - + +/* + 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.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A set of ordered Quantities defined by a low and high limit. + */ +@DatatypeDef(name="Range") +public class Range extends Type implements ICompositeType{ + + /** + * The low limit. The boundary is inclusive. + */ + @Child(name="low", type={Quantity.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Low limit", formalDefinition="The low limit. The boundary is inclusive." ) + protected Quantity low; + + /** + * The high limit. The boundary is inclusive. + */ + @Child(name="high", type={Quantity.class}, order=0, min=0, max=1) + @Description(shortDefinition="High limit", formalDefinition="The high limit. The boundary is inclusive." ) + protected Quantity high; + + private static final long serialVersionUID = -474933350L; + + public Range() { + super(); + } + + /** + * @return {@link #low} (The low limit. The boundary is inclusive.) + */ + public Quantity getLow() { + if (this.low == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Range.low"); + else if (Configuration.doAutoCreate()) + this.low = new Quantity(); + return this.low; + } + + public boolean hasLow() { + return this.low != null && !this.low.isEmpty(); + } + + /** + * @param value {@link #low} (The low limit. The boundary is inclusive.) + */ + public Range setLow(Quantity value) { + this.low = value; + return this; + } + + /** + * @return {@link #high} (The high limit. The boundary is inclusive.) + */ + public Quantity getHigh() { + if (this.high == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Range.high"); + else if (Configuration.doAutoCreate()) + this.high = new Quantity(); + return this.high; + } + + public boolean hasHigh() { + return this.high != null && !this.high.isEmpty(); + } + + /** + * @param value {@link #high} (The high limit. The boundary is inclusive.) + */ + public Range setHigh(Quantity value) { + this.high = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("low", "Quantity", "The low limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, low)); + childrenList.add(new Property("high", "Quantity", "The high limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, high)); + } + + public Range copy() { + Range dst = new Range(); + copyValues(dst); + dst.low = low == null ? null : low.copy(); + dst.high = high == null ? null : high.copy(); + return dst; + } + + protected Range typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java index 50d8cae5778..e4b8605caab 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java @@ -20,140 +20,140 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ -@DatatypeDef(name="Ratio") -public class Ratio extends Type implements ICompositeType{ - - /** - * The value of the numerator. - */ - @Child(name="numerator", type={Quantity.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) - protected Quantity numerator; - - /** - * The value of the denominator. - */ - @Child(name="denominator", type={Quantity.class}, order=0, min=0, max=1) - @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) - protected Quantity denominator; - - private static final long serialVersionUID = 479922563L; - - public Ratio() { - super(); - } - - /** - * @return {@link #numerator} (The value of the numerator.) - */ - public Quantity getNumerator() { - if (this.numerator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Ratio.numerator"); - else if (Configuration.doAutoCreate()) - this.numerator = new Quantity(); - return this.numerator; - } - - public boolean hasNumerator() { - return this.numerator != null && !this.numerator.isEmpty(); - } - - /** - * @param value {@link #numerator} (The value of the numerator.) - */ - public Ratio setNumerator(Quantity value) { - this.numerator = value; - return this; - } - - /** - * @return {@link #denominator} (The value of the denominator.) - */ - public Quantity getDenominator() { - if (this.denominator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Ratio.denominator"); - else if (Configuration.doAutoCreate()) - this.denominator = new Quantity(); - return this.denominator; - } - - public boolean hasDenominator() { - return this.denominator != null && !this.denominator.isEmpty(); - } - - /** - * @param value {@link #denominator} (The value of the denominator.) - */ - public Ratio setDenominator(Quantity value) { - this.denominator = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("numerator", "Quantity", "The value of the numerator.", 0, java.lang.Integer.MAX_VALUE, numerator)); - childrenList.add(new Property("denominator", "Quantity", "The value of the denominator.", 0, java.lang.Integer.MAX_VALUE, denominator)); - } - - public Ratio copy() { - Ratio dst = new Ratio(); - copyValues(dst); - dst.numerator = numerator == null ? null : numerator.copy(); - dst.denominator = denominator == null ? null : denominator.copy(); - return dst; - } - - protected Ratio typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (numerator == null || numerator.isEmpty()) && (denominator == null || denominator.isEmpty()) - ; - } - - -} - + +/* + 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.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ +@DatatypeDef(name="Ratio") +public class Ratio extends Type implements ICompositeType{ + + /** + * The value of the numerator. + */ + @Child(name="numerator", type={Quantity.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) + protected Quantity numerator; + + /** + * The value of the denominator. + */ + @Child(name="denominator", type={Quantity.class}, order=0, min=0, max=1) + @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) + protected Quantity denominator; + + private static final long serialVersionUID = 479922563L; + + public Ratio() { + super(); + } + + /** + * @return {@link #numerator} (The value of the numerator.) + */ + public Quantity getNumerator() { + if (this.numerator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Ratio.numerator"); + else if (Configuration.doAutoCreate()) + this.numerator = new Quantity(); + return this.numerator; + } + + public boolean hasNumerator() { + return this.numerator != null && !this.numerator.isEmpty(); + } + + /** + * @param value {@link #numerator} (The value of the numerator.) + */ + public Ratio setNumerator(Quantity value) { + this.numerator = value; + return this; + } + + /** + * @return {@link #denominator} (The value of the denominator.) + */ + public Quantity getDenominator() { + if (this.denominator == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Ratio.denominator"); + else if (Configuration.doAutoCreate()) + this.denominator = new Quantity(); + return this.denominator; + } + + public boolean hasDenominator() { + return this.denominator != null && !this.denominator.isEmpty(); + } + + /** + * @param value {@link #denominator} (The value of the denominator.) + */ + public Ratio setDenominator(Quantity value) { + this.denominator = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("numerator", "Quantity", "The value of the numerator.", 0, java.lang.Integer.MAX_VALUE, numerator)); + childrenList.add(new Property("denominator", "Quantity", "The value of the denominator.", 0, java.lang.Integer.MAX_VALUE, denominator)); + } + + public Ratio copy() { + Ratio dst = new Ratio(); + copyValues(dst); + dst.numerator = numerator == null ? null : numerator.copy(); + dst.denominator = denominator == null ? null : denominator.copy(); + return dst; + } + + protected Ratio typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (numerator == null || numerator.isEmpty()) && (denominator == null || denominator.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java index 33364b55b08..5ed86d060ad 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java @@ -20,718 +20,718 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides the request and line items details for the claim which is to be readjudicated. - */ -@ResourceDef(name="Readjudicate", profile="http://hl7.org/fhir/Profile/Readjudicate") -public class Readjudicate extends DomainResource { - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequenceLinkId; - - private static final long serialVersionUID = -1598360600L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemsComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()); - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Reference of resource to reverse. - */ - @Child(name="request", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource to reverse.) - */ - protected Resource requestTarget; - - /** - * Reference of response to resource to reverse. - */ - @Child(name="response", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Reference of response to resource to reverse.) - */ - protected Resource responseTarget; - - /** - * A reference to supply which authenticated the process. - */ - @Child(name="reference", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticated the process." ) - protected StringType reference; - - /** - * List of top level items to be readjudicated, if none specified then the entire submission is readjudicated. - */ - @Child(name="item", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Items to readjudicate", formalDefinition="List of top level items to be readjudicated, if none specified then the entire submission is readjudicated." ) - protected List item; - - private static final long serialVersionUID = 445992972L; - - public Readjudicate() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 Readjudicate setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Readjudicate setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 Readjudicate setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public Readjudicate setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public Readjudicate setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 Readjudicate setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Readjudicate setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 Readjudicate setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Readjudicate setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Readjudicate setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public Readjudicate setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Reference of resource to reverse.) - */ - public Resource getRequestTarget() { - 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. (Reference of resource to reverse.) - */ - public Readjudicate setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource to reverse.) - */ - public Readjudicate setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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. (Reference of response to resource to reverse.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} 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 of response to resource to reverse.) - */ - public Readjudicate setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #reference} (A reference to supply which authenticated the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public StringType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new StringType(); - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (A reference to supply which authenticated the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public Readjudicate setReferenceElement(StringType value) { - this.reference = value; - return this; - } - - /** - * @return A reference to supply which authenticated the process. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value A reference to supply which authenticated the process. - */ - public Readjudicate setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new StringType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #item} (List of top level items to be readjudicated, if none specified then the entire submission is readjudicated.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (List of top level items to be readjudicated, if none specified then the entire submission is readjudicated.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - protected void listChildren(List 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("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("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)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("reference", "string", "A reference to supply which authenticated the process.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("item", "", "List of top level items to be readjudicated, if none specified then the entire submission is readjudicated.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - public Readjudicate copy() { - Readjudicate dst = new Readjudicate(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.reference = reference == null ? null : reference.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - protected Readjudicate typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (reference == null || reference.isEmpty()) - && (item == null || item.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Readjudicate; - } - - @SearchParamDefinition(name="identifier", path="Readjudicate.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides the request and line items details for the claim which is to be readjudicated. + */ +@ResourceDef(name="Readjudicate", profile="http://hl7.org/fhir/Profile/Readjudicate") +public class Readjudicate extends DomainResource { + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequenceLinkId", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequenceLinkId; + + private static final long serialVersionUID = -1598360600L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequenceLinkId) { + super(); + this.sequenceLinkId = sequenceLinkId; + } + + /** + * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public IntegerType getSequenceLinkIdElement() { + if (this.sequenceLinkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); + else if (Configuration.doAutoCreate()) + this.sequenceLinkId = new IntegerType(); + return this.sequenceLinkId; + } + + public boolean hasSequenceLinkIdElement() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + public boolean hasSequenceLinkId() { + return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); + } + + /** + * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value + */ + public ItemsComponent setSequenceLinkIdElement(IntegerType value) { + this.sequenceLinkId = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequenceLinkId() { + return this.sequenceLinkId == null ? null : this.sequenceLinkId.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequenceLinkId(int value) { + if (this.sequenceLinkId == null) + this.sequenceLinkId = new IntegerType(); + this.sequenceLinkId.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()); + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Reference of resource to reverse. + */ + @Child(name="request", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource to reverse.) + */ + protected Resource requestTarget; + + /** + * Reference of response to resource to reverse. + */ + @Child(name="response", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Reference of response to resource to reverse.) + */ + protected Resource responseTarget; + + /** + * A reference to supply which authenticated the process. + */ + @Child(name="reference", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticated the process." ) + protected StringType reference; + + /** + * List of top level items to be readjudicated, if none specified then the entire submission is readjudicated. + */ + @Child(name="item", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Items to readjudicate", formalDefinition="List of top level items to be readjudicated, if none specified then the entire submission is readjudicated." ) + protected List item; + + private static final long serialVersionUID = 445992972L; + + public Readjudicate() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 Readjudicate setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Readjudicate setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 Readjudicate setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public Readjudicate setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public Readjudicate setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 Readjudicate setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Readjudicate setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 Readjudicate setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Readjudicate setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Readjudicate setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public Readjudicate setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Reference of resource to reverse.) + */ + public Resource getRequestTarget() { + 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. (Reference of resource to reverse.) + */ + public Readjudicate setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource to reverse.) + */ + public Readjudicate setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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. (Reference of response to resource to reverse.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} 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 of response to resource to reverse.) + */ + public Readjudicate setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #reference} (A reference to supply which authenticated the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public StringType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Readjudicate.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new StringType(); + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (A reference to supply which authenticated the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public Readjudicate setReferenceElement(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to supply which authenticated the process. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value A reference to supply which authenticated the process. + */ + public Readjudicate setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new StringType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #item} (List of top level items to be readjudicated, if none specified then the entire submission is readjudicated.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (List of top level items to be readjudicated, if none specified then the entire submission is readjudicated.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + protected void listChildren(List 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("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("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)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("reference", "string", "A reference to supply which authenticated the process.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("item", "", "List of top level items to be readjudicated, if none specified then the entire submission is readjudicated.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public Readjudicate copy() { + Readjudicate dst = new Readjudicate(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.reference = reference == null ? null : reference.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + protected Readjudicate typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (reference == null || reference.isEmpty()) + && (item == null || item.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Readjudicate; + } + + @SearchParamDefinition(name="identifier", path="Readjudicate.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java index 26f68cce143..178638865e5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java @@ -20,201 +20,201 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A reference from one resource to another. - */ -@DatatypeDef(name="Reference") -public class Reference extends Type { - - /** - * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - */ - @Child(name="reference", type={StringType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Relative, internal or absolute URL reference", formalDefinition="A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources." ) - protected StringType reference; - - /** - * Plain text narrative that identifies the resource in addition to the resource reference. - */ - @Child(name="display", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Text alternative for the resource", formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference." ) - protected StringType display; - - private Resource resource; - - private static final long serialVersionUID = 22777321L; - - public Reference() { - super(); - } - - /** - * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public StringType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reference.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new StringType(); - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public Reference setReferenceElement(StringType value) { - this.reference = value; - return this; - } - - /** - * @return A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. - */ - public Reference setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new StringType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reference.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public Reference setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Plain text narrative that identifies the resource in addition to the resource reference. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Plain text narrative that identifies the resource in addition to the resource reference. - */ - public Reference setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("reference", "string", "A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Plain text narrative that identifies the resource in addition to the resource reference.", 0, java.lang.Integer.MAX_VALUE, display)); - } - - public Reference copy() { - Reference dst = new Reference(); - copyValues(dst); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - return dst; - } - - protected Reference typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) - ; - } - - public void setResource(Resource theResource) { - this.resource = theResource; - } - - public Resource getResource() { - return resource; - } - - -} - + +/* + 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.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A reference from one resource to another. + */ +@DatatypeDef(name="Reference") +public class Reference extends Type { + + /** + * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + @Child(name="reference", type={StringType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Relative, internal or absolute URL reference", formalDefinition="A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources." ) + protected StringType reference; + + /** + * Plain text narrative that identifies the resource in addition to the resource reference. + */ + @Child(name="display", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Text alternative for the resource", formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference." ) + protected StringType display; + + private Resource resource; + + private static final long serialVersionUID = 22777321L; + + public Reference() { + super(); + } + + /** + * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public StringType getReferenceElement() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reference.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new StringType(); + return this.reference; + } + + public boolean hasReferenceElement() { + return this.reference != null && !this.reference.isEmpty(); + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value + */ + public Reference setReferenceElement(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + public String getReference() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + public Reference setReference(String value) { + if (Utilities.noString(value)) + this.reference = null; + else { + if (this.reference == null) + this.reference = new StringType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reference.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public Reference setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Plain text narrative that identifies the resource in addition to the resource reference. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Plain text narrative that identifies the resource in addition to the resource reference. + */ + public Reference setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("reference", "string", "A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Plain text narrative that identifies the resource in addition to the resource reference.", 0, java.lang.Integer.MAX_VALUE, display)); + } + + public Reference copy() { + Reference dst = new Reference(); + copyValues(dst); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + return dst; + } + + protected Reference typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) + ; + } + + public void setResource(Resource theResource) { + this.resource = theResource; + } + + public Resource getResource() { + return resource; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java index 46de151f65b..c1bc01e6df8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java @@ -20,940 +20,940 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation. - */ -@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") -public class ReferralRequest extends DomainResource { - - public enum Referralstatus implements FhirEnum { - /** - * A draft referral that has yet to be send. - */ - DRAFT, - /** - * The referral has been transmitted, but not yet acknowledged by the recipient. - */ - SENT, - /** - * The referral has been acknowledged by the recipient, and is in the process of being actioned. - */ - ACTIVE, - /** - * The referral has been cancelled without being completed. For example it is no longer needed. - */ - CANCELLED, - /** - * The recipient has declined to accept the referral. - */ - REFUSED, - /** - * The referral has been completely actioned. - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - - public static final ReferralstatusEnumFactory ENUM_FACTORY = new ReferralstatusEnumFactory(); - - public static Referralstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("sent".equals(codeString)) - return SENT; - if ("active".equals(codeString)) - return ACTIVE; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("refused".equals(codeString)) - return REFUSED; - if ("completed".equals(codeString)) - return COMPLETED; - throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case SENT: return "sent"; - case ACTIVE: return "active"; - case CANCELLED: return "cancelled"; - case REFUSED: return "refused"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case SENT: return ""; - case ACTIVE: return ""; - case CANCELLED: return ""; - case REFUSED: return ""; - case COMPLETED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "A draft referral that has yet to be send."; - case SENT: return "The referral has been transmitted, but not yet acknowledged by the recipient."; - case ACTIVE: return "The referral has been acknowledged by the recipient, and is in the process of being actioned."; - case CANCELLED: return "The referral has been cancelled without being completed. For example it is no longer needed."; - case REFUSED: return "The recipient has declined to accept the referral."; - case COMPLETED: return "The referral has been completely actioned."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "draft"; - case SENT: return "sent"; - case ACTIVE: return "active"; - case CANCELLED: return "cancelled"; - case REFUSED: return "refused"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - } - - public static class ReferralstatusEnumFactory implements EnumFactory { - public Referralstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return Referralstatus.DRAFT; - if ("sent".equals(codeString)) - return Referralstatus.SENT; - if ("active".equals(codeString)) - return Referralstatus.ACTIVE; - if ("cancelled".equals(codeString)) - return Referralstatus.CANCELLED; - if ("refused".equals(codeString)) - return Referralstatus.REFUSED; - if ("completed".equals(codeString)) - return Referralstatus.COMPLETED; - throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); - } - public String toCode(Referralstatus code) throws IllegalArgumentException { - if (code == Referralstatus.DRAFT) - return "draft"; - if (code == Referralstatus.SENT) - return "sent"; - if (code == Referralstatus.ACTIVE) - return "active"; - if (code == Referralstatus.CANCELLED) - return "cancelled"; - if (code == Referralstatus.REFUSED) - return "refused"; - if (code == Referralstatus.COMPLETED) - return "completed"; - return "?"; - } - } - - /** - * The workflow status of the referral or transfer of care request. - */ - @Child(name="status", type={CodeType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="draft | sent | active | cancelled | refused | completed", formalDefinition="The workflow status of the referral or transfer of care request." ) - protected Enumeration status; - - /** - * Business Id that uniquely identifies the referral/care transfer request instance. - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Identifier of request", formalDefinition="Business Id that uniquely identifies the referral/care transfer request instance." ) - protected List identifier; - - /** - * An indication of the type of referral (or where applicable the type of transfer of care) request. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Referral/Transition of care request type", formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request." ) - protected CodeableConcept type; - - /** - * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. - */ - @Child(name="specialty", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="The clinical specialty (discipline) that the referral is requested for", formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent." ) - protected CodeableConcept specialty; - - /** - * An indication of the urgency of referral (or where applicable the type of transfer of care) request. - */ - @Child(name="priority", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Urgency of referral / transfer of care request", formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request." ) - protected CodeableConcept priority; - - /** - * The patient who is the subject of a referral or transfer of care request. - */ - @Child(name="patient", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Patient referred to care or transfer", formalDefinition="The patient who is the subject of a referral or transfer of care request." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who is the subject of a referral or transfer of care request.) - */ - protected Patient patientTarget; - - /** - * The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral). - */ - @Child(name="requester", type={Practitioner.class, Organization.class, Patient.class}, order=5, min=0, max=1) - @Description(shortDefinition="Requester of referral / transfer of care", formalDefinition="The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral)." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - protected Resource requesterTarget; - - /** - * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. - */ - @Child(name="recipient", type={Practitioner.class, Organization.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Receiver of referral / transfer of care request", formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - protected List recipientTarget; - - - /** - * The encounter at which the request for referral or transfer of care is initiated. - */ - @Child(name="encounter", type={Encounter.class}, order=7, min=0, max=1) - @Description(shortDefinition="Encounter", formalDefinition="The encounter at which the request for referral or transfer of care is initiated." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter at which the request for referral or transfer of care is initiated.) - */ - protected Encounter encounterTarget; - - /** - * Date/DateTime the request for referral or transfer of care is sent by the author. - */ - @Child(name="dateSent", type={DateTimeType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Date referral/transfer of care request is sent", formalDefinition="Date/DateTime the request for referral or transfer of care is sent by the author." ) - protected DateTimeType dateSent; - - /** - * Description of clinical condition indicating why referral/transfer of care is requested. - */ - @Child(name="reason", type={CodeableConcept.class}, order=9, min=0, max=1) - @Description(shortDefinition="Reason for referral / Transfer of care request", formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested." ) - protected CodeableConcept reason; - - /** - * The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - @Child(name="description", type={StringType.class}, order=10, min=0, max=1) - @Description(shortDefinition="A textual description of the referral", formalDefinition="The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." ) - protected StringType description; - - /** - * The service(s) that is/are requested to be provided to the patient. - */ - @Child(name="serviceRequested", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Service(s) requested", formalDefinition="The service(s) that is/are requested to be provided to the patient." ) - protected List serviceRequested; - - /** - * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. - */ - @Child(name="supportingInformation", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additonal information to support referral or transfer of care request", formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - protected List supportingInformationTarget; - - - /** - * The period of time within which the services identified in the referral/transfer of care is specified or required to occur. - */ - @Child(name="fulfillmentTime", type={Period.class}, order=13, min=0, max=1) - @Description(shortDefinition="Requested service(s) fulfillment time", formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." ) - protected Period fulfillmentTime; - - private static final long serialVersionUID = -1139252216L; - - public ReferralRequest() { - super(); - } - - public ReferralRequest(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #status} (The workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ReferralRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow status of the referral or transfer of care request. - */ - public Referralstatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow status of the referral or transfer of care request. - */ - public ReferralRequest setStatus(Referralstatus value) { - if (this.status == null) - this.status = new Enumeration(Referralstatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Business Id that uniquely identifies the referral/care transfer request instance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Business Id that uniquely identifies the referral/care transfer request instance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) - */ - public ReferralRequest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) - */ - public CodeableConcept getSpecialty() { - if (this.specialty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.specialty"); - else if (Configuration.doAutoCreate()) - this.specialty = new CodeableConcept(); - return this.specialty; - } - - public boolean hasSpecialty() { - return this.specialty != null && !this.specialty.isEmpty(); - } - - /** - * @param value {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) - */ - public ReferralRequest setSpecialty(CodeableConcept value) { - this.specialty = value; - return this; - } - - /** - * @return {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) - */ - public ReferralRequest setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #patient} (The patient who is the subject of a referral or transfer of care request.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.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} (The patient who is the subject of a referral or transfer of care request.) - */ - public ReferralRequest 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. (The patient who is the subject of a referral or transfer of care request.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.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. (The patient who is the subject of a referral or transfer of care request.) - */ - public ReferralRequest setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public ReferralRequest setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} 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 healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} 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 healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public ReferralRequest setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - 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 healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - 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 healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #encounter} (The encounter at which the request for referral or transfer of care is initiated.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.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 at which the request for referral or transfer of care is initiated.) - */ - public ReferralRequest 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 at which the request for referral or transfer of care is initiated.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.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 at which the request for referral or transfer of care is initiated.) - */ - public ReferralRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value - */ - public DateTimeType getDateSentElement() { - if (this.dateSent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.dateSent"); - else if (Configuration.doAutoCreate()) - this.dateSent = new DateTimeType(); - return this.dateSent; - } - - public boolean hasDateSentElement() { - return this.dateSent != null && !this.dateSent.isEmpty(); - } - - public boolean hasDateSent() { - return this.dateSent != null && !this.dateSent.isEmpty(); - } - - /** - * @param value {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value - */ - public ReferralRequest setDateSentElement(DateTimeType value) { - this.dateSent = value; - return this; - } - - /** - * @return Date/DateTime the request for referral or transfer of care is sent by the author. - */ - public Date getDateSent() { - return this.dateSent == null ? null : this.dateSent.getValue(); - } - - /** - * @param value Date/DateTime the request for referral or transfer of care is sent by the author. - */ - public ReferralRequest setDateSent(Date value) { - if (value == null) - this.dateSent = null; - else { - if (this.dateSent == null) - this.dateSent = new DateTimeType(); - this.dateSent.setValue(value); - } - return this; - } - - /** - * @return {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) - */ - public ReferralRequest setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #description} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). 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 ReferralRequest.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} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ReferralRequest setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - public ReferralRequest setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) - */ - public List getServiceRequested() { - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - return this.serviceRequested; - } - - public boolean hasServiceRequested() { - if (this.serviceRequested == null) - return false; - for (CodeableConcept item : this.serviceRequested) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) - */ - // syntactic sugar - public CodeableConcept addServiceRequested() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - this.serviceRequested.add(t); - return t; - } - - /** - * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - /** - * @return {@link #supportingInformation} (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. Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - /** - * @return {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) - */ - public Period getFulfillmentTime() { - if (this.fulfillmentTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.fulfillmentTime"); - else if (Configuration.doAutoCreate()) - this.fulfillmentTime = new Period(); - return this.fulfillmentTime; - } - - public boolean hasFulfillmentTime() { - return this.fulfillmentTime != null && !this.fulfillmentTime.isEmpty(); - } - - /** - * @param value {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) - */ - public ReferralRequest setFulfillmentTime(Period value) { - this.fulfillmentTime = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The workflow status of the referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("identifier", "Identifier", "Business Id that uniquely identifies the referral/care transfer request instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "An indication of the type of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("specialty", "CodeableConcept", "Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("priority", "CodeableConcept", "An indication of the urgency of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who is the subject of a referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient)", "The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("recipient", "Reference(Practitioner|Organization)", "The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter at which the request for referral or transfer of care is initiated.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("dateSent", "dateTime", "Date/DateTime the request for referral or transfer of care is sent by the author.", 0, java.lang.Integer.MAX_VALUE, dateSent)); - childrenList.add(new Property("reason", "CodeableConcept", "Description of clinical condition indicating why referral/transfer of care is requested.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("description", "string", "The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("serviceRequested", "CodeableConcept", "The service(s) that is/are requested to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, serviceRequested)); - childrenList.add(new Property("supportingInformation", "Reference(Any)", "Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("fulfillmentTime", "Period", "The period of time within which the services identified in the referral/transfer of care is specified or required to occur.", 0, java.lang.Integer.MAX_VALUE, fulfillmentTime)); - } - - public ReferralRequest copy() { - ReferralRequest dst = new ReferralRequest(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.specialty = specialty == null ? null : specialty.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.requester = requester == null ? null : requester.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - dst.dateSent = dateSent == null ? null : dateSent.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.description = description == null ? null : description.copy(); - if (serviceRequested != null) { - dst.serviceRequested = new ArrayList(); - for (CodeableConcept i : serviceRequested) - dst.serviceRequested.add(i.copy()); - }; - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - dst.fulfillmentTime = fulfillmentTime == null ? null : fulfillmentTime.copy(); - return dst; - } - - protected ReferralRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) && (priority == null || priority.isEmpty()) - && (patient == null || patient.isEmpty()) && (requester == null || requester.isEmpty()) && (recipient == null || recipient.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (dateSent == null || dateSent.isEmpty()) - && (reason == null || reason.isEmpty()) && (description == null || description.isEmpty()) - && (serviceRequested == null || serviceRequested.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) - && (fulfillmentTime == null || fulfillmentTime.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ReferralRequest; - } - - @SearchParamDefinition(name="patient", path="ReferralRequest.patient", description="Who the referral is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="ReferralRequest.status", description="The status of the referral", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="type", path="ReferralRequest.type", description="The type of the referral", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token" ) - public static final String SP_SPECIALTY = "specialty"; - @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - -} - + +/* + 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; +/** + * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation. + */ +@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") +public class ReferralRequest extends DomainResource { + + public enum Referralstatus implements FhirEnum { + /** + * A draft referral that has yet to be send. + */ + DRAFT, + /** + * The referral has been transmitted, but not yet acknowledged by the recipient. + */ + SENT, + /** + * The referral has been acknowledged by the recipient, and is in the process of being actioned. + */ + ACTIVE, + /** + * The referral has been cancelled without being completed. For example it is no longer needed. + */ + CANCELLED, + /** + * The recipient has declined to accept the referral. + */ + REFUSED, + /** + * The referral has been completely actioned. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + + public static final ReferralstatusEnumFactory ENUM_FACTORY = new ReferralstatusEnumFactory(); + + public static Referralstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return DRAFT; + if ("sent".equals(codeString)) + return SENT; + if ("active".equals(codeString)) + return ACTIVE; + if ("cancelled".equals(codeString)) + return CANCELLED; + if ("refused".equals(codeString)) + return REFUSED; + if ("completed".equals(codeString)) + return COMPLETED; + throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case SENT: return "sent"; + case ACTIVE: return "active"; + case CANCELLED: return "cancelled"; + case REFUSED: return "refused"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case SENT: return ""; + case ACTIVE: return ""; + case CANCELLED: return ""; + case REFUSED: return ""; + case COMPLETED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "A draft referral that has yet to be send."; + case SENT: return "The referral has been transmitted, but not yet acknowledged by the recipient."; + case ACTIVE: return "The referral has been acknowledged by the recipient, and is in the process of being actioned."; + case CANCELLED: return "The referral has been cancelled without being completed. For example it is no longer needed."; + case REFUSED: return "The recipient has declined to accept the referral."; + case COMPLETED: return "The referral has been completely actioned."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "draft"; + case SENT: return "sent"; + case ACTIVE: return "active"; + case CANCELLED: return "cancelled"; + case REFUSED: return "refused"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + } + + public static class ReferralstatusEnumFactory implements EnumFactory { + public Referralstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return Referralstatus.DRAFT; + if ("sent".equals(codeString)) + return Referralstatus.SENT; + if ("active".equals(codeString)) + return Referralstatus.ACTIVE; + if ("cancelled".equals(codeString)) + return Referralstatus.CANCELLED; + if ("refused".equals(codeString)) + return Referralstatus.REFUSED; + if ("completed".equals(codeString)) + return Referralstatus.COMPLETED; + throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); + } + public String toCode(Referralstatus code) throws IllegalArgumentException { + if (code == Referralstatus.DRAFT) + return "draft"; + if (code == Referralstatus.SENT) + return "sent"; + if (code == Referralstatus.ACTIVE) + return "active"; + if (code == Referralstatus.CANCELLED) + return "cancelled"; + if (code == Referralstatus.REFUSED) + return "refused"; + if (code == Referralstatus.COMPLETED) + return "completed"; + return "?"; + } + } + + /** + * The workflow status of the referral or transfer of care request. + */ + @Child(name="status", type={CodeType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="draft | sent | active | cancelled | refused | completed", formalDefinition="The workflow status of the referral or transfer of care request." ) + protected Enumeration status; + + /** + * Business Id that uniquely identifies the referral/care transfer request instance. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Identifier of request", formalDefinition="Business Id that uniquely identifies the referral/care transfer request instance." ) + protected List identifier; + + /** + * An indication of the type of referral (or where applicable the type of transfer of care) request. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Referral/Transition of care request type", formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request." ) + protected CodeableConcept type; + + /** + * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. + */ + @Child(name="specialty", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="The clinical specialty (discipline) that the referral is requested for", formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent." ) + protected CodeableConcept specialty; + + /** + * An indication of the urgency of referral (or where applicable the type of transfer of care) request. + */ + @Child(name="priority", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Urgency of referral / transfer of care request", formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request." ) + protected CodeableConcept priority; + + /** + * The patient who is the subject of a referral or transfer of care request. + */ + @Child(name="patient", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Patient referred to care or transfer", formalDefinition="The patient who is the subject of a referral or transfer of care request." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient who is the subject of a referral or transfer of care request.) + */ + protected Patient patientTarget; + + /** + * The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral). + */ + @Child(name="requester", type={Practitioner.class, Organization.class, Patient.class}, order=5, min=0, max=1) + @Description(shortDefinition="Requester of referral / transfer of care", formalDefinition="The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral)." ) + protected Reference requester; + + /** + * The actual object that is the target of the reference (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + protected Resource requesterTarget; + + /** + * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. + */ + @Child(name="recipient", type={Practitioner.class, Organization.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Receiver of referral / transfer of care request", formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + protected List recipientTarget; + + + /** + * The encounter at which the request for referral or transfer of care is initiated. + */ + @Child(name="encounter", type={Encounter.class}, order=7, min=0, max=1) + @Description(shortDefinition="Encounter", formalDefinition="The encounter at which the request for referral or transfer of care is initiated." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter at which the request for referral or transfer of care is initiated.) + */ + protected Encounter encounterTarget; + + /** + * Date/DateTime the request for referral or transfer of care is sent by the author. + */ + @Child(name="dateSent", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Date referral/transfer of care request is sent", formalDefinition="Date/DateTime the request for referral or transfer of care is sent by the author." ) + protected DateTimeType dateSent; + + /** + * Description of clinical condition indicating why referral/transfer of care is requested. + */ + @Child(name="reason", type={CodeableConcept.class}, order=9, min=0, max=1) + @Description(shortDefinition="Reason for referral / Transfer of care request", formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested." ) + protected CodeableConcept reason; + + /** + * The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + @Child(name="description", type={StringType.class}, order=10, min=0, max=1) + @Description(shortDefinition="A textual description of the referral", formalDefinition="The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." ) + protected StringType description; + + /** + * The service(s) that is/are requested to be provided to the patient. + */ + @Child(name="serviceRequested", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service(s) requested", formalDefinition="The service(s) that is/are requested to be provided to the patient." ) + protected List serviceRequested; + + /** + * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. + */ + @Child(name="supportingInformation", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additonal information to support referral or transfer of care request", formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care." ) + protected List supportingInformation; + /** + * The actual objects that are the target of the reference (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + protected List supportingInformationTarget; + + + /** + * The period of time within which the services identified in the referral/transfer of care is specified or required to occur. + */ + @Child(name="fulfillmentTime", type={Period.class}, order=13, min=0, max=1) + @Description(shortDefinition="Requested service(s) fulfillment time", formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." ) + protected Period fulfillmentTime; + + private static final long serialVersionUID = -1139252216L; + + public ReferralRequest() { + super(); + } + + public ReferralRequest(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #status} (The workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 workflow status of the referral or transfer of care request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ReferralRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The workflow status of the referral or transfer of care request. + */ + public Referralstatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The workflow status of the referral or transfer of care request. + */ + public ReferralRequest setStatus(Referralstatus value) { + if (this.status == null) + this.status = new Enumeration(Referralstatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #identifier} (Business Id that uniquely identifies the referral/care transfer request instance.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Business Id that uniquely identifies the referral/care transfer request instance.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) + */ + public ReferralRequest setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) + */ + public CodeableConcept getSpecialty() { + if (this.specialty == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.specialty"); + else if (Configuration.doAutoCreate()) + this.specialty = new CodeableConcept(); + return this.specialty; + } + + public boolean hasSpecialty() { + return this.specialty != null && !this.specialty.isEmpty(); + } + + /** + * @param value {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.) + */ + public ReferralRequest setSpecialty(CodeableConcept value) { + this.specialty = value; + return this; + } + + /** + * @return {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) + */ + public CodeableConcept getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new CodeableConcept(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) + */ + public ReferralRequest setPriority(CodeableConcept value) { + this.priority = value; + return this; + } + + /** + * @return {@link #patient} (The patient who is the subject of a referral or transfer of care request.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.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} (The patient who is the subject of a referral or transfer of care request.) + */ + public ReferralRequest 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. (The patient who is the subject of a referral or transfer of care request.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.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. (The patient who is the subject of a referral or transfer of care request.) + */ + public ReferralRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public Reference getRequester() { + if (this.requester == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.requester"); + else if (Configuration.doAutoCreate()) + this.requester = new Reference(); + return this.requester; + } + + public boolean hasRequester() { + return this.requester != null && !this.requester.isEmpty(); + } + + /** + * @param value {@link #requester} (The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public ReferralRequest setRequester(Reference value) { + this.requester = value; + return this; + } + + /** + * @return {@link #requester} 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 healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public Resource getRequesterTarget() { + return this.requesterTarget; + } + + /** + * @param value {@link #requester} 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 healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).) + */ + public ReferralRequest setRequesterTarget(Resource value) { + this.requesterTarget = value; + return this; + } + + /** + * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + 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 healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + 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 healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #encounter} (The encounter at which the request for referral or transfer of care is initiated.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.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 at which the request for referral or transfer of care is initiated.) + */ + public ReferralRequest 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 at which the request for referral or transfer of care is initiated.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.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 at which the request for referral or transfer of care is initiated.) + */ + public ReferralRequest setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value + */ + public DateTimeType getDateSentElement() { + if (this.dateSent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.dateSent"); + else if (Configuration.doAutoCreate()) + this.dateSent = new DateTimeType(); + return this.dateSent; + } + + public boolean hasDateSentElement() { + return this.dateSent != null && !this.dateSent.isEmpty(); + } + + public boolean hasDateSent() { + return this.dateSent != null && !this.dateSent.isEmpty(); + } + + /** + * @param value {@link #dateSent} (Date/DateTime the request for referral or transfer of care is sent by the author.). This is the underlying object with id, value and extensions. The accessor "getDateSent" gives direct access to the value + */ + public ReferralRequest setDateSentElement(DateTimeType value) { + this.dateSent = value; + return this; + } + + /** + * @return Date/DateTime the request for referral or transfer of care is sent by the author. + */ + public Date getDateSent() { + return this.dateSent == null ? null : this.dateSent.getValue(); + } + + /** + * @param value Date/DateTime the request for referral or transfer of care is sent by the author. + */ + public ReferralRequest setDateSent(Date value) { + if (value == null) + this.dateSent = null; + else { + if (this.dateSent == null) + this.dateSent = new DateTimeType(); + this.dateSent.setValue(value); + } + return this; + } + + /** + * @return {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) + */ + public CodeableConcept getReason() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new CodeableConcept(); + return this.reason; + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested.) + */ + public ReferralRequest setReason(CodeableConcept value) { + this.reason = value; + return this; + } + + /** + * @return {@link #description} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). 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 ReferralRequest.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} (The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ReferralRequest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + */ + public ReferralRequest setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) + */ + public List getServiceRequested() { + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + return this.serviceRequested; + } + + public boolean hasServiceRequested() { + if (this.serviceRequested == null) + return false; + for (CodeableConcept item : this.serviceRequested) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient.) + */ + // syntactic sugar + public CodeableConcept addServiceRequested() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.serviceRequested == null) + this.serviceRequested = new ArrayList(); + this.serviceRequested.add(t); + return t; + } + + /** + * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + public List getSupportingInformation() { + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + return this.supportingInformation; + } + + public boolean hasSupportingInformation() { + if (this.supportingInformation == null) + return false; + for (Reference item : this.supportingInformation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + // syntactic sugar + public Reference addSupportingInformation() { //3 + Reference t = new Reference(); + if (this.supportingInformation == null) + this.supportingInformation = new ArrayList(); + this.supportingInformation.add(t); + return t; + } + + /** + * @return {@link #supportingInformation} (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. Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.) + */ + public List getSupportingInformationTarget() { + if (this.supportingInformationTarget == null) + this.supportingInformationTarget = new ArrayList(); + return this.supportingInformationTarget; + } + + /** + * @return {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) + */ + public Period getFulfillmentTime() { + if (this.fulfillmentTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReferralRequest.fulfillmentTime"); + else if (Configuration.doAutoCreate()) + this.fulfillmentTime = new Period(); + return this.fulfillmentTime; + } + + public boolean hasFulfillmentTime() { + return this.fulfillmentTime != null && !this.fulfillmentTime.isEmpty(); + } + + /** + * @param value {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) + */ + public ReferralRequest setFulfillmentTime(Period value) { + this.fulfillmentTime = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("status", "code", "The workflow status of the referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("identifier", "Identifier", "Business Id that uniquely identifies the referral/care transfer request instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "An indication of the type of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("specialty", "CodeableConcept", "Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.", 0, java.lang.Integer.MAX_VALUE, specialty)); + childrenList.add(new Property("priority", "CodeableConcept", "An indication of the urgency of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient who is the subject of a referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient)", "The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral).", 0, java.lang.Integer.MAX_VALUE, requester)); + childrenList.add(new Property("recipient", "Reference(Practitioner|Organization)", "The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter at which the request for referral or transfer of care is initiated.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("dateSent", "dateTime", "Date/DateTime the request for referral or transfer of care is sent by the author.", 0, java.lang.Integer.MAX_VALUE, dateSent)); + childrenList.add(new Property("reason", "CodeableConcept", "Description of clinical condition indicating why referral/transfer of care is requested.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("description", "string", "The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("serviceRequested", "CodeableConcept", "The service(s) that is/are requested to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, serviceRequested)); + childrenList.add(new Property("supportingInformation", "Reference(Any)", "Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); + childrenList.add(new Property("fulfillmentTime", "Period", "The period of time within which the services identified in the referral/transfer of care is specified or required to occur.", 0, java.lang.Integer.MAX_VALUE, fulfillmentTime)); + } + + public ReferralRequest copy() { + ReferralRequest dst = new ReferralRequest(); + copyValues(dst); + dst.status = status == null ? null : status.copy(); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.specialty = specialty == null ? null : specialty.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.patient = patient == null ? null : patient.copy(); + dst.requester = requester == null ? null : requester.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + dst.encounter = encounter == null ? null : encounter.copy(); + dst.dateSent = dateSent == null ? null : dateSent.copy(); + dst.reason = reason == null ? null : reason.copy(); + dst.description = description == null ? null : description.copy(); + if (serviceRequested != null) { + dst.serviceRequested = new ArrayList(); + for (CodeableConcept i : serviceRequested) + dst.serviceRequested.add(i.copy()); + }; + if (supportingInformation != null) { + dst.supportingInformation = new ArrayList(); + for (Reference i : supportingInformation) + dst.supportingInformation.add(i.copy()); + }; + dst.fulfillmentTime = fulfillmentTime == null ? null : fulfillmentTime.copy(); + return dst; + } + + protected ReferralRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty()) && (priority == null || priority.isEmpty()) + && (patient == null || patient.isEmpty()) && (requester == null || requester.isEmpty()) && (recipient == null || recipient.isEmpty()) + && (encounter == null || encounter.isEmpty()) && (dateSent == null || dateSent.isEmpty()) + && (reason == null || reason.isEmpty()) && (description == null || description.isEmpty()) + && (serviceRequested == null || serviceRequested.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) + && (fulfillmentTime == null || fulfillmentTime.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ReferralRequest; + } + + @SearchParamDefinition(name="patient", path="ReferralRequest.patient", description="Who the referral is about", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="ReferralRequest.status", description="The status of the referral", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="type", path="ReferralRequest.type", description="The type of the referral", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token" ) + public static final String SP_SPECIALTY = "specialty"; + @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java index 5655e1d19fc..914853ee5b4 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java @@ -20,551 +20,551 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. - */ -@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") -public class RelatedPerson extends DomainResource { - - public enum AdministrativeGender implements FhirEnum { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - - public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); - - public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return ""; - case FEMALE: return ""; - case OTHER: return ""; - case UNKNOWN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) throws IllegalArgumentException { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - } - - /** - * Identifier for a person within a particular scope. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) - protected List identifier; - - /** - * The patient this person is related to. - */ - @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) - @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient this person is related to.) - */ - protected Patient patientTarget; - - /** - * The nature of the relationship between a patient and the related person. - */ - @Child(name="relationship", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." ) - protected CodeableConcept relationship; - - /** - * A name associated with the person. - */ - @Child(name="name", type={HumanName.class}, order=2, min=0, max=1) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected HumanName name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name="gender", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * Address where the related person can be contacted or visited. - */ - @Child(name="address", type={Address.class}, order=5, min=0, max=1) - @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." ) - protected Address address; - - /** - * Image of the person. - */ - @Child(name="photo", type={Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - private static final long serialVersionUID = 1338186224L; - - public RelatedPerson() { - super(); - } - - public RelatedPerson(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Identifier for a person within a particular scope.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #patient} (The patient this person is related to.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.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} (The patient this person is related to.) - */ - public RelatedPerson 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. (The patient this person is related to.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.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. (The patient this person is related to.) - */ - public RelatedPerson setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The nature of the relationship between a patient and the related person.) - */ - public CodeableConcept getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeableConcept(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.) - */ - public RelatedPerson setRelationship(CodeableConcept value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the person.) - */ - public RelatedPerson setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(); - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public RelatedPerson setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public RelatedPerson setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #address} (Address where the related person can be contacted or visited.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Address where the related person can be contacted or visited.) - */ - public RelatedPerson setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - } - - public RelatedPerson copy() { - RelatedPerson dst = new RelatedPerson(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.address = address == null ? null : address.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - return dst; - } - - protected RelatedPerson typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (gender == null || gender.isEmpty()) && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.RelatedPerson; - } - - @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="string" ) - public static final String SP_TELECOM = "telecom"; - @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" ) - public static final String SP_GENDER = "gender"; - @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + */ +@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") +public class RelatedPerson extends DomainResource { + + public enum AdministrativeGender implements FhirEnum { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) throws IllegalArgumentException { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + /** + * Identifier for a person within a particular scope. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) + protected List identifier; + + /** + * The patient this person is related to. + */ + @Child(name="patient", type={Patient.class}, order=0, min=1, max=1) + @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient this person is related to.) + */ + protected Patient patientTarget; + + /** + * The nature of the relationship between a patient and the related person. + */ + @Child(name="relationship", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." ) + protected CodeableConcept relationship; + + /** + * A name associated with the person. + */ + @Child(name="name", type={HumanName.class}, order=2, min=0, max=1) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected HumanName name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name="telecom", type={ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + @Child(name="gender", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) + protected Enumeration gender; + + /** + * Address where the related person can be contacted or visited. + */ + @Child(name="address", type={Address.class}, order=5, min=0, max=1) + @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." ) + protected Address address; + + /** + * Image of the person. + */ + @Child(name="photo", type={Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) + protected List photo; + + private static final long serialVersionUID = 1338186224L; + + public RelatedPerson() { + super(); + } + + public RelatedPerson(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Identifier for a person within a particular scope.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (The patient this person is related to.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.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} (The patient this person is related to.) + */ + public RelatedPerson 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. (The patient this person is related to.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.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. (The patient this person is related to.) + */ + public RelatedPerson setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #relationship} (The nature of the relationship between a patient and the related person.) + */ + public CodeableConcept getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new CodeableConcept(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.) + */ + public RelatedPerson setRelationship(CodeableConcept value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public HumanName getName() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.name"); + else if (Configuration.doAutoCreate()) + this.name = new HumanName(); + return this.name; + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (A name associated with the person.) + */ + public RelatedPerson setName(HumanName value) { + this.name = value; + return this; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public RelatedPerson setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + */ + public RelatedPerson setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #address} (Address where the related person can be contacted or visited.) + */ + public Address getAddress() { + if (this.address == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RelatedPerson.address"); + else if (Configuration.doAutoCreate()) + this.address = new Address(); + return this.address; + } + + public boolean hasAddress() { + return this.address != null && !this.address.isEmpty(); + } + + /** + * @param value {@link #address} (Address where the related person can be contacted or visited.) + */ + public RelatedPerson setAddress(Address value) { + this.address = value; + return this; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + public List getPhoto() { + if (this.photo == null) + this.photo = new ArrayList(); + return this.photo; + } + + public boolean hasPhoto() { + if (this.photo == null) + return false; + for (Attachment item : this.photo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #photo} (Image of the person.) + */ + // syntactic sugar + public Attachment addPhoto() { //3 + Attachment t = new Attachment(); + if (this.photo == null) + this.photo = new ArrayList(); + this.photo.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); + } + + public RelatedPerson copy() { + RelatedPerson dst = new RelatedPerson(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + dst.name = name == null ? null : name.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.address = address == null ? null : address.copy(); + if (photo != null) { + dst.photo = new ArrayList(); + for (Attachment i : photo) + dst.photo.add(i.copy()); + }; + return dst; + } + + protected RelatedPerson typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) + && (gender == null || gender.isEmpty()) && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.RelatedPerson; + } + + @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="string" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java index cf22395b47c..7f23648c6d3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java @@ -20,575 +20,575 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 Fri, Dec 5, 2014 09:17+1100 for FHIR v0.3.0 - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.utilities.Utilities; -/** - * Base Resource for everything. - */ -@ResourceDef(name="Resource", profile="http://hl7.org/fhir/Profile/Resource") -public abstract class Resource extends Base implements IBaseResource { - - @Block() - public static class ResourceMetaComponent extends BackboneElement { - /** - * The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. - */ - @Child(name="versionId", type={IdType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted." ) - protected IdType versionId; - - /** - * When the resource last changed - e.g. when the version changed. - */ - @Child(name="lastUpdated", type={InstantType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." ) - protected InstantType lastUpdated; - - /** - * A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url. - */ - @Child(name="profile", type={UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url." ) - protected List profile; - - /** - * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. - */ - @Child(name="security", type={Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." ) - protected List security; - - /** - * Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. - */ - @Child(name="tag", type={Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Tags applied", formalDefinition="Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." ) - protected List tag; - - private static final long serialVersionUID = 650918851L; - - public ResourceMetaComponent() { - super(); - } - - /** - * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public IdType getVersionIdElement() { - if (this.versionId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceMetaComponent.versionId"); - else if (Configuration.doAutoCreate()) - this.versionId = new IdType(); - return this.versionId; - } - - public boolean hasVersionIdElement() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - public boolean hasVersionId() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - /** - * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public ResourceMetaComponent setVersionIdElement(IdType value) { - this.versionId = value; - return this; - } - - /** - * @return The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. - */ - public String getVersionId() { - return this.versionId == null ? null : this.versionId.getValue(); - } - - /** - * @param value The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. - */ - public ResourceMetaComponent setVersionId(String value) { - if (Utilities.noString(value)) - this.versionId = null; - else { - if (this.versionId == null) - this.versionId = new IdType(); - this.versionId.setValue(value); - } - return this; - } - - /** - * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value - */ - public InstantType getLastUpdatedElement() { - if (this.lastUpdated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceMetaComponent.lastUpdated"); - else if (Configuration.doAutoCreate()) - this.lastUpdated = new InstantType(); - return this.lastUpdated; - } - - public boolean hasLastUpdatedElement() { - return this.lastUpdated != null && !this.lastUpdated.isEmpty(); - } - - public boolean hasLastUpdated() { - return this.lastUpdated != null && !this.lastUpdated.isEmpty(); - } - - /** - * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value - */ - public ResourceMetaComponent setLastUpdatedElement(InstantType value) { - this.lastUpdated = value; - return this; - } - - /** - * @return When the resource last changed - e.g. when the version changed. - */ - public Date getLastUpdated() { - return this.lastUpdated == null ? null : this.lastUpdated.getValue(); - } - - /** - * @param value When the resource last changed - e.g. when the version changed. - */ - public ResourceMetaComponent setLastUpdated(Date value) { - if (value == null) - this.lastUpdated = null; - else { - if (this.lastUpdated == null) - this.lastUpdated = new InstantType(); - this.lastUpdated.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (UriType item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) - */ - // syntactic sugar - public UriType addProfileElement() {//2 - UriType t = new UriType(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - /** - * @param value {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) - */ - public ResourceMetaComponent addProfile(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @param value {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) - */ - public boolean hasProfile(String value) { - if (this.profile == null) - return false; - for (UriType v : this.profile) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) - */ - public List getSecurity() { - if (this.security == null) - this.security = new ArrayList(); - return this.security; - } - - public boolean hasSecurity() { - if (this.security == null) - return false; - for (Coding item : this.security) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) - */ - // syntactic sugar - public Coding addSecurity() { //3 - Coding t = new Coding(); - if (this.security == null) - this.security = new ArrayList(); - this.security.add(t); - return t; - } - - /** - * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) - */ - public List getTag() { - if (this.tag == null) - this.tag = new ArrayList(); - return this.tag; - } - - public boolean hasTag() { - if (this.tag == null) - return false; - for (Coding item : this.tag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) - */ - // syntactic sugar - public Coding addTag() { //3 - Coding t = new Coding(); - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); - childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); - childrenList.add(new Property("profile", "uri", "A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); - childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); - } - - public ResourceMetaComponent copy() { - ResourceMetaComponent dst = new ResourceMetaComponent(); - copyValues(dst); - dst.versionId = versionId == null ? null : versionId.copy(); - dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); - if (profile != null) { - dst.profile = new ArrayList(); - for (UriType i : profile) - dst.profile.add(i.copy()); - }; - if (security != null) { - dst.security = new ArrayList(); - for (Coding i : security) - dst.security.add(i.copy()); - }; - if (tag != null) { - dst.tag = new ArrayList(); - for (Coding i : tag) - dst.tag.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (versionId == null || versionId.isEmpty()) && (lastUpdated == null || lastUpdated.isEmpty()) - && (profile == null || profile.isEmpty()) && (security == null || security.isEmpty()) && (tag == null || tag.isEmpty()) - ; - } - - } - - /** - * The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - @Child(name="id", type={IdType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Logical id of this artefact", formalDefinition="The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes." ) - protected IdType id; - - /** - * The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ - @Child(name="meta", type={}, order=0, min=0, max=1) - @Description(shortDefinition="Metadata about the resource", formalDefinition="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." ) - protected ResourceMetaComponent meta; - - /** - * A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - @Child(name="implicitRules", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="A set of rules under which this content was created", formalDefinition="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." ) - protected UriType implicitRules; - - /** - * The base language in which the resource is written. - */ - @Child(name="language", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Language of the resource content", formalDefinition="The base language in which the resource is written." ) - protected CodeType language; - - private static final long serialVersionUID = -519506254L; - - public Resource() { - super(); - } - - /** - * @return {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public IdType getIdElement() { - if (this.id == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.id"); - else if (Configuration.doAutoCreate()) - this.id = new IdType(); - return this.id; - } - - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); - } - - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); - } - - /** - * @param value {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public Resource setIdElement(IdType value) { - this.id = value; - return this; - } - - /** - * @return The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - public String getId() { - return this.id == null ? null : this.id.getValue(); - } - - /** - * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - public Resource setId(String value) { - if (Utilities.noString(value)) - this.id = null; - else { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); - } - return this; - } - - /** - * @return {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) - */ - public ResourceMetaComponent getMeta() { - if (this.meta == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.meta"); - else if (Configuration.doAutoCreate()) - this.meta = new ResourceMetaComponent(); - return this.meta; - } - - public boolean hasMeta() { - return this.meta != null && !this.meta.isEmpty(); - } - - /** - * @param value {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) - */ - public Resource setMeta(ResourceMetaComponent value) { - this.meta = value; - return this; - } - - /** - * @return {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value - */ - public UriType getImplicitRulesElement() { - if (this.implicitRules == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.implicitRules"); - else if (Configuration.doAutoCreate()) - this.implicitRules = new UriType(); - return this.implicitRules; - } - - public boolean hasImplicitRulesElement() { - return this.implicitRules != null && !this.implicitRules.isEmpty(); - } - - public boolean hasImplicitRules() { - return this.implicitRules != null && !this.implicitRules.isEmpty(); - } - - /** - * @param value {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value - */ - public Resource setImplicitRulesElement(UriType value) { - this.implicitRules = value; - return this; - } - - /** - * @return A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - public String getImplicitRules() { - return this.implicitRules == null ? null : this.implicitRules.getValue(); - } - - /** - * @param value A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - public Resource setImplicitRules(String value) { - if (Utilities.noString(value)) - this.implicitRules = null; - else { - if (this.implicitRules == null) - this.implicitRules = new UriType(); - this.implicitRules.setValue(value); - } - return this; - } - - /** - * @return {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public Resource setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The base language in which the resource is written. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The base language in which the resource is written. - */ - public Resource setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("id", "id", "The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.", 0, java.lang.Integer.MAX_VALUE, id)); - childrenList.add(new Property("meta", "", "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.", 0, java.lang.Integer.MAX_VALUE, meta)); - childrenList.add(new Property("implicitRules", "uri", "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.", 0, java.lang.Integer.MAX_VALUE, implicitRules)); - childrenList.add(new Property("language", "code", "The base language in which the resource is written.", 0, java.lang.Integer.MAX_VALUE, language)); - } - - public abstract Resource copy(); - - public void copyValues(Resource dst) { - dst.id = id == null ? null : id.copy(); - dst.meta = meta == null ? null : meta.copy(); - dst.implicitRules = implicitRules == null ? null : implicitRules.copy(); - dst.language = language == null ? null : language.copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (id == null || id.isEmpty()) && (meta == null || meta.isEmpty()) && (implicitRules == null || implicitRules.isEmpty()) - && (language == null || language.isEmpty()); - } - - public abstract ResourceType getResourceType(); - -} - + +/* + 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 Fri, Dec 5, 2014 09:17+1100 for FHIR v0.3.0 + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.utilities.Utilities; +/** + * Base Resource for everything. + */ +@ResourceDef(name="Resource", profile="http://hl7.org/fhir/Profile/Resource") +public abstract class Resource extends Base implements IBaseResource { + + @Block() + public static class ResourceMetaComponent extends BackboneElement { + /** + * The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + */ + @Child(name="versionId", type={IdType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted." ) + protected IdType versionId; + + /** + * When the resource last changed - e.g. when the version changed. + */ + @Child(name="lastUpdated", type={InstantType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." ) + protected InstantType lastUpdated; + + /** + * A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url. + */ + @Child(name="profile", type={UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url." ) + protected List profile; + + /** + * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. + */ + @Child(name="security", type={Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." ) + protected List security; + + /** + * Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. + */ + @Child(name="tag", type={Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Tags applied", formalDefinition="Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." ) + protected List tag; + + private static final long serialVersionUID = 650918851L; + + public ResourceMetaComponent() { + super(); + } + + /** + * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public IdType getVersionIdElement() { + if (this.versionId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResourceMetaComponent.versionId"); + else if (Configuration.doAutoCreate()) + this.versionId = new IdType(); + return this.versionId; + } + + public boolean hasVersionIdElement() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + public boolean hasVersionId() { + return this.versionId != null && !this.versionId.isEmpty(); + } + + /** + * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value + */ + public ResourceMetaComponent setVersionIdElement(IdType value) { + this.versionId = value; + return this; + } + + /** + * @return The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + */ + public String getVersionId() { + return this.versionId == null ? null : this.versionId.getValue(); + } + + /** + * @param value The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + */ + public ResourceMetaComponent setVersionId(String value) { + if (Utilities.noString(value)) + this.versionId = null; + else { + if (this.versionId == null) + this.versionId = new IdType(); + this.versionId.setValue(value); + } + return this; + } + + /** + * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value + */ + public InstantType getLastUpdatedElement() { + if (this.lastUpdated == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ResourceMetaComponent.lastUpdated"); + else if (Configuration.doAutoCreate()) + this.lastUpdated = new InstantType(); + return this.lastUpdated; + } + + public boolean hasLastUpdatedElement() { + return this.lastUpdated != null && !this.lastUpdated.isEmpty(); + } + + public boolean hasLastUpdated() { + return this.lastUpdated != null && !this.lastUpdated.isEmpty(); + } + + /** + * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value + */ + public ResourceMetaComponent setLastUpdatedElement(InstantType value) { + this.lastUpdated = value; + return this; + } + + /** + * @return When the resource last changed - e.g. when the version changed. + */ + public Date getLastUpdated() { + return this.lastUpdated == null ? null : this.lastUpdated.getValue(); + } + + /** + * @param value When the resource last changed - e.g. when the version changed. + */ + public ResourceMetaComponent setLastUpdated(Date value) { + if (value == null) + this.lastUpdated = null; + else { + if (this.lastUpdated == null) + this.lastUpdated = new InstantType(); + this.lastUpdated.setValue(value); + } + return this; + } + + /** + * @return {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) + */ + public List getProfile() { + if (this.profile == null) + this.profile = new ArrayList(); + return this.profile; + } + + public boolean hasProfile() { + if (this.profile == null) + return false; + for (UriType item : this.profile) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) + */ + // syntactic sugar + public UriType addProfileElement() {//2 + UriType t = new UriType(); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return t; + } + + /** + * @param value {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) + */ + public ResourceMetaComponent addProfile(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.profile == null) + this.profile = new ArrayList(); + this.profile.add(t); + return this; + } + + /** + * @param value {@link #profile} (A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.) + */ + public boolean hasProfile(String value) { + if (this.profile == null) + return false; + for (UriType v : this.profile) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) + */ + public List getSecurity() { + if (this.security == null) + this.security = new ArrayList(); + return this.security; + } + + public boolean hasSecurity() { + if (this.security == null) + return false; + for (Coding item : this.security) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) + */ + // syntactic sugar + public Coding addSecurity() { //3 + Coding t = new Coding(); + if (this.security == null) + this.security = new ArrayList(); + this.security.add(t); + return t; + } + + /** + * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) + */ + public List getTag() { + if (this.tag == null) + this.tag = new ArrayList(); + return this.tag; + } + + public boolean hasTag() { + if (this.tag == null) + return false; + for (Coding item : this.tag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #tag} (Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) + */ + // syntactic sugar + public Coding addTag() { //3 + Coding t = new Coding(); + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); + childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); + childrenList.add(new Property("profile", "uri", "A list of profiles that this resource claims to conform to. The URL is a reference to Profile.url.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); + childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); + } + + public ResourceMetaComponent copy() { + ResourceMetaComponent dst = new ResourceMetaComponent(); + copyValues(dst); + dst.versionId = versionId == null ? null : versionId.copy(); + dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); + if (profile != null) { + dst.profile = new ArrayList(); + for (UriType i : profile) + dst.profile.add(i.copy()); + }; + if (security != null) { + dst.security = new ArrayList(); + for (Coding i : security) + dst.security.add(i.copy()); + }; + if (tag != null) { + dst.tag = new ArrayList(); + for (Coding i : tag) + dst.tag.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (versionId == null || versionId.isEmpty()) && (lastUpdated == null || lastUpdated.isEmpty()) + && (profile == null || profile.isEmpty()) && (security == null || security.isEmpty()) && (tag == null || tag.isEmpty()) + ; + } + + } + + /** + * The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + @Child(name="id", type={IdType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Logical id of this artefact", formalDefinition="The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes." ) + protected IdType id; + + /** + * The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + */ + @Child(name="meta", type={}, order=0, min=0, max=1) + @Description(shortDefinition="Metadata about the resource", formalDefinition="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." ) + protected ResourceMetaComponent meta; + + /** + * A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + @Child(name="implicitRules", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="A set of rules under which this content was created", formalDefinition="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." ) + protected UriType implicitRules; + + /** + * The base language in which the resource is written. + */ + @Child(name="language", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Language of the resource content", formalDefinition="The base language in which the resource is written." ) + protected CodeType language; + + private static final long serialVersionUID = -519506254L; + + public Resource() { + super(); + } + + /** + * @return {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public IdType getIdElement() { + if (this.id == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.id"); + else if (Configuration.doAutoCreate()) + this.id = new IdType(); + return this.id; + } + + public boolean hasIdElement() { + return this.id != null && !this.id.isEmpty(); + } + + public boolean hasId() { + return this.id != null && !this.id.isEmpty(); + } + + /** + * @param value {@link #id} (The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + */ + public Resource setIdElement(IdType value) { + this.id = value; + return this; + } + + /** + * @return The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + public String getId() { + return this.id == null ? null : this.id.getValue(); + } + + /** + * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + */ + public Resource setId(String value) { + if (Utilities.noString(value)) + this.id = null; + else { + if (this.id == null) + this.id = new IdType(); + this.id.setValue(value); + } + return this; + } + + /** + * @return {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) + */ + public ResourceMetaComponent getMeta() { + if (this.meta == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.meta"); + else if (Configuration.doAutoCreate()) + this.meta = new ResourceMetaComponent(); + return this.meta; + } + + public boolean hasMeta() { + return this.meta != null && !this.meta.isEmpty(); + } + + /** + * @param value {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) + */ + public Resource setMeta(ResourceMetaComponent value) { + this.meta = value; + return this; + } + + /** + * @return {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value + */ + public UriType getImplicitRulesElement() { + if (this.implicitRules == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.implicitRules"); + else if (Configuration.doAutoCreate()) + this.implicitRules = new UriType(); + return this.implicitRules; + } + + public boolean hasImplicitRulesElement() { + return this.implicitRules != null && !this.implicitRules.isEmpty(); + } + + public boolean hasImplicitRules() { + return this.implicitRules != null && !this.implicitRules.isEmpty(); + } + + /** + * @param value {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value + */ + public Resource setImplicitRulesElement(UriType value) { + this.implicitRules = value; + return this; + } + + /** + * @return A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + public String getImplicitRules() { + return this.implicitRules == null ? null : this.implicitRules.getValue(); + } + + /** + * @param value A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + */ + public Resource setImplicitRules(String value) { + if (Utilities.noString(value)) + this.implicitRules = null; + else { + if (this.implicitRules == null) + this.implicitRules = new UriType(); + this.implicitRules.setValue(value); + } + return this; + } + + /** + * @return {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Resource.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public Resource setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The base language in which the resource is written. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The base language in which the resource is written. + */ + public Resource setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + childrenList.add(new Property("id", "id", "The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes.", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("meta", "", "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.", 0, java.lang.Integer.MAX_VALUE, meta)); + childrenList.add(new Property("implicitRules", "uri", "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.", 0, java.lang.Integer.MAX_VALUE, implicitRules)); + childrenList.add(new Property("language", "code", "The base language in which the resource is written.", 0, java.lang.Integer.MAX_VALUE, language)); + } + + public abstract Resource copy(); + + public void copyValues(Resource dst) { + dst.id = id == null ? null : id.copy(); + dst.meta = meta == null ? null : meta.copy(); + dst.implicitRules = implicitRules == null ? null : implicitRules.copy(); + dst.language = language == null ? null : language.copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (id == null || id.isEmpty()) && (meta == null || meta.isEmpty()) && (implicitRules == null || implicitRules.isEmpty()) + && (language == null || language.isEmpty()); + } + + public abstract ResourceType getResourceType(); + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java index 10ee0dec4cf..d0a7d5b9cc4 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceEnumerations.java @@ -20,18 +20,18 @@ package org.hl7.fhir.instance.model; * #L% */ - -public class ResourceEnumerations { - - @SuppressWarnings("rawtypes") - public static EnumFactory getEnumFactory(Class clss) { - if (clss == HumanName.NameUse.class) - return new HumanName.NameUseEnumFactory(); - if (clss == Observation.ObservationReliability.class) - return new Observation.ObservationReliabilityEnumFactory(); - if (clss == Observation.ObservationStatus.class) - return new Observation.ObservationStatusEnumFactory(); - return null; - } - -} + +public class ResourceEnumerations { + + @SuppressWarnings("rawtypes") + public static EnumFactory getEnumFactory(Class clss) { + if (clss == HumanName.NameUse.class) + return new HumanName.NameUseEnumFactory(); + if (clss == Observation.ObservationReliability.class) + return new Observation.ObservationReliabilityEnumFactory(); + if (clss == Observation.ObservationStatus.class) + return new Observation.ObservationStatusEnumFactory(); + return null; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java index cda850dd21d..bb609ff77c8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java @@ -20,316 +20,316 @@ package org.hl7.fhir.instance.model; * #L% */ - -// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 - -public enum ResourceType { - Condition, - Supply, - DeviceComponent, - Communication, - Group, - ValueSet, - OralHealthClaim, - Coverage, - Appointment, - Slot, - Contraindication, - Composition, - Conformance, - NamingSystem, - Profile, - HealthcareService, - OrderResponse, - StatusResponse, - ConceptMap, - PharmacyClaim, - Reversal, - Practitioner, - CarePlan, - ClinicalAssessment, - Substance, - DeviceUseRequest, - EligibilityRequest, - QuestionnaireAnswers, - PaymentReconciliation, - ProfessionalClaim, - ImagingObjectSelection, - OperationDefinition, - ClaimResponse, - CommunicationRequest, - RiskAssessment, - Observation, - AllergyIntolerance, - ExplanationOfBenefit, - GoalRequest, - SupportingDocumentation, - RelatedPerson, - InstitutionalClaim, - Alert, - EligibilityResponse, - Person, - StatusRequest, - ProcedureRequest, - VisionClaim, - DeviceMetric, - Organization, - Readjudicate, - ImmunizationRecommendation, - MedicationDispense, - MedicationPrescription, - PaymentNotice, - MedicationStatement, - AppointmentResponse, - Questionnaire, - OperationOutcome, - Media, - Binary, - Other, - DocumentReference, - Immunization, - ExtensionDefinition, - Bundle, - Subscription, - ImagingStudy, - Provenance, - Device, - Order, - Procedure, - DiagnosticReport, - Medication, - MessageHeader, - DocumentManifest, - DataElement, - Availability, - MedicationAdministration, - Encounter, - SecurityEvent, - PendedRequest, - List, - DeviceUseStatement, - Goal, - NutritionOrder, - SearchParameter, - ReferralRequest, - FamilyHistory, - EnrollmentRequest, - Location, - Contract, - Basic, - Specimen, - EnrollmentResponse, - Patient, - CareActivity, - CarePlan2, - DiagnosticOrder, - Parameters; - - - public String getPath() {; - switch (this) { - case Condition: - return "condition"; - case Supply: - return "supply"; - case DeviceComponent: - return "devicecomponent"; - case Communication: - return "communication"; - case Group: - return "group"; - case ValueSet: - return "valueset"; - case OralHealthClaim: - return "oralhealthclaim"; - case Coverage: - return "coverage"; - case Appointment: - return "appointment"; - case Slot: - return "slot"; - case Contraindication: - return "contraindication"; - case Composition: - return "composition"; - case Conformance: - return "conformance"; - case NamingSystem: - return "namingsystem"; - case Profile: - return "profile"; - case HealthcareService: - return "healthcareservice"; - case OrderResponse: - return "orderresponse"; - case StatusResponse: - return "statusresponse"; - case ConceptMap: - return "conceptmap"; - case PharmacyClaim: - return "pharmacyclaim"; - case Reversal: - return "reversal"; - case Practitioner: - return "practitioner"; - case CarePlan: - return "careplan"; - case ClinicalAssessment: - return "clinicalassessment"; - case Substance: - return "substance"; - case DeviceUseRequest: - return "deviceuserequest"; - case EligibilityRequest: - return "eligibilityrequest"; - case QuestionnaireAnswers: - return "questionnaireanswers"; - case PaymentReconciliation: - return "paymentreconciliation"; - case ProfessionalClaim: - return "professionalclaim"; - case ImagingObjectSelection: - return "imagingobjectselection"; - case OperationDefinition: - return "operationdefinition"; - case ClaimResponse: - return "claimresponse"; - case CommunicationRequest: - return "communicationrequest"; - case RiskAssessment: - return "riskassessment"; - case Observation: - return "observation"; - case AllergyIntolerance: - return "allergyintolerance"; - case ExplanationOfBenefit: - return "explanationofbenefit"; - case GoalRequest: - return "goalrequest"; - case SupportingDocumentation: - return "supportingdocumentation"; - case RelatedPerson: - return "relatedperson"; - case InstitutionalClaim: - return "institutionalclaim"; - case Alert: - return "alert"; - case EligibilityResponse: - return "eligibilityresponse"; - case Person: - return "person"; - case StatusRequest: - return "statusrequest"; - case ProcedureRequest: - return "procedurerequest"; - case VisionClaim: - return "visionclaim"; - case DeviceMetric: - return "devicemetric"; - case Organization: - return "organization"; - case Readjudicate: - return "readjudicate"; - case ImmunizationRecommendation: - return "immunizationrecommendation"; - case MedicationDispense: - return "medicationdispense"; - case MedicationPrescription: - return "medicationprescription"; - case PaymentNotice: - return "paymentnotice"; - case MedicationStatement: - return "medicationstatement"; - case AppointmentResponse: - return "appointmentresponse"; - case Questionnaire: - return "questionnaire"; - case OperationOutcome: - return "operationoutcome"; - case Media: - return "media"; - case Binary: - return "binary"; - case Other: - return "other"; - case DocumentReference: - return "documentreference"; - case Immunization: - return "immunization"; - case ExtensionDefinition: - return "extensiondefinition"; - case Bundle: - return "bundle"; - case Subscription: - return "subscription"; - case ImagingStudy: - return "imagingstudy"; - case Provenance: - return "provenance"; - case Device: - return "device"; - case Order: - return "order"; - case Procedure: - return "procedure"; - case DiagnosticReport: - return "diagnosticreport"; - case Medication: - return "medication"; - case MessageHeader: - return "messageheader"; - case DocumentManifest: - return "documentmanifest"; - case DataElement: - return "dataelement"; - case Availability: - return "availability"; - case MedicationAdministration: - return "medicationadministration"; - case Encounter: - return "encounter"; - case SecurityEvent: - return "securityevent"; - case PendedRequest: - return "pendedrequest"; - case List: - return "list"; - case DeviceUseStatement: - return "deviceusestatement"; - case Goal: - return "goal"; - case NutritionOrder: - return "nutritionorder"; - case SearchParameter: - return "searchparameter"; - case ReferralRequest: - return "referralrequest"; - case FamilyHistory: - return "familyhistory"; - case EnrollmentRequest: - return "enrollmentrequest"; - case Location: - return "location"; - case Contract: - return "contract"; - case Basic: - return "basic"; - case Specimen: - return "specimen"; - case EnrollmentResponse: - return "enrollmentresponse"; - case Patient: - return "patient"; - case CareActivity: - return "careactivity"; - case CarePlan2: - return "careplan2"; - case DiagnosticOrder: - return "diagnosticorder"; - case Parameters: - return "parameters"; - } - return null; - } - -} + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +public enum ResourceType { + Condition, + Supply, + DeviceComponent, + Communication, + Group, + ValueSet, + OralHealthClaim, + Coverage, + Appointment, + Slot, + Contraindication, + Composition, + Conformance, + NamingSystem, + Profile, + HealthcareService, + OrderResponse, + StatusResponse, + ConceptMap, + PharmacyClaim, + Reversal, + Practitioner, + CarePlan, + ClinicalAssessment, + Substance, + DeviceUseRequest, + EligibilityRequest, + QuestionnaireAnswers, + PaymentReconciliation, + ProfessionalClaim, + ImagingObjectSelection, + OperationDefinition, + ClaimResponse, + CommunicationRequest, + RiskAssessment, + Observation, + AllergyIntolerance, + ExplanationOfBenefit, + GoalRequest, + SupportingDocumentation, + RelatedPerson, + InstitutionalClaim, + Alert, + EligibilityResponse, + Person, + StatusRequest, + ProcedureRequest, + VisionClaim, + DeviceMetric, + Organization, + Readjudicate, + ImmunizationRecommendation, + MedicationDispense, + MedicationPrescription, + PaymentNotice, + MedicationStatement, + AppointmentResponse, + Questionnaire, + OperationOutcome, + Media, + Binary, + Other, + DocumentReference, + Immunization, + ExtensionDefinition, + Bundle, + Subscription, + ImagingStudy, + Provenance, + Device, + Order, + Procedure, + DiagnosticReport, + Medication, + MessageHeader, + DocumentManifest, + DataElement, + Availability, + MedicationAdministration, + Encounter, + SecurityEvent, + PendedRequest, + List, + DeviceUseStatement, + Goal, + NutritionOrder, + SearchParameter, + ReferralRequest, + FamilyHistory, + EnrollmentRequest, + Location, + Contract, + Basic, + Specimen, + EnrollmentResponse, + Patient, + CareActivity, + CarePlan2, + DiagnosticOrder, + Parameters; + + + public String getPath() {; + switch (this) { + case Condition: + return "condition"; + case Supply: + return "supply"; + case DeviceComponent: + return "devicecomponent"; + case Communication: + return "communication"; + case Group: + return "group"; + case ValueSet: + return "valueset"; + case OralHealthClaim: + return "oralhealthclaim"; + case Coverage: + return "coverage"; + case Appointment: + return "appointment"; + case Slot: + return "slot"; + case Contraindication: + return "contraindication"; + case Composition: + return "composition"; + case Conformance: + return "conformance"; + case NamingSystem: + return "namingsystem"; + case Profile: + return "profile"; + case HealthcareService: + return "healthcareservice"; + case OrderResponse: + return "orderresponse"; + case StatusResponse: + return "statusresponse"; + case ConceptMap: + return "conceptmap"; + case PharmacyClaim: + return "pharmacyclaim"; + case Reversal: + return "reversal"; + case Practitioner: + return "practitioner"; + case CarePlan: + return "careplan"; + case ClinicalAssessment: + return "clinicalassessment"; + case Substance: + return "substance"; + case DeviceUseRequest: + return "deviceuserequest"; + case EligibilityRequest: + return "eligibilityrequest"; + case QuestionnaireAnswers: + return "questionnaireanswers"; + case PaymentReconciliation: + return "paymentreconciliation"; + case ProfessionalClaim: + return "professionalclaim"; + case ImagingObjectSelection: + return "imagingobjectselection"; + case OperationDefinition: + return "operationdefinition"; + case ClaimResponse: + return "claimresponse"; + case CommunicationRequest: + return "communicationrequest"; + case RiskAssessment: + return "riskassessment"; + case Observation: + return "observation"; + case AllergyIntolerance: + return "allergyintolerance"; + case ExplanationOfBenefit: + return "explanationofbenefit"; + case GoalRequest: + return "goalrequest"; + case SupportingDocumentation: + return "supportingdocumentation"; + case RelatedPerson: + return "relatedperson"; + case InstitutionalClaim: + return "institutionalclaim"; + case Alert: + return "alert"; + case EligibilityResponse: + return "eligibilityresponse"; + case Person: + return "person"; + case StatusRequest: + return "statusrequest"; + case ProcedureRequest: + return "procedurerequest"; + case VisionClaim: + return "visionclaim"; + case DeviceMetric: + return "devicemetric"; + case Organization: + return "organization"; + case Readjudicate: + return "readjudicate"; + case ImmunizationRecommendation: + return "immunizationrecommendation"; + case MedicationDispense: + return "medicationdispense"; + case MedicationPrescription: + return "medicationprescription"; + case PaymentNotice: + return "paymentnotice"; + case MedicationStatement: + return "medicationstatement"; + case AppointmentResponse: + return "appointmentresponse"; + case Questionnaire: + return "questionnaire"; + case OperationOutcome: + return "operationoutcome"; + case Media: + return "media"; + case Binary: + return "binary"; + case Other: + return "other"; + case DocumentReference: + return "documentreference"; + case Immunization: + return "immunization"; + case ExtensionDefinition: + return "extensiondefinition"; + case Bundle: + return "bundle"; + case Subscription: + return "subscription"; + case ImagingStudy: + return "imagingstudy"; + case Provenance: + return "provenance"; + case Device: + return "device"; + case Order: + return "order"; + case Procedure: + return "procedure"; + case DiagnosticReport: + return "diagnosticreport"; + case Medication: + return "medication"; + case MessageHeader: + return "messageheader"; + case DocumentManifest: + return "documentmanifest"; + case DataElement: + return "dataelement"; + case Availability: + return "availability"; + case MedicationAdministration: + return "medicationadministration"; + case Encounter: + return "encounter"; + case SecurityEvent: + return "securityevent"; + case PendedRequest: + return "pendedrequest"; + case List: + return "list"; + case DeviceUseStatement: + return "deviceusestatement"; + case Goal: + return "goal"; + case NutritionOrder: + return "nutritionorder"; + case SearchParameter: + return "searchparameter"; + case ReferralRequest: + return "referralrequest"; + case FamilyHistory: + return "familyhistory"; + case EnrollmentRequest: + return "enrollmentrequest"; + case Location: + return "location"; + case Contract: + return "contract"; + case Basic: + return "basic"; + case Specimen: + return "specimen"; + case EnrollmentResponse: + return "enrollmentresponse"; + case Patient: + return "patient"; + case CareActivity: + return "careactivity"; + case CarePlan2: + return "careplan2"; + case DiagnosticOrder: + return "diagnosticorder"; + case Parameters: + return "parameters"; + } + return null; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java index 1f137c945d0..b0910ccb1f1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java @@ -20,1184 +20,1184 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides the request and response details for the request for which all actions are to be reversed or terminated. - */ -@ResourceDef(name="Reversal", profile="http://hl7.org/fhir/Profile/Reversal") -public class Reversal extends DomainResource { - - @Block() - public static class PayeeComponent extends BackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Payee Type", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="person", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class ReversalCoverageComponent extends BackboneElement { - /** - * A service line item. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line item." ) - protected IntegerType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agreement which describes the terms and conditions. - */ - @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - private static final long serialVersionUID = 735358731L; - - public ReversalCoverageComponent() { - super(); - } - - public ReversalCoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReversalCoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ReversalCoverageComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public ReversalCoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReversalCoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public ReversalCoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public boolean getFocal() { - return this.focal == null ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public ReversalCoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReversalCoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public ReversalCoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReversalCoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 ReversalCoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReversalCoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public ReversalCoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agreement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agreement which describes the terms and conditions. - */ - public ReversalCoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReversalCoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public ReversalCoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - } - - public ReversalCoverageComponent copy() { - ReversalCoverageComponent dst = new ReversalCoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()); - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Reference of resource to reverse. - */ - @Child(name="request", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource to reverse.) - */ - protected Resource requestTarget; - - /** - * Reference of response to resource to reverse. - */ - @Child(name="response", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Reference of response to resource to reverse.) - */ - protected Resource responseTarget; - - /** - * Payee information suypplied for matching purposes. - */ - @Child(name="payee", type={}, order=8, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="Payee information suypplied for matching purposes." ) - protected PayeeComponent payee; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name="coverage", type={}, order=9, min=1, max=1) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected ReversalCoverageComponent coverage; - - /** - * If true remove all history excluding audit. - */ - @Child(name="nullify", type={BooleanType.class}, order=10, min=1, max=1) - @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) - protected BooleanType nullify; - - private static final long serialVersionUID = 1077326413L; - - public Reversal() { - super(); - } - - public Reversal(ReversalCoverageComponent coverage, BooleanType nullify) { - super(); - this.coverage = coverage; - this.nullify = nullify; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 Reversal setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Reversal setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 Reversal setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public Reversal setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public Reversal setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 Reversal setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reversal setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 Reversal setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reversal setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Reversal setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public Reversal setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Reference of resource to reverse.) - */ - public Resource getRequestTarget() { - 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. (Reference of resource to reverse.) - */ - public Reversal setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource to reverse.) - */ - public Reversal setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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. (Reference of response to resource to reverse.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} 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 of response to resource to reverse.) - */ - public Reversal setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #payee} (Payee information suypplied for matching purposes.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (Payee information suypplied for matching purposes.) - */ - public Reversal setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public ReversalCoverageComponent getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new ReversalCoverageComponent(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public Reversal setCoverage(ReversalCoverageComponent value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value - */ - public BooleanType getNullifyElement() { - if (this.nullify == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.nullify"); - else if (Configuration.doAutoCreate()) - this.nullify = new BooleanType(); - return this.nullify; - } - - public boolean hasNullifyElement() { - return this.nullify != null && !this.nullify.isEmpty(); - } - - public boolean hasNullify() { - return this.nullify != null && !this.nullify.isEmpty(); - } - - /** - * @param value {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value - */ - public Reversal setNullifyElement(BooleanType value) { - this.nullify = value; - return this; - } - - /** - * @return If true remove all history excluding audit. - */ - public boolean getNullify() { - return this.nullify == null ? false : this.nullify.getValue(); - } - - /** - * @param value If true remove all history excluding audit. - */ - public Reversal setNullify(boolean value) { - if (this.nullify == null) - this.nullify = new BooleanType(); - this.nullify.setValue(value); - return this; - } - - protected void listChildren(List 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("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("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)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("payee", "", "Payee information suypplied for matching purposes.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("nullify", "boolean", "If true remove all history excluding audit.", 0, java.lang.Integer.MAX_VALUE, nullify)); - } - - public Reversal copy() { - Reversal dst = new Reversal(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.nullify = nullify == null ? null : nullify.copy(); - return dst; - } - - protected Reversal typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (payee == null || payee.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (nullify == null || nullify.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Reversal; - } - - @SearchParamDefinition(name="identifier", path="Reversal.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides the request and response details for the request for which all actions are to be reversed or terminated. + */ +@ResourceDef(name="Reversal", profile="http://hl7.org/fhir/Profile/Reversal") +public class Reversal extends DomainResource { + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Payee Type", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class ReversalCoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agreement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + private static final long serialVersionUID = 735358731L; + + public ReversalCoverageComponent() { + super(); + } + + public ReversalCoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReversalCoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ReversalCoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public ReversalCoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReversalCoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public ReversalCoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public ReversalCoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReversalCoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public ReversalCoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReversalCoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 ReversalCoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReversalCoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public ReversalCoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agreement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agreement which describes the terms and conditions. + */ + public ReversalCoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ReversalCoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public ReversalCoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + } + + public ReversalCoverageComponent copy() { + ReversalCoverageComponent dst = new ReversalCoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()); + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Reference of resource to reverse. + */ + @Child(name="request", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource to reverse.) + */ + protected Resource requestTarget; + + /** + * Reference of response to resource to reverse. + */ + @Child(name="response", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Reference of response to resource to reverse.) + */ + protected Resource responseTarget; + + /** + * Payee information suypplied for matching purposes. + */ + @Child(name="payee", type={}, order=8, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Payee information suypplied for matching purposes." ) + protected PayeeComponent payee; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=9, min=1, max=1) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected ReversalCoverageComponent coverage; + + /** + * If true remove all history excluding audit. + */ + @Child(name="nullify", type={BooleanType.class}, order=10, min=1, max=1) + @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) + protected BooleanType nullify; + + private static final long serialVersionUID = 1077326413L; + + public Reversal() { + super(); + } + + public Reversal(ReversalCoverageComponent coverage, BooleanType nullify) { + super(); + this.coverage = coverage; + this.nullify = nullify; + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 Reversal setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Reversal setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 Reversal setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public Reversal setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public Reversal setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 Reversal setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reversal setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 Reversal setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reversal setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Reversal setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public Reversal setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Reference of resource to reverse.) + */ + public Resource getRequestTarget() { + 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. (Reference of resource to reverse.) + */ + public Reversal setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource to reverse.) + */ + public Reversal setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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. (Reference of response to resource to reverse.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} 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 of response to resource to reverse.) + */ + public Reversal setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #payee} (Payee information suypplied for matching purposes.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Payee information suypplied for matching purposes.) + */ + public Reversal setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public ReversalCoverageComponent getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new ReversalCoverageComponent(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public Reversal setCoverage(ReversalCoverageComponent value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value + */ + public BooleanType getNullifyElement() { + if (this.nullify == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Reversal.nullify"); + else if (Configuration.doAutoCreate()) + this.nullify = new BooleanType(); + return this.nullify; + } + + public boolean hasNullifyElement() { + return this.nullify != null && !this.nullify.isEmpty(); + } + + public boolean hasNullify() { + return this.nullify != null && !this.nullify.isEmpty(); + } + + /** + * @param value {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value + */ + public Reversal setNullifyElement(BooleanType value) { + this.nullify = value; + return this; + } + + /** + * @return If true remove all history excluding audit. + */ + public boolean getNullify() { + return this.nullify == null ? false : this.nullify.getValue(); + } + + /** + * @param value If true remove all history excluding audit. + */ + public Reversal setNullify(boolean value) { + if (this.nullify == null) + this.nullify = new BooleanType(); + this.nullify.setValue(value); + return this; + } + + protected void listChildren(List 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("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("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)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("payee", "", "Payee information suypplied for matching purposes.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("nullify", "boolean", "If true remove all history excluding audit.", 0, java.lang.Integer.MAX_VALUE, nullify)); + } + + public Reversal copy() { + Reversal dst = new Reversal(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.nullify = nullify == null ? null : nullify.copy(); + return dst; + } + + protected Reversal typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (payee == null || payee.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (nullify == null || nullify.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Reversal; + } + + @SearchParamDefinition(name="identifier", path="Reversal.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java index 3ccf83e5478..a8c9ec0e828 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java @@ -20,827 +20,827 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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 assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ -@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/Profile/RiskAssessment") -public class RiskAssessment extends DomainResource { - - @Block() - public static class RiskAssessmentPredictionComponent extends BackboneElement { - /** - * One of the potential outcomes for the patient (e.g. remission, death, a particular condition). - */ - @Child(name="outcome", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death, a particular condition)." ) - protected CodeableConcept outcome; - - /** - * How likely is the outcome (in the specified timeframe). - */ - @Child(name="probability", type={DecimalType.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="How likely is the outcome (in the specified timeframe)." ) - protected Type probability; - - /** - * Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - @Child(name="relativeRisk", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Relative likelihood", formalDefinition="Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.)." ) - protected DecimalType relativeRisk; - - /** - * Indicates the period of time or age range of the subject to which the specified probability applies. - */ - @Child(name="when", type={Period.class, Range.class}, order=4, min=0, max=1) - @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." ) - protected Type when; - - /** - * Additional information explaining the basis for the prediction. - */ - @Child(name="rationale", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." ) - protected StringType rationale; - - private static final long serialVersionUID = 647967428L; - - public RiskAssessmentPredictionComponent() { - super(); - } - - public RiskAssessmentPredictionComponent(CodeableConcept outcome) { - super(); - this.outcome = outcome; - } - - /** - * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) - */ - public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public Type getProbability() { - return this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public DecimalType getProbabilityDecimalType() throws Exception { - if (!(this.probability instanceof DecimalType)) - throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (DecimalType) this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public Range getProbabilityRange() throws Exception { - if (!(this.probability instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (Range) this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public CodeableConcept getProbabilityCodeableConcept() throws Exception { - if (!(this.probability instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (CodeableConcept) this.probability; - } - - public boolean hasProbability() { - return this.probability != null && !this.probability.isEmpty(); - } - - /** - * @param value {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public RiskAssessmentPredictionComponent setProbability(Type value) { - this.probability = value; - return this; - } - - /** - * @return {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value - */ - public DecimalType getRelativeRiskElement() { - if (this.relativeRisk == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk"); - else if (Configuration.doAutoCreate()) - this.relativeRisk = new DecimalType(); - return this.relativeRisk; - } - - public boolean hasRelativeRiskElement() { - return this.relativeRisk != null && !this.relativeRisk.isEmpty(); - } - - public boolean hasRelativeRisk() { - return this.relativeRisk != null && !this.relativeRisk.isEmpty(); - } - - /** - * @param value {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value - */ - public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { - this.relativeRisk = value; - return this; - } - - /** - * @return Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public BigDecimal getRelativeRisk() { - return this.relativeRisk == null ? null : this.relativeRisk.getValue(); - } - - /** - * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { - if (value == null) - this.relativeRisk = null; - else { - if (this.relativeRisk == null) - this.relativeRisk = new DecimalType(); - this.relativeRisk.setValue(value); - } - return this; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Type getWhen() { - return this.when; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Period getWhenPeriod() throws Exception { - if (!(this.when instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered"); - return (Period) this.when; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Range getWhenRange() throws Exception { - if (!(this.when instanceof Range)) - throw new Exception("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered"); - return (Range) this.when; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public RiskAssessmentPredictionComponent setWhen(Type value) { - this.when = value; - return this; - } - - /** - * @return {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public StringType getRationaleElement() { - if (this.rationale == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale"); - else if (Configuration.doAutoCreate()) - this.rationale = new StringType(); - return this.rationale; - } - - public boolean hasRationaleElement() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - public boolean hasRationale() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - /** - * @param value {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { - this.rationale = value; - return this; - } - - /** - * @return Additional information explaining the basis for the prediction. - */ - public String getRationale() { - return this.rationale == null ? null : this.rationale.getValue(); - } - - /** - * @param value Additional information explaining the basis for the prediction. - */ - public RiskAssessmentPredictionComponent setRationale(String value) { - if (Utilities.noString(value)) - this.rationale = null; - else { - if (this.rationale == null) - this.rationale = new StringType(); - this.rationale.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death, a particular condition).", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("probability[x]", "decimal|Range|CodeableConcept", "How likely is the outcome (in the specified timeframe).", 0, java.lang.Integer.MAX_VALUE, probability)); - childrenList.add(new Property("relativeRisk", "decimal", "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).", 0, java.lang.Integer.MAX_VALUE, relativeRisk)); - childrenList.add(new Property("when[x]", "Period|Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, java.lang.Integer.MAX_VALUE, rationale)); - } - - public RiskAssessmentPredictionComponent copy() { - RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent(); - copyValues(dst); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.probability = probability == null ? null : probability.copy(); - dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy(); - dst.when = when == null ? null : when.copy(); - dst.rationale = rationale == null ? null : rationale.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (outcome == null || outcome.isEmpty()) && (probability == null || probability.isEmpty()) - && (relativeRisk == null || relativeRisk.isEmpty()) && (when == null || when.isEmpty()) && (rationale == null || rationale.isEmpty()) - ; - } - - } - - /** - * The patient or group the risk assessment applies to. - */ - @Child(name="subject", type={Patient.class, Group.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient or group the risk assessment applies to.) - */ - protected Resource subjectTarget; - - /** - * The date (and possibly time) the risk assessment was performed. - */ - @Child(name="date", type={DateTimeType.class}, order=0, min=0, max=1) - @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." ) - protected DateTimeType date; - - /** - * For assessments or prognosis specific to a particular condition, indicates the condition being assessed. - */ - @Child(name="condition", type={Condition.class}, order=1, min=0, max=1) - @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." ) - protected Reference condition; - - /** - * The actual object that is the target of the reference (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - protected Condition conditionTarget; - - /** - * The provider or software application that performed the assessment. - */ - @Child(name="performer", type={Practitioner.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Who did assessment?", formalDefinition="The provider or software application that performed the assessment." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (The provider or software application that performed the assessment.) - */ - protected Resource performerTarget; - - /** - * Business identifier assigned to the risk assessment. - */ - @Child(name="identifier", type={Identifier.class}, order=3, min=0, max=1) - @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." ) - protected Identifier identifier; - - /** - * The algorithm, processs or mechanism used to evaluate the risk. - */ - @Child(name="method", type={CodeableConcept.class}, order=4, min=0, max=1) - @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, processs or mechanism used to evaluate the risk." ) - protected CodeableConcept method; - - /** - * Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). - */ - @Child(name="basis", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.)." ) - protected List basis; - /** - * The actual objects that are the target of the reference (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - protected List basisTarget; - - - /** - * Describes the expected outcome for the subject. - */ - @Child(name="prediction", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." ) - protected List prediction; - - /** - * A description of the steps that might be taken to reduce the identified risk(s). - */ - @Child(name="mitigation", type={StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." ) - protected StringType mitigation; - - private static final long serialVersionUID = -1516167658L; - - public RiskAssessment() { - super(); - } - - /** - * @return {@link #subject} (The patient or group the risk assessment applies to.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.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 or group the risk assessment applies to.) - */ - public RiskAssessment 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 or group the risk assessment applies to.) - */ - public Resource getSubjectTarget() { - 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 or group the risk assessment applies to.) - */ - public RiskAssessment setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public RiskAssessment setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and possibly time) the risk assessment was performed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and possibly time) the risk assessment was performed. - */ - public RiskAssessment setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public Reference getCondition() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new Reference(); - return this.condition; - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public RiskAssessment setCondition(Reference value) { - this.condition = value; - return this; - } - - /** - * @return {@link #condition} 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. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public Condition getConditionTarget() { - if (this.conditionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.condition"); - else if (Configuration.doAutoCreate()) - this.conditionTarget = new Condition(); - return this.conditionTarget; - } - - /** - * @param value {@link #condition} 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. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public RiskAssessment setConditionTarget(Condition value) { - this.conditionTarget = value; - return this; - } - - /** - * @return {@link #performer} (The provider or software application that performed the assessment.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (The provider or software application that performed the assessment.) - */ - public RiskAssessment setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} 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 provider or software application that performed the assessment.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} 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 provider or software application that performed the assessment.) - */ - public RiskAssessment setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Business identifier assigned to the risk assessment.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Business identifier assigned to the risk assessment.) - */ - public RiskAssessment setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) - */ - public RiskAssessment setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - public List getBasis() { - if (this.basis == null) - this.basis = new ArrayList(); - return this.basis; - } - - public boolean hasBasis() { - if (this.basis == null) - return false; - for (Reference item : this.basis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - // syntactic sugar - public Reference addBasis() { //3 - Reference t = new Reference(); - if (this.basis == null) - this.basis = new ArrayList(); - this.basis.add(t); - return t; - } - - /** - * @return {@link #basis} (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. Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - public List getBasisTarget() { - if (this.basisTarget == null) - this.basisTarget = new ArrayList(); - return this.basisTarget; - } - - /** - * @return {@link #prediction} (Describes the expected outcome for the subject.) - */ - public List getPrediction() { - if (this.prediction == null) - this.prediction = new ArrayList(); - return this.prediction; - } - - public boolean hasPrediction() { - if (this.prediction == null) - return false; - for (RiskAssessmentPredictionComponent item : this.prediction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prediction} (Describes the expected outcome for the subject.) - */ - // syntactic sugar - public RiskAssessmentPredictionComponent addPrediction() { //3 - RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent(); - if (this.prediction == null) - this.prediction = new ArrayList(); - this.prediction.add(t); - return t; - } - - /** - * @return {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value - */ - public StringType getMitigationElement() { - if (this.mitigation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.mitigation"); - else if (Configuration.doAutoCreate()) - this.mitigation = new StringType(); - return this.mitigation; - } - - public boolean hasMitigationElement() { - return this.mitigation != null && !this.mitigation.isEmpty(); - } - - public boolean hasMitigation() { - return this.mitigation != null && !this.mitigation.isEmpty(); - } - - /** - * @param value {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value - */ - public RiskAssessment setMitigationElement(StringType value) { - this.mitigation = value; - return this; - } - - /** - * @return A description of the steps that might be taken to reduce the identified risk(s). - */ - public String getMitigation() { - return this.mitigation == null ? null : this.mitigation.getValue(); - } - - /** - * @param value A description of the steps that might be taken to reduce the identified risk(s). - */ - public RiskAssessment setMitigation(String value) { - if (Utilities.noString(value)) - this.mitigation = null; - else { - if (this.mitigation == null) - this.mitigation = new StringType(); - this.mitigation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("date", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("performer", "Reference(Practitioner|Device)", "The provider or software application that performed the assessment.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("method", "CodeableConcept", "The algorithm, processs or mechanism used to evaluate the risk.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("basis", "Reference(Any)", "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).", 0, java.lang.Integer.MAX_VALUE, basis)); - childrenList.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction)); - childrenList.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, java.lang.Integer.MAX_VALUE, mitigation)); - } - - public RiskAssessment copy() { - RiskAssessment dst = new RiskAssessment(); - copyValues(dst); - dst.subject = subject == null ? null : subject.copy(); - dst.date = date == null ? null : date.copy(); - dst.condition = condition == null ? null : condition.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.method = method == null ? null : method.copy(); - if (basis != null) { - dst.basis = new ArrayList(); - for (Reference i : basis) - dst.basis.add(i.copy()); - }; - if (prediction != null) { - dst.prediction = new ArrayList(); - for (RiskAssessmentPredictionComponent i : prediction) - dst.prediction.add(i.copy()); - }; - dst.mitigation = mitigation == null ? null : mitigation.copy(); - return dst; - } - - protected RiskAssessment typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (subject == null || subject.isEmpty()) && (date == null || date.isEmpty()) - && (condition == null || condition.isEmpty()) && (performer == null || performer.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (method == null || method.isEmpty()) && (basis == null || basis.isEmpty()) - && (prediction == null || prediction.isEmpty()) && (mitigation == null || mitigation.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.RiskAssessment; - } - - @SearchParamDefinition(name="patient", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="condition", path="RiskAssessment.condition", description="Condition assessed", type="reference" ) - public static final String SP_CONDITION = "condition"; - @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference" ) - public static final String SP_PERFORMER = "performer"; - @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" ) - public static final String SP_METHOD = "method"; - @SearchParamDefinition(name="date", path="RiskAssessment.date", description="When was assessment made?", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="RiskAssessment.identifier", description="Unique identifier for the assessment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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 assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + */ +@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/Profile/RiskAssessment") +public class RiskAssessment extends DomainResource { + + @Block() + public static class RiskAssessmentPredictionComponent extends BackboneElement { + /** + * One of the potential outcomes for the patient (e.g. remission, death, a particular condition). + */ + @Child(name="outcome", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death, a particular condition)." ) + protected CodeableConcept outcome; + + /** + * How likely is the outcome (in the specified timeframe). + */ + @Child(name="probability", type={DecimalType.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="How likely is the outcome (in the specified timeframe)." ) + protected Type probability; + + /** + * Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + @Child(name="relativeRisk", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Relative likelihood", formalDefinition="Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.)." ) + protected DecimalType relativeRisk; + + /** + * Indicates the period of time or age range of the subject to which the specified probability applies. + */ + @Child(name="when", type={Period.class, Range.class}, order=4, min=0, max=1) + @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." ) + protected Type when; + + /** + * Additional information explaining the basis for the prediction. + */ + @Child(name="rationale", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." ) + protected StringType rationale; + + private static final long serialVersionUID = 647967428L; + + public RiskAssessmentPredictionComponent() { + super(); + } + + public RiskAssessmentPredictionComponent(CodeableConcept outcome) { + super(); + this.outcome = outcome; + } + + /** + * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) + */ + public CodeableConcept getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new CodeableConcept(); + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) + */ + public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public Type getProbability() { + return this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public DecimalType getProbabilityDecimalType() throws Exception { + if (!(this.probability instanceof DecimalType)) + throw new Exception("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (DecimalType) this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public Range getProbabilityRange() throws Exception { + if (!(this.probability instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (Range) this.probability; + } + + /** + * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public CodeableConcept getProbabilityCodeableConcept() throws Exception { + if (!(this.probability instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.probability.getClass().getName()+" was encountered"); + return (CodeableConcept) this.probability; + } + + public boolean hasProbability() { + return this.probability != null && !this.probability.isEmpty(); + } + + /** + * @param value {@link #probability} (How likely is the outcome (in the specified timeframe).) + */ + public RiskAssessmentPredictionComponent setProbability(Type value) { + this.probability = value; + return this; + } + + /** + * @return {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value + */ + public DecimalType getRelativeRiskElement() { + if (this.relativeRisk == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk"); + else if (Configuration.doAutoCreate()) + this.relativeRisk = new DecimalType(); + return this.relativeRisk; + } + + public boolean hasRelativeRiskElement() { + return this.relativeRisk != null && !this.relativeRisk.isEmpty(); + } + + public boolean hasRelativeRisk() { + return this.relativeRisk != null && !this.relativeRisk.isEmpty(); + } + + /** + * @param value {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value + */ + public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { + this.relativeRisk = value; + return this; + } + + /** + * @return Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public BigDecimal getRelativeRisk() { + return this.relativeRisk == null ? null : this.relativeRisk.getValue(); + } + + /** + * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + */ + public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { + if (value == null) + this.relativeRisk = null; + else { + if (this.relativeRisk == null) + this.relativeRisk = new DecimalType(); + this.relativeRisk.setValue(value); + } + return this; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Type getWhen() { + return this.when; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Period getWhenPeriod() throws Exception { + if (!(this.when instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered"); + return (Period) this.when; + } + + /** + * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public Range getWhenRange() throws Exception { + if (!(this.when instanceof Range)) + throw new Exception("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered"); + return (Range) this.when; + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) + */ + public RiskAssessmentPredictionComponent setWhen(Type value) { + this.when = value; + return this; + } + + /** + * @return {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public StringType getRationaleElement() { + if (this.rationale == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale"); + else if (Configuration.doAutoCreate()) + this.rationale = new StringType(); + return this.rationale; + } + + public boolean hasRationaleElement() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + public boolean hasRationale() { + return this.rationale != null && !this.rationale.isEmpty(); + } + + /** + * @param value {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value + */ + public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { + this.rationale = value; + return this; + } + + /** + * @return Additional information explaining the basis for the prediction. + */ + public String getRationale() { + return this.rationale == null ? null : this.rationale.getValue(); + } + + /** + * @param value Additional information explaining the basis for the prediction. + */ + public RiskAssessmentPredictionComponent setRationale(String value) { + if (Utilities.noString(value)) + this.rationale = null; + else { + if (this.rationale == null) + this.rationale = new StringType(); + this.rationale.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death, a particular condition).", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("probability[x]", "decimal|Range|CodeableConcept", "How likely is the outcome (in the specified timeframe).", 0, java.lang.Integer.MAX_VALUE, probability)); + childrenList.add(new Property("relativeRisk", "decimal", "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).", 0, java.lang.Integer.MAX_VALUE, relativeRisk)); + childrenList.add(new Property("when[x]", "Period|Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, java.lang.Integer.MAX_VALUE, rationale)); + } + + public RiskAssessmentPredictionComponent copy() { + RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent(); + copyValues(dst); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.probability = probability == null ? null : probability.copy(); + dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy(); + dst.when = when == null ? null : when.copy(); + dst.rationale = rationale == null ? null : rationale.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (outcome == null || outcome.isEmpty()) && (probability == null || probability.isEmpty()) + && (relativeRisk == null || relativeRisk.isEmpty()) && (when == null || when.isEmpty()) && (rationale == null || rationale.isEmpty()) + ; + } + + } + + /** + * The patient or group the risk assessment applies to. + */ + @Child(name="subject", type={Patient.class, Group.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient or group the risk assessment applies to.) + */ + protected Resource subjectTarget; + + /** + * The date (and possibly time) the risk assessment was performed. + */ + @Child(name="date", type={DateTimeType.class}, order=0, min=0, max=1) + @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." ) + protected DateTimeType date; + + /** + * For assessments or prognosis specific to a particular condition, indicates the condition being assessed. + */ + @Child(name="condition", type={Condition.class}, order=1, min=0, max=1) + @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." ) + protected Reference condition; + + /** + * The actual object that is the target of the reference (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + protected Condition conditionTarget; + + /** + * The provider or software application that performed the assessment. + */ + @Child(name="performer", type={Practitioner.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Who did assessment?", formalDefinition="The provider or software application that performed the assessment." ) + protected Reference performer; + + /** + * The actual object that is the target of the reference (The provider or software application that performed the assessment.) + */ + protected Resource performerTarget; + + /** + * Business identifier assigned to the risk assessment. + */ + @Child(name="identifier", type={Identifier.class}, order=3, min=0, max=1) + @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." ) + protected Identifier identifier; + + /** + * The algorithm, processs or mechanism used to evaluate the risk. + */ + @Child(name="method", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, processs or mechanism used to evaluate the risk." ) + protected CodeableConcept method; + + /** + * Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). + */ + @Child(name="basis", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.)." ) + protected List basis; + /** + * The actual objects that are the target of the reference (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + protected List basisTarget; + + + /** + * Describes the expected outcome for the subject. + */ + @Child(name="prediction", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." ) + protected List prediction; + + /** + * A description of the steps that might be taken to reduce the identified risk(s). + */ + @Child(name="mitigation", type={StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." ) + protected StringType mitigation; + + private static final long serialVersionUID = -1516167658L; + + public RiskAssessment() { + super(); + } + + /** + * @return {@link #subject} (The patient or group the risk assessment applies to.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.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 or group the risk assessment applies to.) + */ + public RiskAssessment 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 or group the risk assessment applies to.) + */ + public Resource getSubjectTarget() { + 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 or group the risk assessment applies to.) + */ + public RiskAssessment setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public RiskAssessment setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date (and possibly time) the risk assessment was performed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date (and possibly time) the risk assessment was performed. + */ + public RiskAssessment setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public Reference getCondition() { + if (this.condition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.condition"); + else if (Configuration.doAutoCreate()) + this.condition = new Reference(); + return this.condition; + } + + public boolean hasCondition() { + return this.condition != null && !this.condition.isEmpty(); + } + + /** + * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public RiskAssessment setCondition(Reference value) { + this.condition = value; + return this; + } + + /** + * @return {@link #condition} 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. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public Condition getConditionTarget() { + if (this.conditionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.condition"); + else if (Configuration.doAutoCreate()) + this.conditionTarget = new Condition(); + return this.conditionTarget; + } + + /** + * @param value {@link #condition} 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. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) + */ + public RiskAssessment setConditionTarget(Condition value) { + this.conditionTarget = value; + return this; + } + + /** + * @return {@link #performer} (The provider or software application that performed the assessment.) + */ + public Reference getPerformer() { + if (this.performer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.performer"); + else if (Configuration.doAutoCreate()) + this.performer = new Reference(); + return this.performer; + } + + public boolean hasPerformer() { + return this.performer != null && !this.performer.isEmpty(); + } + + /** + * @param value {@link #performer} (The provider or software application that performed the assessment.) + */ + public RiskAssessment setPerformer(Reference value) { + this.performer = value; + return this; + } + + /** + * @return {@link #performer} 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 provider or software application that performed the assessment.) + */ + public Resource getPerformerTarget() { + return this.performerTarget; + } + + /** + * @param value {@link #performer} 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 provider or software application that performed the assessment.) + */ + public RiskAssessment setPerformerTarget(Resource value) { + this.performerTarget = value; + return this; + } + + /** + * @return {@link #identifier} (Business identifier assigned to the risk assessment.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Business identifier assigned to the risk assessment.) + */ + public RiskAssessment setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (The algorithm, processs or mechanism used to evaluate the risk.) + */ + public RiskAssessment setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + public List getBasis() { + if (this.basis == null) + this.basis = new ArrayList(); + return this.basis; + } + + public boolean hasBasis() { + if (this.basis == null) + return false; + for (Reference item : this.basis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + // syntactic sugar + public Reference addBasis() { //3 + Reference t = new Reference(); + if (this.basis == null) + this.basis = new ArrayList(); + this.basis.add(t); + return t; + } + + /** + * @return {@link #basis} (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. Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) + */ + public List getBasisTarget() { + if (this.basisTarget == null) + this.basisTarget = new ArrayList(); + return this.basisTarget; + } + + /** + * @return {@link #prediction} (Describes the expected outcome for the subject.) + */ + public List getPrediction() { + if (this.prediction == null) + this.prediction = new ArrayList(); + return this.prediction; + } + + public boolean hasPrediction() { + if (this.prediction == null) + return false; + for (RiskAssessmentPredictionComponent item : this.prediction) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #prediction} (Describes the expected outcome for the subject.) + */ + // syntactic sugar + public RiskAssessmentPredictionComponent addPrediction() { //3 + RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent(); + if (this.prediction == null) + this.prediction = new ArrayList(); + this.prediction.add(t); + return t; + } + + /** + * @return {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value + */ + public StringType getMitigationElement() { + if (this.mitigation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create RiskAssessment.mitigation"); + else if (Configuration.doAutoCreate()) + this.mitigation = new StringType(); + return this.mitigation; + } + + public boolean hasMitigationElement() { + return this.mitigation != null && !this.mitigation.isEmpty(); + } + + public boolean hasMitigation() { + return this.mitigation != null && !this.mitigation.isEmpty(); + } + + /** + * @param value {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value + */ + public RiskAssessment setMitigationElement(StringType value) { + this.mitigation = value; + return this; + } + + /** + * @return A description of the steps that might be taken to reduce the identified risk(s). + */ + public String getMitigation() { + return this.mitigation == null ? null : this.mitigation.getValue(); + } + + /** + * @param value A description of the steps that might be taken to reduce the identified risk(s). + */ + public RiskAssessment setMitigation(String value) { + if (Utilities.noString(value)) + this.mitigation = null; + else { + if (this.mitigation == null) + this.mitigation = new StringType(); + this.mitigation.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("date", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("performer", "Reference(Practitioner|Device)", "The provider or software application that performed the assessment.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("method", "CodeableConcept", "The algorithm, processs or mechanism used to evaluate the risk.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("basis", "Reference(Any)", "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).", 0, java.lang.Integer.MAX_VALUE, basis)); + childrenList.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction)); + childrenList.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, java.lang.Integer.MAX_VALUE, mitigation)); + } + + public RiskAssessment copy() { + RiskAssessment dst = new RiskAssessment(); + copyValues(dst); + dst.subject = subject == null ? null : subject.copy(); + dst.date = date == null ? null : date.copy(); + dst.condition = condition == null ? null : condition.copy(); + dst.performer = performer == null ? null : performer.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.method = method == null ? null : method.copy(); + if (basis != null) { + dst.basis = new ArrayList(); + for (Reference i : basis) + dst.basis.add(i.copy()); + }; + if (prediction != null) { + dst.prediction = new ArrayList(); + for (RiskAssessmentPredictionComponent i : prediction) + dst.prediction.add(i.copy()); + }; + dst.mitigation = mitigation == null ? null : mitigation.copy(); + return dst; + } + + protected RiskAssessment typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (subject == null || subject.isEmpty()) && (date == null || date.isEmpty()) + && (condition == null || condition.isEmpty()) && (performer == null || performer.isEmpty()) + && (identifier == null || identifier.isEmpty()) && (method == null || method.isEmpty()) && (basis == null || basis.isEmpty()) + && (prediction == null || prediction.isEmpty()) && (mitigation == null || mitigation.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.RiskAssessment; + } + + @SearchParamDefinition(name="patient", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="condition", path="RiskAssessment.condition", description="Condition assessed", type="reference" ) + public static final String SP_CONDITION = "condition"; + @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference" ) + public static final String SP_PERFORMER = "performer"; + @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" ) + public static final String SP_METHOD = "method"; + @SearchParamDefinition(name="date", path="RiskAssessment.date", description="When was assessment made?", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="RiskAssessment.identifier", description="Unique identifier for the assessment", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java index 75c2bde4414..666b27acff8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java @@ -20,454 +20,454 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - */ -@DatatypeDef(name="SampledData") -public class SampledData extends Type implements ICompositeType{ - - /** - * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. - */ - @Child(name="origin", type={Quantity.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." ) - protected Quantity origin; - - /** - * The length of time between sampling times, measured in milliseconds. - */ - @Child(name="period", type={DecimalType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." ) - protected DecimalType period; - - /** - * A correction factor that is applied to the sampled data points before they are added to the origin. - */ - @Child(name="factor", type={DecimalType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." ) - protected DecimalType factor; - - /** - * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - @Child(name="lowerLimit", type={DecimalType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit)." ) - protected DecimalType lowerLimit; - - /** - * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - @Child(name="upperLimit", type={DecimalType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit)." ) - protected DecimalType upperLimit; - - /** - * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - @Child(name="dimensions", type={IntegerType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." ) - protected IntegerType dimensions; - - /** - * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - @Child(name="data", type={StringType.class}, order=5, min=1, max=1) - @Description(shortDefinition="Decimal values with spaces, or 'E' | 'U' | 'L'", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value." ) - protected StringType data; - - private static final long serialVersionUID = 173820410L; - - public SampledData() { - super(); - } - - public SampledData(Quantity origin, DecimalType period, IntegerType dimensions, StringType data) { - super(); - this.origin = origin; - this.period = period; - this.dimensions = dimensions; - this.data = data; - } - - /** - * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) - */ - public Quantity getOrigin() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new Quantity(); - return this.origin; - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) - */ - public SampledData setOrigin(Quantity value) { - this.origin = value; - return this; - } - - /** - * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public DecimalType getPeriodElement() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.period"); - else if (Configuration.doAutoCreate()) - this.period = new DecimalType(); - return this.period; - } - - public boolean hasPeriodElement() { - return this.period != null && !this.period.isEmpty(); - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public SampledData setPeriodElement(DecimalType value) { - this.period = value; - return this; - } - - /** - * @return The length of time between sampling times, measured in milliseconds. - */ - public BigDecimal getPeriod() { - return this.period == null ? null : this.period.getValue(); - } - - /** - * @param value The length of time between sampling times, measured in milliseconds. - */ - public SampledData setPeriod(BigDecimal value) { - if (this.period == null) - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SampledData setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public SampledData setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value - */ - public DecimalType getLowerLimitElement() { - if (this.lowerLimit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.lowerLimit"); - else if (Configuration.doAutoCreate()) - this.lowerLimit = new DecimalType(); - return this.lowerLimit; - } - - public boolean hasLowerLimitElement() { - return this.lowerLimit != null && !this.lowerLimit.isEmpty(); - } - - public boolean hasLowerLimit() { - return this.lowerLimit != null && !this.lowerLimit.isEmpty(); - } - - /** - * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value - */ - public SampledData setLowerLimitElement(DecimalType value) { - this.lowerLimit = value; - return this; - } - - /** - * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public BigDecimal getLowerLimit() { - return this.lowerLimit == null ? null : this.lowerLimit.getValue(); - } - - /** - * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public SampledData setLowerLimit(BigDecimal value) { - if (value == null) - this.lowerLimit = null; - else { - if (this.lowerLimit == null) - this.lowerLimit = new DecimalType(); - this.lowerLimit.setValue(value); - } - return this; - } - - /** - * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value - */ - public DecimalType getUpperLimitElement() { - if (this.upperLimit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.upperLimit"); - else if (Configuration.doAutoCreate()) - this.upperLimit = new DecimalType(); - return this.upperLimit; - } - - public boolean hasUpperLimitElement() { - return this.upperLimit != null && !this.upperLimit.isEmpty(); - } - - public boolean hasUpperLimit() { - return this.upperLimit != null && !this.upperLimit.isEmpty(); - } - - /** - * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value - */ - public SampledData setUpperLimitElement(DecimalType value) { - this.upperLimit = value; - return this; - } - - /** - * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public BigDecimal getUpperLimit() { - return this.upperLimit == null ? null : this.upperLimit.getValue(); - } - - /** - * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public SampledData setUpperLimit(BigDecimal value) { - if (value == null) - this.upperLimit = null; - else { - if (this.upperLimit == null) - this.upperLimit = new DecimalType(); - this.upperLimit.setValue(value); - } - return this; - } - - /** - * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value - */ - public IntegerType getDimensionsElement() { - if (this.dimensions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.dimensions"); - else if (Configuration.doAutoCreate()) - this.dimensions = new IntegerType(); - return this.dimensions; - } - - public boolean hasDimensionsElement() { - return this.dimensions != null && !this.dimensions.isEmpty(); - } - - public boolean hasDimensions() { - return this.dimensions != null && !this.dimensions.isEmpty(); - } - - /** - * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value - */ - public SampledData setDimensionsElement(IntegerType value) { - this.dimensions = value; - return this; - } - - /** - * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - public int getDimensions() { - return this.dimensions == null ? null : this.dimensions.getValue(); - } - - /** - * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - public SampledData setDimensions(int value) { - if (this.dimensions == null) - this.dimensions = new IntegerType(); - this.dimensions.setValue(value); - return this; - } - - /** - * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public StringType getDataElement() { - if (this.data == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.data"); - else if (Configuration.doAutoCreate()) - this.data = new StringType(); - return this.data; - } - - public boolean hasDataElement() { - return this.data != null && !this.data.isEmpty(); - } - - public boolean hasData() { - return this.data != null && !this.data.isEmpty(); - } - - /** - * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public SampledData setDataElement(StringType value) { - this.data = value; - return this; - } - - /** - * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - public String getData() { - return this.data == null ? null : this.data.getValue(); - } - - /** - * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - public SampledData setData(String value) { - if (this.data == null) - this.data = new StringType(); - this.data.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("origin", "Quantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit)); - childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit)); - childrenList.add(new Property("dimensions", "integer", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions)); - childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - public SampledData copy() { - SampledData dst = new SampledData(); - copyValues(dst); - dst.origin = origin == null ? null : origin.copy(); - dst.period = period == null ? null : period.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); - dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); - dst.dimensions = dimensions == null ? null : dimensions.copy(); - dst.data = data == null ? null : data.copy(); - return dst; - } - - protected SampledData typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (origin == null || origin.isEmpty()) && (period == null || period.isEmpty()) - && (factor == null || factor.isEmpty()) && (lowerLimit == null || lowerLimit.isEmpty()) && (upperLimit == null || upperLimit.isEmpty()) - && (dimensions == null || dimensions.isEmpty()) && (data == null || data.isEmpty()); - } - - -} - + +/* + 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 java.math.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ +@DatatypeDef(name="SampledData") +public class SampledData extends Type implements ICompositeType{ + + /** + * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. + */ + @Child(name="origin", type={Quantity.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." ) + protected Quantity origin; + + /** + * The length of time between sampling times, measured in milliseconds. + */ + @Child(name="period", type={DecimalType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." ) + protected DecimalType period; + + /** + * A correction factor that is applied to the sampled data points before they are added to the origin. + */ + @Child(name="factor", type={DecimalType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." ) + protected DecimalType factor; + + /** + * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + @Child(name="lowerLimit", type={DecimalType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit)." ) + protected DecimalType lowerLimit; + + /** + * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + @Child(name="upperLimit", type={DecimalType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit)." ) + protected DecimalType upperLimit; + + /** + * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + @Child(name="dimensions", type={IntegerType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." ) + protected IntegerType dimensions; + + /** + * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + @Child(name="data", type={StringType.class}, order=5, min=1, max=1) + @Description(shortDefinition="Decimal values with spaces, or 'E' | 'U' | 'L'", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value." ) + protected StringType data; + + private static final long serialVersionUID = 173820410L; + + public SampledData() { + super(); + } + + public SampledData(Quantity origin, DecimalType period, IntegerType dimensions, StringType data) { + super(); + this.origin = origin; + this.period = period; + this.dimensions = dimensions; + this.data = data; + } + + /** + * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) + */ + public Quantity getOrigin() { + if (this.origin == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.origin"); + else if (Configuration.doAutoCreate()) + this.origin = new Quantity(); + return this.origin; + } + + public boolean hasOrigin() { + return this.origin != null && !this.origin.isEmpty(); + } + + /** + * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) + */ + public SampledData setOrigin(Quantity value) { + this.origin = value; + return this; + } + + /** + * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public DecimalType getPeriodElement() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.period"); + else if (Configuration.doAutoCreate()) + this.period = new DecimalType(); + return this.period; + } + + public boolean hasPeriodElement() { + return this.period != null && !this.period.isEmpty(); + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value + */ + public SampledData setPeriodElement(DecimalType value) { + this.period = value; + return this; + } + + /** + * @return The length of time between sampling times, measured in milliseconds. + */ + public BigDecimal getPeriod() { + return this.period == null ? null : this.period.getValue(); + } + + /** + * @param value The length of time between sampling times, measured in milliseconds. + */ + public SampledData setPeriod(BigDecimal value) { + if (this.period == null) + this.period = new DecimalType(); + this.period.setValue(value); + return this; + } + + /** + * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SampledData setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A correction factor that is applied to the sampled data points before they are added to the origin. + */ + public SampledData setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value + */ + public DecimalType getLowerLimitElement() { + if (this.lowerLimit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.lowerLimit"); + else if (Configuration.doAutoCreate()) + this.lowerLimit = new DecimalType(); + return this.lowerLimit; + } + + public boolean hasLowerLimitElement() { + return this.lowerLimit != null && !this.lowerLimit.isEmpty(); + } + + public boolean hasLowerLimit() { + return this.lowerLimit != null && !this.lowerLimit.isEmpty(); + } + + /** + * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value + */ + public SampledData setLowerLimitElement(DecimalType value) { + this.lowerLimit = value; + return this; + } + + /** + * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public BigDecimal getLowerLimit() { + return this.lowerLimit == null ? null : this.lowerLimit.getValue(); + } + + /** + * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + */ + public SampledData setLowerLimit(BigDecimal value) { + if (value == null) + this.lowerLimit = null; + else { + if (this.lowerLimit == null) + this.lowerLimit = new DecimalType(); + this.lowerLimit.setValue(value); + } + return this; + } + + /** + * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value + */ + public DecimalType getUpperLimitElement() { + if (this.upperLimit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.upperLimit"); + else if (Configuration.doAutoCreate()) + this.upperLimit = new DecimalType(); + return this.upperLimit; + } + + public boolean hasUpperLimitElement() { + return this.upperLimit != null && !this.upperLimit.isEmpty(); + } + + public boolean hasUpperLimit() { + return this.upperLimit != null && !this.upperLimit.isEmpty(); + } + + /** + * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value + */ + public SampledData setUpperLimitElement(DecimalType value) { + this.upperLimit = value; + return this; + } + + /** + * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public BigDecimal getUpperLimit() { + return this.upperLimit == null ? null : this.upperLimit.getValue(); + } + + /** + * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + */ + public SampledData setUpperLimit(BigDecimal value) { + if (value == null) + this.upperLimit = null; + else { + if (this.upperLimit == null) + this.upperLimit = new DecimalType(); + this.upperLimit.setValue(value); + } + return this; + } + + /** + * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value + */ + public IntegerType getDimensionsElement() { + if (this.dimensions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.dimensions"); + else if (Configuration.doAutoCreate()) + this.dimensions = new IntegerType(); + return this.dimensions; + } + + public boolean hasDimensionsElement() { + return this.dimensions != null && !this.dimensions.isEmpty(); + } + + public boolean hasDimensions() { + return this.dimensions != null && !this.dimensions.isEmpty(); + } + + /** + * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value + */ + public SampledData setDimensionsElement(IntegerType value) { + this.dimensions = value; + return this; + } + + /** + * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + public int getDimensions() { + return this.dimensions == null ? null : this.dimensions.getValue(); + } + + /** + * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + */ + public SampledData setDimensions(int value) { + if (this.dimensions == null) + this.dimensions = new IntegerType(); + this.dimensions.setValue(value); + return this; + } + + /** + * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public StringType getDataElement() { + if (this.data == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SampledData.data"); + else if (Configuration.doAutoCreate()) + this.data = new StringType(); + return this.data; + } + + public boolean hasDataElement() { + return this.data != null && !this.data.isEmpty(); + } + + public boolean hasData() { + return this.data != null && !this.data.isEmpty(); + } + + /** + * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value + */ + public SampledData setDataElement(StringType value) { + this.data = value; + return this; + } + + /** + * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + public String getData() { + return this.data == null ? null : this.data.getValue(); + } + + /** + * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + */ + public SampledData setData(String value) { + if (this.data == null) + this.data = new StringType(); + this.data.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("origin", "Quantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin)); + childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value 'L' (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit)); + childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value 'U' (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit)); + childrenList.add(new Property("dimensions", "integer", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions)); + childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values 'E' (error), 'L' (below detection limit) and 'U' (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data)); + } + + public SampledData copy() { + SampledData dst = new SampledData(); + copyValues(dst); + dst.origin = origin == null ? null : origin.copy(); + dst.period = period == null ? null : period.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); + dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); + dst.dimensions = dimensions == null ? null : dimensions.copy(); + dst.data = data == null ? null : data.copy(); + return dst; + } + + protected SampledData typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (origin == null || origin.isEmpty()) && (period == null || period.isEmpty()) + && (factor == null || factor.isEmpty()) && (lowerLimit == null || lowerLimit.isEmpty()) && (upperLimit == null || upperLimit.isEmpty()) + && (dimensions == null || dimensions.isEmpty()) && (data == null || data.isEmpty()); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java index 67fb005da4d..6f12c006469 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java @@ -20,805 +20,805 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A Search Parameter that defines a named search item that can be used to search/filter on a resource. - */ -@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") -public class SearchParameter extends DomainResource { - - public enum SearchParamType implements FhirEnum { - /** - * Search parameter SHALL be a number (a whole number, or a decimal). - */ - NUMBER, - /** - * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. - */ - DATE, - /** - * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. - */ - STRING, - /** - * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. - */ - TOKEN, - /** - * A reference to another resource. - */ - REFERENCE, - /** - * A composite search parameter that combines a search on two values together. - */ - COMPOSITE, - /** - * A search parameter that searches on a quantity. - */ - QUANTITY, - /** - * added to help the parsers - */ - NULL; - - 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)) - return NUMBER; - if ("date".equals(codeString)) - return DATE; - if ("string".equals(codeString)) - return STRING; - if ("token".equals(codeString)) - return TOKEN; - if ("reference".equals(codeString)) - return REFERENCE; - if ("composite".equals(codeString)) - return COMPOSITE; - if ("quantity".equals(codeString)) - return QUANTITY; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NUMBER: return ""; - case DATE: return ""; - case STRING: return ""; - case TOKEN: return ""; - case REFERENCE: return ""; - case COMPOSITE: return ""; - case QUANTITY: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; - case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; - case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; - case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; - case REFERENCE: return "A reference to another resource."; - case COMPOSITE: return "A composite search parameter that combines a search on two values together."; - case QUANTITY: return "A search parameter that searches on a quantity."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - } - - public static class SearchParamTypeEnumFactory implements EnumFactory { - public SearchParamType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return SearchParamType.NUMBER; - if ("date".equals(codeString)) - return SearchParamType.DATE; - if ("string".equals(codeString)) - return SearchParamType.STRING; - if ("token".equals(codeString)) - return SearchParamType.TOKEN; - if ("reference".equals(codeString)) - return SearchParamType.REFERENCE; - if ("composite".equals(codeString)) - return SearchParamType.COMPOSITE; - if ("quantity".equals(codeString)) - return SearchParamType.QUANTITY; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode(SearchParamType code) throws IllegalArgumentException { - if (code == SearchParamType.NUMBER) - return "number"; - if (code == SearchParamType.DATE) - return "date"; - if (code == SearchParamType.STRING) - return "string"; - if (code == SearchParamType.TOKEN) - return "token"; - if (code == SearchParamType.REFERENCE) - return "reference"; - if (code == SearchParamType.COMPOSITE) - return "composite"; - if (code == SearchParamType.QUANTITY) - return "quantity"; - return "?"; - } - } - - /** - * The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. - */ - @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Literal URL used to reference this search parameter", formalDefinition="The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements." ) - protected UriType url; - - /** - * The name of the standard or custom search parameter. - */ - @Child(name="name", type={StringType.class}, order=0, min=1, max=1) - @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the standard or custom search parameter." ) - protected StringType name; - - /** - * Details of the individual or organization who accepts responsibility for publishing the search parameter. - */ - @Child(name="publisher", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the search parameter." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * The Scope and Usage that this search parameter was created to meet. - */ - @Child(name="requirements", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." ) - protected StringType requirements; - - /** - * The base resource type that this search parameter refers to. - */ - @Child(name="base", type={CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) - protected CodeType base; - - /** - * The type of value a search parameter refers to, and how the content is interpreted. - */ - @Child(name="type", type={CodeType.class}, order=5, min=1, max=1) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) - protected Enumeration type; - - /** - * A description of the search parameters and how it used. - */ - @Child(name="description", type={StringType.class}, order=6, min=1, max=1) - @Description(shortDefinition="Documentation for search parameter", formalDefinition="A description of the search parameters and how it used." ) - protected StringType description; - - /** - * An XPath expression that returns a set of elements for the search parameter. - */ - @Child(name="xpath", type={StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) - protected StringType xpath; - - /** - * Types of resource (if a resource is referenced). - */ - @Child(name="target", type={CodeType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - protected List target; - - private static final long serialVersionUID = -720598887L; - - public SearchParameter() { - super(); - } - - public SearchParameter(UriType url, StringType name, CodeType base, Enumeration type, StringType description) { - super(); - this.url = url; - this.name = name; - this.base = base; - this.type = type; - this.description = description; - } - - /** - * @return {@link #url} (The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SearchParameter setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. - */ - public SearchParameter setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #name} (The name of the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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 the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SearchParameter setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the standard or custom search parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the standard or custom search parameter. - */ - public SearchParameter setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public SearchParameter setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Details of the individual or organization who accepts responsibility for publishing the search parameter. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Details of the individual or organization who accepts responsibility for publishing the search parameter. - */ - public SearchParameter setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public SearchParameter setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return The Scope and Usage that this search parameter was created to meet. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value The Scope and Usage that this search parameter was created to meet. - */ - public SearchParameter setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public CodeType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.base"); - else if (Configuration.doAutoCreate()) - this.base = new CodeType(); - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public SearchParameter setBaseElement(CodeType value) { - this.base = value; - return this; - } - - /** - * @return The base resource type that this search parameter refers to. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The base resource type that this search parameter refers to. - */ - public SearchParameter setBase(String value) { - if (this.base == null) - this.base = new CodeType(); - this.base.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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 of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SearchParameter setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParamType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParameter setType(SearchParamType value) { - if (this.type == null) - this.type = new Enumeration(SearchParamType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of the search parameters and how it used.). 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 SearchParameter.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} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SearchParameter setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the search parameters and how it used. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the search parameters and how it used. - */ - public SearchParameter setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public StringType getXpathElement() { - if (this.xpath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.xpath"); - else if (Configuration.doAutoCreate()) - this.xpath = new StringType(); - return this.xpath; - } - - public boolean hasXpathElement() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - public boolean hasXpath() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - /** - * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public SearchParameter setXpathElement(StringType value) { - this.xpath = value; - return this; - } - - /** - * @return An XPath expression that returns a set of elements for the search parameter. - */ - public String getXpath() { - return this.xpath == null ? null : this.xpath.getValue(); - } - - /** - * @param value An XPath expression that returns a set of elements for the search parameter. - */ - public SearchParameter setXpath(String value) { - if (Utilities.noString(value)) - this.xpath = null; - else { - if (this.xpath == null) - this.xpath = new StringType(); - this.xpath.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - // syntactic sugar - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public SearchParameter addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("name", "string", "The name of the standard or custom search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public SearchParameter copy() { - SearchParameter dst = new SearchParameter(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.name = name == null ? null : name.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.base = base == null ? null : base.copy(); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - dst.xpath = xpath == null ? null : xpath.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - return dst; - } - - protected SearchParameter typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (base == null || base.isEmpty()) && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) - && (xpath == null || xpath.isEmpty()) && (target == null || target.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SearchParameter; - } - - @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for search parameter", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="SearchParameter.name", description="Name of search parameter", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" ) - public static final String SP_TARGET = "target"; - @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) - public static final String SP_BASE = "base"; - @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="url", path="SearchParameter.url", description="Literal URL used to reference this search parameter", type="token" ) - public static final String SP_URL = "url"; - -} - + +/* + 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; +/** + * A Search Parameter that defines a named search item that can be used to search/filter on a resource. + */ +@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") +public class SearchParameter extends DomainResource { + + public enum SearchParamType implements FhirEnum { + /** + * Search parameter SHALL be a number (a whole number, or a decimal). + */ + NUMBER, + /** + * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. + */ + DATE, + /** + * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. + */ + STRING, + /** + * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. + */ + TOKEN, + /** + * A reference to another resource. + */ + REFERENCE, + /** + * A composite search parameter that combines a search on two values together. + */ + COMPOSITE, + /** + * A search parameter that searches on a quantity. + */ + QUANTITY, + /** + * added to help the parsers + */ + NULL; + + 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)) + return NUMBER; + if ("date".equals(codeString)) + return DATE; + if ("string".equals(codeString)) + return STRING; + if ("token".equals(codeString)) + return TOKEN; + if ("reference".equals(codeString)) + return REFERENCE; + if ("composite".equals(codeString)) + return COMPOSITE; + if ("quantity".equals(codeString)) + return QUANTITY; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NUMBER: return ""; + case DATE: return ""; + case STRING: return ""; + case TOKEN: return ""; + case REFERENCE: return ""; + case COMPOSITE: return ""; + case QUANTITY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; + case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; + case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; + case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a '|', depending on the modifier used."; + case REFERENCE: return "A reference to another resource."; + case COMPOSITE: return "A composite search parameter that combines a search on two values together."; + case QUANTITY: return "A search parameter that searches on a quantity."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NUMBER: return "number"; + case DATE: return "date"; + case STRING: return "string"; + case TOKEN: return "token"; + case REFERENCE: return "reference"; + case COMPOSITE: return "composite"; + case QUANTITY: return "quantity"; + default: return "?"; + } + } + } + + public static class SearchParamTypeEnumFactory implements EnumFactory { + public SearchParamType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("number".equals(codeString)) + return SearchParamType.NUMBER; + if ("date".equals(codeString)) + return SearchParamType.DATE; + if ("string".equals(codeString)) + return SearchParamType.STRING; + if ("token".equals(codeString)) + return SearchParamType.TOKEN; + if ("reference".equals(codeString)) + return SearchParamType.REFERENCE; + if ("composite".equals(codeString)) + return SearchParamType.COMPOSITE; + if ("quantity".equals(codeString)) + return SearchParamType.QUANTITY; + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); + } + public String toCode(SearchParamType code) throws IllegalArgumentException { + if (code == SearchParamType.NUMBER) + return "number"; + if (code == SearchParamType.DATE) + return "date"; + if (code == SearchParamType.STRING) + return "string"; + if (code == SearchParamType.TOKEN) + return "token"; + if (code == SearchParamType.REFERENCE) + return "reference"; + if (code == SearchParamType.COMPOSITE) + return "composite"; + if (code == SearchParamType.QUANTITY) + return "quantity"; + return "?"; + } + } + + /** + * The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + */ + @Child(name="url", type={UriType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Literal URL used to reference this search parameter", formalDefinition="The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements." ) + protected UriType url; + + /** + * The name of the standard or custom search parameter. + */ + @Child(name="name", type={StringType.class}, order=0, min=1, max=1) + @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the standard or custom search parameter." ) + protected StringType name; + + /** + * Details of the individual or organization who accepts responsibility for publishing the search parameter. + */ + @Child(name="publisher", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="Details of the individual or organization who accepts responsibility for publishing the search parameter." ) + protected StringType publisher; + + /** + * Contact details to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * The Scope and Usage that this search parameter was created to meet. + */ + @Child(name="requirements", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." ) + protected StringType requirements; + + /** + * The base resource type that this search parameter refers to. + */ + @Child(name="base", type={CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) + protected CodeType base; + + /** + * The type of value a search parameter refers to, and how the content is interpreted. + */ + @Child(name="type", type={CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="number | date | string | token | reference | composite | quantity", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) + protected Enumeration type; + + /** + * A description of the search parameters and how it used. + */ + @Child(name="description", type={StringType.class}, order=6, min=1, max=1) + @Description(shortDefinition="Documentation for search parameter", formalDefinition="A description of the search parameters and how it used." ) + protected StringType description; + + /** + * An XPath expression that returns a set of elements for the search parameter. + */ + @Child(name="xpath", type={StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) + protected StringType xpath; + + /** + * Types of resource (if a resource is referenced). + */ + @Child(name="target", type={CodeType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) + protected List target; + + private static final long serialVersionUID = -720598887L; + + public SearchParameter() { + super(); + } + + public SearchParameter(UriType url, StringType name, CodeType base, Enumeration type, StringType description) { + super(); + this.url = url; + this.name = name; + this.base = base; + this.type = type; + this.description = description; + } + + /** + * @return {@link #url} (The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SearchParameter setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + */ + public SearchParameter setUrl(String value) { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + return this; + } + + /** + * @return {@link #name} (The name of the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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 the standard or custom search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SearchParameter setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the standard or custom search parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the standard or custom search parameter. + */ + public SearchParameter setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (Details of the individual or organization who accepts responsibility for publishing the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public SearchParameter setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return Details of the individual or organization who accepts responsibility for publishing the search parameter. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value Details of the individual or organization who accepts responsibility for publishing the search parameter. + */ + public SearchParameter setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public StringType getRequirementsElement() { + if (this.requirements == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.requirements"); + else if (Configuration.doAutoCreate()) + this.requirements = new StringType(); + return this.requirements; + } + + public boolean hasRequirementsElement() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + public boolean hasRequirements() { + return this.requirements != null && !this.requirements.isEmpty(); + } + + /** + * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value + */ + public SearchParameter setRequirementsElement(StringType value) { + this.requirements = value; + return this; + } + + /** + * @return The Scope and Usage that this search parameter was created to meet. + */ + public String getRequirements() { + return this.requirements == null ? null : this.requirements.getValue(); + } + + /** + * @param value The Scope and Usage that this search parameter was created to meet. + */ + public SearchParameter setRequirements(String value) { + if (Utilities.noString(value)) + this.requirements = null; + else { + if (this.requirements == null) + this.requirements = new StringType(); + this.requirements.setValue(value); + } + return this; + } + + /** + * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public CodeType getBaseElement() { + if (this.base == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.base"); + else if (Configuration.doAutoCreate()) + this.base = new CodeType(); + return this.base; + } + + public boolean hasBaseElement() { + return this.base != null && !this.base.isEmpty(); + } + + public boolean hasBase() { + return this.base != null && !this.base.isEmpty(); + } + + /** + * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value + */ + public SearchParameter setBaseElement(CodeType value) { + this.base = value; + return this; + } + + /** + * @return The base resource type that this search parameter refers to. + */ + public String getBase() { + return this.base == null ? null : this.base.getValue(); + } + + /** + * @param value The base resource type that this search parameter refers to. + */ + public SearchParameter setBase(String value) { + if (this.base == null) + this.base = new CodeType(); + this.base.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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 of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SearchParameter setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParamType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type of value a search parameter refers to, and how the content is interpreted. + */ + public SearchParameter setType(SearchParamType value) { + if (this.type == null) + this.type = new Enumeration(SearchParamType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #description} (A description of the search parameters and how it used.). 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 SearchParameter.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} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SearchParameter setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the search parameters and how it used. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the search parameters and how it used. + */ + public SearchParameter setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public StringType getXpathElement() { + if (this.xpath == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SearchParameter.xpath"); + else if (Configuration.doAutoCreate()) + this.xpath = new StringType(); + return this.xpath; + } + + public boolean hasXpathElement() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + public boolean hasXpath() { + return this.xpath != null && !this.xpath.isEmpty(); + } + + /** + * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value + */ + public SearchParameter setXpathElement(StringType value) { + this.xpath = value; + return this; + } + + /** + * @return An XPath expression that returns a set of elements for the search parameter. + */ + public String getXpath() { + return this.xpath == null ? null : this.xpath.getValue(); + } + + /** + * @param value An XPath expression that returns a set of elements for the search parameter. + */ + public SearchParameter setXpath(String value) { + if (Utilities.noString(value)) + this.xpath = null; + else { + if (this.xpath == null) + this.xpath = new StringType(); + this.xpath.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (CodeType item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (Types of resource (if a resource is referenced).) + */ + // syntactic sugar + public CodeType addTargetElement() {//2 + CodeType t = new CodeType(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public SearchParameter addTarget(String value) { //1 + CodeType t = new CodeType(); + t.setValue(value); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return this; + } + + /** + * @param value {@link #target} (Types of resource (if a resource is referenced).) + */ + public boolean hasTarget(String value) { + if (this.target == null) + return false; + for (CodeType v : this.target) + if (v.equals(value)) // code + return true; + return false; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("url", "uri", "The URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("name", "string", "The name of the standard or custom search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("publisher", "string", "Details of the individual or organization who accepts responsibility for publishing the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); + childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); + childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); + childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public SearchParameter copy() { + SearchParameter dst = new SearchParameter(); + copyValues(dst); + dst.url = url == null ? null : url.copy(); + dst.name = name == null ? null : name.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.requirements = requirements == null ? null : requirements.copy(); + dst.base = base == null ? null : base.copy(); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + dst.xpath = xpath == null ? null : xpath.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (CodeType i : target) + dst.target.add(i.copy()); + }; + return dst; + } + + protected SearchParameter typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (requirements == null || requirements.isEmpty()) + && (base == null || base.isEmpty()) && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) + && (xpath == null || xpath.isEmpty()) && (target == null || target.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SearchParameter; + } + + @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for search parameter", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="name", path="SearchParameter.name", description="Name of search parameter", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" ) + public static final String SP_TARGET = "target"; + @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) + public static final String SP_BASE = "base"; + @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="url", path="SearchParameter.url", description="Literal URL used to reference this search parameter", type="token" ) + public static final String SP_URL = "url"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java index 43ec53bdbc6..7d74906b2e0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java @@ -20,3118 +20,3118 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. - */ -@ResourceDef(name="SecurityEvent", profile="http://hl7.org/fhir/Profile/SecurityEvent") -public class SecurityEvent extends DomainResource { - - public enum SecurityEventAction implements FhirEnum { - /** - * Create a new database object, such as Placing an Order. - */ - C, - /** - * Display or print data, such as a Doctor Census. - */ - R, - /** - * Update data, such as Revise Patient Information. - */ - U, - /** - * Delete items, such as a doctor master file record. - */ - D, - /** - * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation. - */ - E, - /** - * added to help the parsers - */ - NULL; - - public static final SecurityEventActionEnumFactory ENUM_FACTORY = new SecurityEventActionEnumFactory(); - - public static SecurityEventAction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return C; - if ("R".equals(codeString)) - return R; - if ("U".equals(codeString)) - return U; - if ("D".equals(codeString)) - return D; - if ("E".equals(codeString)) - return E; - throw new IllegalArgumentException("Unknown SecurityEventAction code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case C: return "C"; - case R: return "R"; - case U: return "U"; - case D: return "D"; - case E: return "E"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case C: return ""; - case R: return ""; - case U: return ""; - case D: return ""; - case E: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case C: return "Create a new database object, such as Placing an Order."; - case R: return "Display or print data, such as a Doctor Census."; - case U: return "Update data, such as Revise Patient Information."; - case D: return "Delete items, such as a doctor master file record."; - case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case C: return "Create"; - case R: return "Read/View/Print"; - case U: return "Update"; - case D: return "Delete"; - case E: return "Execute"; - default: return "?"; - } - } - } - - public static class SecurityEventActionEnumFactory implements EnumFactory { - public SecurityEventAction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return SecurityEventAction.C; - if ("R".equals(codeString)) - return SecurityEventAction.R; - if ("U".equals(codeString)) - return SecurityEventAction.U; - if ("D".equals(codeString)) - return SecurityEventAction.D; - if ("E".equals(codeString)) - return SecurityEventAction.E; - throw new IllegalArgumentException("Unknown SecurityEventAction code '"+codeString+"'"); - } - public String toCode(SecurityEventAction code) throws IllegalArgumentException { - if (code == SecurityEventAction.C) - return "C"; - if (code == SecurityEventAction.R) - return "R"; - if (code == SecurityEventAction.U) - return "U"; - if (code == SecurityEventAction.D) - return "D"; - if (code == SecurityEventAction.E) - return "E"; - return "?"; - } - } - - public enum SecurityEventOutcome implements FhirEnum { - /** - * The operation completed successfully (whether with warnings or not). - */ - _0, - /** - * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response). - */ - _4, - /** - * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response). - */ - _8, - /** - * An error of such magnitude occurred that the system is not longer available for use (i.e. the system died). - */ - _12, - /** - * added to help the parsers - */ - NULL; - - public static final SecurityEventOutcomeEnumFactory ENUM_FACTORY = new SecurityEventOutcomeEnumFactory(); - - public static SecurityEventOutcome fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return _0; - if ("4".equals(codeString)) - return _4; - if ("8".equals(codeString)) - return _8; - if ("12".equals(codeString)) - return _12; - throw new IllegalArgumentException("Unknown SecurityEventOutcome code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case _0: return "0"; - case _4: return "4"; - case _8: return "8"; - case _12: return "12"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _0: return ""; - case _4: return ""; - case _8: return ""; - case _12: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _0: return "The operation completed successfully (whether with warnings or not)."; - case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response)."; - case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response)."; - case _12: return "An error of such magnitude occurred that the system is not longer available for use (i.e. the system died)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _0: return "Success"; - case _4: return "Minor failure"; - case _8: return "Serious failure"; - case _12: return "Major failure"; - default: return "?"; - } - } - } - - public static class SecurityEventOutcomeEnumFactory implements EnumFactory { - public SecurityEventOutcome fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return SecurityEventOutcome._0; - if ("4".equals(codeString)) - return SecurityEventOutcome._4; - if ("8".equals(codeString)) - return SecurityEventOutcome._8; - if ("12".equals(codeString)) - return SecurityEventOutcome._12; - throw new IllegalArgumentException("Unknown SecurityEventOutcome code '"+codeString+"'"); - } - public String toCode(SecurityEventOutcome code) throws IllegalArgumentException { - if (code == SecurityEventOutcome._0) - return "0"; - if (code == SecurityEventOutcome._4) - return "4"; - if (code == SecurityEventOutcome._8) - return "8"; - if (code == SecurityEventOutcome._12) - return "12"; - return "?"; - } - } - - public enum NetworkType implements FhirEnum { - /** - * Machine Name, including DNS name. - */ - _1, - /** - * IP Address. - */ - _2, - /** - * Telephone Number. - */ - _3, - /** - * Email address. - */ - _4, - /** - * URI (User directory, HTTP-PUT, ftp, etc.). - */ - _5, - /** - * added to help the parsers - */ - NULL; - - public static final NetworkTypeEnumFactory ENUM_FACTORY = new NetworkTypeEnumFactory(); - - public static NetworkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - case _5: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "Machine Name, including DNS name."; - case _2: return "IP Address."; - case _3: return "Telephone Number."; - case _4: return "Email address."; - case _5: return "URI (User directory, HTTP-PUT, ftp, etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - default: return "?"; - } - } - } - - public static class NetworkTypeEnumFactory implements EnumFactory { - public NetworkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return NetworkType._1; - if ("2".equals(codeString)) - return NetworkType._2; - if ("3".equals(codeString)) - return NetworkType._3; - if ("4".equals(codeString)) - return NetworkType._4; - if ("5".equals(codeString)) - return NetworkType._5; - throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); - } - public String toCode(NetworkType code) throws IllegalArgumentException { - if (code == NetworkType._1) - return "1"; - if (code == NetworkType._2) - return "2"; - if (code == NetworkType._3) - return "3"; - if (code == NetworkType._4) - return "4"; - if (code == NetworkType._5) - return "5"; - return "?"; - } - } - - public enum ObjectType implements FhirEnum { - /** - * Person. - */ - _1, - /** - * System Object. - */ - _2, - /** - * Organization. - */ - _3, - /** - * Other. - */ - _4, - /** - * added to help the parsers - */ - NULL; - - public static final ObjectTypeEnumFactory ENUM_FACTORY = new ObjectTypeEnumFactory(); - - public static ObjectType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "Person."; - case _2: return "System Object."; - case _3: return "Organization."; - case _4: return "Other."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - default: return "?"; - } - } - } - - public static class ObjectTypeEnumFactory implements EnumFactory { - public ObjectType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return ObjectType._1; - if ("2".equals(codeString)) - return ObjectType._2; - if ("3".equals(codeString)) - return ObjectType._3; - if ("4".equals(codeString)) - return ObjectType._4; - throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); - } - public String toCode(ObjectType code) throws IllegalArgumentException { - if (code == ObjectType._1) - return "1"; - if (code == ObjectType._2) - return "2"; - if (code == ObjectType._3) - return "3"; - if (code == ObjectType._4) - return "4"; - return "?"; - } - } - - public enum ObjectRole implements FhirEnum { - /** - * This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal. - */ - _1, - /** - * This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location. - */ - _2, - /** - * This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere. - */ - _3, - /** - * A logical object related to the event. (Deprecated). - */ - _4, - /** - * This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc. - */ - _5, - /** - * A human participant not otherwise identified by some other category. - */ - _6, - /** - * (deprecated). - */ - _7, - /** - * Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work. - */ - _8, - /** - * A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place. - */ - _9, - /** - * Insurance company, or any other organization who accepts responsibility for paying for the healthcare event. - */ - _10, - /** - * A person or active system object involved in the event with a security role. - */ - _11, - /** - * A person or system object involved in the event with the authority to modify security roles of other objects. - */ - _12, - /** - * A passive object, such as a role table, that is relevant to the event. - */ - _13, - /** - * (deprecated) Relevant to certain RBAC security methodologies. - */ - _14, - /** - * Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient. - */ - _15, - /** - * The source or destination for data transfer, when it does not match some other role. - */ - _16, - /** - * A source or destination for data transfer, that acts as an archive, database, or similar role. - */ - _17, - /** - * An object that holds schedule information. This could be an appointment book, availability information, etc. - */ - _18, - /** - * An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal. - */ - _19, - /** - * An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS. - */ - _20, - /** - * A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP. - */ - _21, - /** - * (Deprecated). - */ - _22, - /** - * An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects. - */ - _23, - /** - * The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important. - */ - _24, - /** - * added to help the parsers - */ - NULL; - - public static final ObjectRoleEnumFactory ENUM_FACTORY = new ObjectRoleEnumFactory(); - - public static ObjectRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - if ("6".equals(codeString)) - return _6; - if ("7".equals(codeString)) - return _7; - if ("8".equals(codeString)) - return _8; - if ("9".equals(codeString)) - return _9; - if ("10".equals(codeString)) - return _10; - if ("11".equals(codeString)) - return _11; - if ("12".equals(codeString)) - return _12; - if ("13".equals(codeString)) - return _13; - if ("14".equals(codeString)) - return _14; - if ("15".equals(codeString)) - return _15; - if ("16".equals(codeString)) - return _16; - if ("17".equals(codeString)) - return _17; - if ("18".equals(codeString)) - return _18; - if ("19".equals(codeString)) - return _19; - if ("20".equals(codeString)) - return _20; - if ("21".equals(codeString)) - return _21; - if ("22".equals(codeString)) - return _22; - if ("23".equals(codeString)) - return _23; - if ("24".equals(codeString)) - return _24; - throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - case _6: return "6"; - case _7: return "7"; - case _8: return "8"; - case _9: return "9"; - case _10: return "10"; - case _11: return "11"; - case _12: return "12"; - case _13: return "13"; - case _14: return "14"; - case _15: return "15"; - case _16: return "16"; - case _17: return "17"; - case _18: return "18"; - case _19: return "19"; - case _20: return "20"; - case _21: return "21"; - case _22: return "22"; - case _23: return "23"; - case _24: return "24"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - case _5: return ""; - case _6: return ""; - case _7: return ""; - case _8: return ""; - case _9: return ""; - case _10: return ""; - case _11: return ""; - case _12: return ""; - case _13: return ""; - case _14: return ""; - case _15: return ""; - case _16: return ""; - case _17: return ""; - case _18: return ""; - case _19: return ""; - case _20: return ""; - case _21: return ""; - case _22: return ""; - case _23: return ""; - case _24: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal."; - case _2: return "This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location."; - case _3: return "This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere."; - case _4: return "A logical object related to the event. (Deprecated)."; - case _5: return "This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc."; - case _6: return "A human participant not otherwise identified by some other category."; - case _7: return "(deprecated)."; - case _8: return "Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work."; - case _9: return "A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place."; - case _10: return "Insurance company, or any other organization who accepts responsibility for paying for the healthcare event."; - case _11: return "A person or active system object involved in the event with a security role."; - case _12: return "A person or system object involved in the event with the authority to modify security roles of other objects."; - case _13: return "A passive object, such as a role table, that is relevant to the event."; - case _14: return "(deprecated) Relevant to certain RBAC security methodologies."; - case _15: return "Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient."; - case _16: return "The source or destination for data transfer, when it does not match some other role."; - case _17: return "A source or destination for data transfer, that acts as an archive, database, or similar role."; - case _18: return "An object that holds schedule information. This could be an appointment book, availability information, etc."; - case _19: return "An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal."; - case _20: return "An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS."; - case _21: return "A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP."; - case _22: return "(Deprecated)."; - case _23: return "An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects."; - case _24: return "The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return "Patient"; - case _2: return "Location"; - case _3: return "Report"; - case _4: return "DomainResource"; - case _5: return "Master file"; - case _6: return "User"; - case _7: return "List"; - case _8: return "Doctor"; - case _9: return "Subscriber"; - case _10: return "Guarantor"; - case _11: return "Security User Entity"; - case _12: return "Security User Group"; - case _13: return "Security Resource"; - case _14: return "Security Granularity Definition"; - case _15: return "Practitioner"; - case _16: return "Data Destination"; - case _17: return "Data Repository"; - case _18: return "Schedule"; - case _19: return "Customer"; - case _20: return "Job"; - case _21: return "Job Stream"; - case _22: return "Table"; - case _23: return "Routing Criteria"; - case _24: return "Query"; - default: return "?"; - } - } - } - - public static class ObjectRoleEnumFactory implements EnumFactory { - public ObjectRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return ObjectRole._1; - if ("2".equals(codeString)) - return ObjectRole._2; - if ("3".equals(codeString)) - return ObjectRole._3; - if ("4".equals(codeString)) - return ObjectRole._4; - if ("5".equals(codeString)) - return ObjectRole._5; - if ("6".equals(codeString)) - return ObjectRole._6; - if ("7".equals(codeString)) - return ObjectRole._7; - if ("8".equals(codeString)) - return ObjectRole._8; - if ("9".equals(codeString)) - return ObjectRole._9; - if ("10".equals(codeString)) - return ObjectRole._10; - if ("11".equals(codeString)) - return ObjectRole._11; - if ("12".equals(codeString)) - return ObjectRole._12; - if ("13".equals(codeString)) - return ObjectRole._13; - if ("14".equals(codeString)) - return ObjectRole._14; - if ("15".equals(codeString)) - return ObjectRole._15; - if ("16".equals(codeString)) - return ObjectRole._16; - if ("17".equals(codeString)) - return ObjectRole._17; - if ("18".equals(codeString)) - return ObjectRole._18; - if ("19".equals(codeString)) - return ObjectRole._19; - if ("20".equals(codeString)) - return ObjectRole._20; - if ("21".equals(codeString)) - return ObjectRole._21; - if ("22".equals(codeString)) - return ObjectRole._22; - if ("23".equals(codeString)) - return ObjectRole._23; - if ("24".equals(codeString)) - return ObjectRole._24; - throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); - } - public String toCode(ObjectRole code) throws IllegalArgumentException { - if (code == ObjectRole._1) - return "1"; - if (code == ObjectRole._2) - return "2"; - if (code == ObjectRole._3) - return "3"; - if (code == ObjectRole._4) - return "4"; - if (code == ObjectRole._5) - return "5"; - if (code == ObjectRole._6) - return "6"; - if (code == ObjectRole._7) - return "7"; - if (code == ObjectRole._8) - return "8"; - if (code == ObjectRole._9) - return "9"; - if (code == ObjectRole._10) - return "10"; - if (code == ObjectRole._11) - return "11"; - if (code == ObjectRole._12) - return "12"; - if (code == ObjectRole._13) - return "13"; - if (code == ObjectRole._14) - return "14"; - if (code == ObjectRole._15) - return "15"; - if (code == ObjectRole._16) - return "16"; - if (code == ObjectRole._17) - return "17"; - if (code == ObjectRole._18) - return "18"; - if (code == ObjectRole._19) - return "19"; - if (code == ObjectRole._20) - return "20"; - if (code == ObjectRole._21) - return "21"; - if (code == ObjectRole._22) - return "22"; - if (code == ObjectRole._23) - return "23"; - if (code == ObjectRole._24) - return "24"; - return "?"; - } - } - - public enum ObjectLifecycle implements FhirEnum { - /** - * Origination / Creation. - */ - _1, - /** - * Import / Copy from original. - */ - _2, - /** - * Amendment. - */ - _3, - /** - * Verification. - */ - _4, - /** - * Translation. - */ - _5, - /** - * Access / Use. - */ - _6, - /** - * De-identification. - */ - _7, - /** - * Aggregation, summarization, derivation. - */ - _8, - /** - * Report. - */ - _9, - /** - * Export / Copy to target. - */ - _10, - /** - * Disclosure. - */ - _11, - /** - * Receipt of disclosure. - */ - _12, - /** - * Archiving. - */ - _13, - /** - * Logical deletion. - */ - _14, - /** - * Permanent erasure / Physical destruction. - */ - _15, - /** - * added to help the parsers - */ - NULL; - - public static final ObjectLifecycleEnumFactory ENUM_FACTORY = new ObjectLifecycleEnumFactory(); - - public static ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - if ("6".equals(codeString)) - return _6; - if ("7".equals(codeString)) - return _7; - if ("8".equals(codeString)) - return _8; - if ("9".equals(codeString)) - return _9; - if ("10".equals(codeString)) - return _10; - if ("11".equals(codeString)) - return _11; - if ("12".equals(codeString)) - return _12; - if ("13".equals(codeString)) - return _13; - if ("14".equals(codeString)) - return _14; - if ("15".equals(codeString)) - return _15; - throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - case _6: return "6"; - case _7: return "7"; - case _8: return "8"; - case _9: return "9"; - case _10: return "10"; - case _11: return "11"; - case _12: return "12"; - case _13: return "13"; - case _14: return "14"; - case _15: return "15"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return ""; - case _2: return ""; - case _3: return ""; - case _4: return ""; - case _5: return ""; - case _6: return ""; - case _7: return ""; - case _8: return ""; - case _9: return ""; - case _10: return ""; - case _11: return ""; - case _12: return ""; - case _13: return ""; - case _14: return ""; - case _15: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "Origination / Creation."; - case _2: return "Import / Copy from original."; - case _3: return "Amendment."; - case _4: return "Verification."; - case _5: return "Translation."; - case _6: return "Access / Use."; - case _7: return "De-identification."; - case _8: return "Aggregation, summarization, derivation."; - case _9: return "Report."; - case _10: return "Export / Copy to target."; - case _11: return "Disclosure."; - case _12: return "Receipt of disclosure."; - case _13: return "Archiving."; - case _14: return "Logical deletion."; - case _15: return "Permanent erasure / Physical destruction."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - case _6: return "6"; - case _7: return "7"; - case _8: return "8"; - case _9: return "9"; - case _10: return "10"; - case _11: return "11"; - case _12: return "12"; - case _13: return "13"; - case _14: return "14"; - case _15: return "15"; - default: return "?"; - } - } - } - - public static class ObjectLifecycleEnumFactory implements EnumFactory { - public ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return ObjectLifecycle._1; - if ("2".equals(codeString)) - return ObjectLifecycle._2; - if ("3".equals(codeString)) - return ObjectLifecycle._3; - if ("4".equals(codeString)) - return ObjectLifecycle._4; - if ("5".equals(codeString)) - return ObjectLifecycle._5; - if ("6".equals(codeString)) - return ObjectLifecycle._6; - if ("7".equals(codeString)) - return ObjectLifecycle._7; - if ("8".equals(codeString)) - return ObjectLifecycle._8; - if ("9".equals(codeString)) - return ObjectLifecycle._9; - if ("10".equals(codeString)) - return ObjectLifecycle._10; - if ("11".equals(codeString)) - return ObjectLifecycle._11; - if ("12".equals(codeString)) - return ObjectLifecycle._12; - if ("13".equals(codeString)) - return ObjectLifecycle._13; - if ("14".equals(codeString)) - return ObjectLifecycle._14; - if ("15".equals(codeString)) - return ObjectLifecycle._15; - throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); - } - public String toCode(ObjectLifecycle code) throws IllegalArgumentException { - if (code == ObjectLifecycle._1) - return "1"; - if (code == ObjectLifecycle._2) - return "2"; - if (code == ObjectLifecycle._3) - return "3"; - if (code == ObjectLifecycle._4) - return "4"; - if (code == ObjectLifecycle._5) - return "5"; - if (code == ObjectLifecycle._6) - return "6"; - if (code == ObjectLifecycle._7) - return "7"; - if (code == ObjectLifecycle._8) - return "8"; - if (code == ObjectLifecycle._9) - return "9"; - if (code == ObjectLifecycle._10) - return "10"; - if (code == ObjectLifecycle._11) - return "11"; - if (code == ObjectLifecycle._12) - return "12"; - if (code == ObjectLifecycle._13) - return "13"; - if (code == ObjectLifecycle._14) - return "14"; - if (code == ObjectLifecycle._15) - return "15"; - return "?"; - } - } - - @Block() - public static class SecurityEventEventComponent extends BackboneElement { - /** - * Identifier for a family of the event. - */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) - @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event." ) - protected CodeableConcept type; - - /** - * Identifier for the category of event. - */ - @Child(name="subtype", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." ) - protected List subtype; - - /** - * Indicator for type of action performed during the event that generated the audit. - */ - @Child(name="action", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." ) - protected Enumeration action; - - /** - * The time when the event occurred on the source. - */ - @Child(name="dateTime", type={InstantType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." ) - protected InstantType dateTime; - - /** - * Indicates whether the event succeeded or failed. - */ - @Child(name="outcome", type={CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." ) - protected Enumeration outcome; - - /** - * A free text description of the outcome of the event. - */ - @Child(name="outcomeDesc", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." ) - protected StringType outcomeDesc; - - private static final long serialVersionUID = 1351587588L; - - public SecurityEventEventComponent() { - super(); - } - - public SecurityEventEventComponent(CodeableConcept type, InstantType dateTime) { - super(); - this.type = type; - this.dateTime = dateTime; - } - - /** - * @return {@link #type} (Identifier for a family of the event.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventEventComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifier for a family of the event.) - */ - public SecurityEventEventComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subtype} (Identifier for the category of event.) - */ - public List getSubtype() { - if (this.subtype == null) - this.subtype = new ArrayList(); - return this.subtype; - } - - public boolean hasSubtype() { - if (this.subtype == null) - return false; - for (CodeableConcept item : this.subtype) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subtype} (Identifier for the category of event.) - */ - // syntactic sugar - public CodeableConcept addSubtype() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.subtype == null) - this.subtype = new ArrayList(); - this.subtype.add(t); - return t; - } - - /** - * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public Enumeration getActionElement() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventEventComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new Enumeration(); - return this.action; - } - - public boolean hasActionElement() { - return this.action != null && !this.action.isEmpty(); - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public SecurityEventEventComponent setActionElement(Enumeration value) { - this.action = value; - return this; - } - - /** - * @return Indicator for type of action performed during the event that generated the audit. - */ - public SecurityEventAction getAction() { - return this.action == null ? null : this.action.getValue(); - } - - /** - * @param value Indicator for type of action performed during the event that generated the audit. - */ - public SecurityEventEventComponent setAction(SecurityEventAction value) { - if (value == null) - this.action = null; - else { - if (this.action == null) - this.action = new Enumeration(SecurityEventAction.ENUM_FACTORY); - this.action.setValue(value); - } - return this; - } - - /** - * @return {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public InstantType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventEventComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new InstantType(); - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public SecurityEventEventComponent setDateTimeElement(InstantType value) { - this.dateTime = value; - return this; - } - - /** - * @return The time when the event occurred on the source. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The time when the event occurred on the source. - */ - public SecurityEventEventComponent setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new InstantType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventEventComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public SecurityEventEventComponent setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Indicates whether the event succeeded or failed. - */ - public SecurityEventOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Indicates whether the event succeeded or failed. - */ - public SecurityEventEventComponent setOutcome(SecurityEventOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(SecurityEventOutcome.ENUM_FACTORY); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value - */ - public StringType getOutcomeDescElement() { - if (this.outcomeDesc == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventEventComponent.outcomeDesc"); - else if (Configuration.doAutoCreate()) - this.outcomeDesc = new StringType(); - return this.outcomeDesc; - } - - public boolean hasOutcomeDescElement() { - return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); - } - - public boolean hasOutcomeDesc() { - return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); - } - - /** - * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value - */ - public SecurityEventEventComponent setOutcomeDescElement(StringType value) { - this.outcomeDesc = value; - return this; - } - - /** - * @return A free text description of the outcome of the event. - */ - public String getOutcomeDesc() { - return this.outcomeDesc == null ? null : this.outcomeDesc.getValue(); - } - - /** - * @param value A free text description of the outcome of the event. - */ - public SecurityEventEventComponent setOutcomeDesc(String value) { - if (Utilities.noString(value)) - this.outcomeDesc = null; - else { - if (this.outcomeDesc == null) - this.outcomeDesc = new StringType(); - this.outcomeDesc.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Identifier for a family of the event.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("dateTime", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); - } - - public SecurityEventEventComponent copy() { - SecurityEventEventComponent dst = new SecurityEventEventComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (subtype != null) { - dst.subtype = new ArrayList(); - for (CodeableConcept i : subtype) - dst.subtype.add(i.copy()); - }; - dst.action = action == null ? null : action.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) - && (action == null || action.isEmpty()) && (dateTime == null || dateTime.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (outcomeDesc == null || outcomeDesc.isEmpty()); - } - - } - - @Block() - public static class SecurityEventParticipantComponent extends BackboneElement { - /** - * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context. - */ - @Child(name="role", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="User roles (e.g. local RBAC codes)", formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context." ) - protected List role; - - /** - * Direct reference to a resource that identifies the participant. - */ - @Child(name="reference", type={Practitioner.class, Patient.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the participant." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (Direct reference to a resource that identifies the participant.) - */ - protected Resource referenceTarget; - - /** - * Unique identifier for the user actively participating in the event. - */ - @Child(name="userId", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." ) - protected StringType userId; - - /** - * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. - */ - @Child(name="altId", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available." ) - protected StringType altId; - - /** - * Human-meaningful name for the user. - */ - @Child(name="name", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Human-meaningful name for the user", formalDefinition="Human-meaningful name for the user." ) - protected StringType name; - - /** - * Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - @Child(name="requestor", type={BooleanType.class}, order=6, min=1, max=1) - @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." ) - protected BooleanType requestor; - - /** - * Type of media involved. Used when the event is about exporting/importing onto media. - */ - @Child(name="media", type={Coding.class}, order=7, min=0, max=1) - @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." ) - protected Coding media; - - /** - * Logical network location for application activity, if the activity has a network location. - */ - @Child(name="network", type={}, order=8, min=0, max=1) - @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." ) - protected SecurityEventParticipantNetworkComponent network; - - private static final long serialVersionUID = 594416195L; - - public SecurityEventParticipantComponent() { - super(); - } - - public SecurityEventParticipantComponent(BooleanType requestor) { - super(); - this.requestor = requestor; - } - - /** - * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - /** - * @return {@link #reference} (Direct reference to a resource that identifies the participant.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Direct reference to a resource that identifies the participant.) - */ - public SecurityEventParticipantComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} 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. (Direct reference to a resource that identifies the participant.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} 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. (Direct reference to a resource that identifies the participant.) - */ - public SecurityEventParticipantComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value - */ - public StringType getUserIdElement() { - if (this.userId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.userId"); - else if (Configuration.doAutoCreate()) - this.userId = new StringType(); - return this.userId; - } - - public boolean hasUserIdElement() { - return this.userId != null && !this.userId.isEmpty(); - } - - public boolean hasUserId() { - return this.userId != null && !this.userId.isEmpty(); - } - - /** - * @param value {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value - */ - public SecurityEventParticipantComponent setUserIdElement(StringType value) { - this.userId = value; - return this; - } - - /** - * @return Unique identifier for the user actively participating in the event. - */ - public String getUserId() { - return this.userId == null ? null : this.userId.getValue(); - } - - /** - * @param value Unique identifier for the user actively participating in the event. - */ - public SecurityEventParticipantComponent setUserId(String value) { - if (Utilities.noString(value)) - this.userId = null; - else { - if (this.userId == null) - this.userId = new StringType(); - this.userId.setValue(value); - } - return this; - } - - /** - * @return {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value - */ - public StringType getAltIdElement() { - if (this.altId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.altId"); - else if (Configuration.doAutoCreate()) - this.altId = new StringType(); - return this.altId; - } - - public boolean hasAltIdElement() { - return this.altId != null && !this.altId.isEmpty(); - } - - public boolean hasAltId() { - return this.altId != null && !this.altId.isEmpty(); - } - - /** - * @param value {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value - */ - public SecurityEventParticipantComponent setAltIdElement(StringType value) { - this.altId = value; - return this; - } - - /** - * @return Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. - */ - public String getAltId() { - return this.altId == null ? null : this.altId.getValue(); - } - - /** - * @param value Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. - */ - public SecurityEventParticipantComponent setAltId(String value) { - if (Utilities.noString(value)) - this.altId = null; - else { - if (this.altId == null) - this.altId = new StringType(); - this.altId.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SecurityEventParticipantComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-meaningful name for the user. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-meaningful name for the user. - */ - public SecurityEventParticipantComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value - */ - public BooleanType getRequestorElement() { - if (this.requestor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.requestor"); - else if (Configuration.doAutoCreate()) - this.requestor = new BooleanType(); - return this.requestor; - } - - public boolean hasRequestorElement() { - return this.requestor != null && !this.requestor.isEmpty(); - } - - public boolean hasRequestor() { - return this.requestor != null && !this.requestor.isEmpty(); - } - - /** - * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value - */ - public SecurityEventParticipantComponent setRequestorElement(BooleanType value) { - this.requestor = value; - return this; - } - - /** - * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - public boolean getRequestor() { - return this.requestor == null ? false : this.requestor.getValue(); - } - - /** - * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - public SecurityEventParticipantComponent setRequestor(boolean value) { - if (this.requestor == null) - this.requestor = new BooleanType(); - this.requestor.setValue(value); - return this; - } - - /** - * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) - */ - public Coding getMedia() { - if (this.media == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.media"); - else if (Configuration.doAutoCreate()) - this.media = new Coding(); - return this.media; - } - - public boolean hasMedia() { - return this.media != null && !this.media.isEmpty(); - } - - /** - * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) - */ - public SecurityEventParticipantComponent setMedia(Coding value) { - this.media = value; - return this; - } - - /** - * @return {@link #network} (Logical network location for application activity, if the activity has a network location.) - */ - public SecurityEventParticipantNetworkComponent getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantComponent.network"); - else if (Configuration.doAutoCreate()) - this.network = new SecurityEventParticipantNetworkComponent(); - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.) - */ - public SecurityEventParticipantComponent setNetwork(SecurityEventParticipantNetworkComponent value) { - this.network = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "CodeableConcept", "Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("reference", "Reference(Practitioner|Patient|Device)", "Direct reference to a resource that identifies the participant.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("userId", "string", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId)); - childrenList.add(new Property("altId", "string", "Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.", 0, java.lang.Integer.MAX_VALUE, altId)); - childrenList.add(new Property("name", "string", "Human-meaningful name for the user.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor)); - childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); - childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); - } - - public SecurityEventParticipantComponent copy() { - SecurityEventParticipantComponent dst = new SecurityEventParticipantComponent(); - copyValues(dst); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - dst.reference = reference == null ? null : reference.copy(); - dst.userId = userId == null ? null : userId.copy(); - dst.altId = altId == null ? null : altId.copy(); - dst.name = name == null ? null : name.copy(); - dst.requestor = requestor == null ? null : requestor.copy(); - dst.media = media == null ? null : media.copy(); - dst.network = network == null ? null : network.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty()) - && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty()) - && (requestor == null || requestor.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty()) - ; - } - - } - - @Block() - public static class SecurityEventParticipantNetworkComponent extends BackboneElement { - /** - * An identifier for the network access point of the user device for the audit event. - */ - @Child(name="identifier", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Identifier for the network access point of the user device", formalDefinition="An identifier for the network access point of the user device for the audit event." ) - protected StringType identifier; - - /** - * An identifier for the type of network access point that originated the audit event. - */ - @Child(name="type", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." ) - protected Enumeration type; - - private static final long serialVersionUID = -1946856025L; - - public SecurityEventParticipantNetworkComponent() { - super(); - } - - /** - * @return {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantNetworkComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public SecurityEventParticipantNetworkComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return An identifier for the network access point of the user device for the audit event. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value An identifier for the network access point of the user device for the audit event. - */ - public SecurityEventParticipantNetworkComponent setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventParticipantNetworkComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SecurityEventParticipantNetworkComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return An identifier for the type of network access point that originated the audit event. - */ - public NetworkType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value An identifier for the type of network access point that originated the audit event. - */ - public SecurityEventParticipantNetworkComponent setType(NetworkType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(NetworkType.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - public SecurityEventParticipantNetworkComponent copy() { - SecurityEventParticipantNetworkComponent dst = new SecurityEventParticipantNetworkComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - } - - @Block() - public static class SecurityEventSourceComponent extends BackboneElement { - /** - * Logical source location within the healthcare enterprise network. - */ - @Child(name="site", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network." ) - protected StringType site; - - /** - * Identifier of the source where the event originated. - */ - @Child(name="identifier", type={StringType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The id of source where event originated", formalDefinition="Identifier of the source where the event originated." ) - protected StringType identifier; - - /** - * Code specifying the type of source where event originated. - */ - @Child(name="type", type={Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." ) - protected List type; - - private static final long serialVersionUID = -382040480L; - - public SecurityEventSourceComponent() { - super(); - } - - public SecurityEventSourceComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value - */ - public StringType getSiteElement() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventSourceComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new StringType(); - return this.site; - } - - public boolean hasSiteElement() { - return this.site != null && !this.site.isEmpty(); - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value - */ - public SecurityEventSourceComponent setSiteElement(StringType value) { - this.site = value; - return this; - } - - /** - * @return Logical source location within the healthcare enterprise network. - */ - public String getSite() { - return this.site == null ? null : this.site.getValue(); - } - - /** - * @param value Logical source location within the healthcare enterprise network. - */ - public SecurityEventSourceComponent setSite(String value) { - if (Utilities.noString(value)) - this.site = null; - else { - if (this.site == null) - this.site = new StringType(); - this.site.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventSourceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public SecurityEventSourceComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return Identifier of the source where the event originated. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value Identifier of the source where the event originated. - */ - public SecurityEventSourceComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #type} (Code specifying the type of source where event originated.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Coding item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Code specifying the type of source where event originated.) - */ - // syntactic sugar - public Coding addType() { //3 - Coding t = new Coding(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("identifier", "string", "Identifier of the source where the event originated.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - public SecurityEventSourceComponent copy() { - SecurityEventSourceComponent dst = new SecurityEventSourceComponent(); - copyValues(dst); - dst.site = site == null ? null : site.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) - dst.type.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (type == null || type.isEmpty()); - } - - } - - @Block() - public static class SecurityEventObjectComponent extends BackboneElement { - /** - * Identifies a specific instance of the participant object. The reference should always be version specific. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) - protected Identifier identifier; - - /** - * Identifies a specific instance of the participant object. The reference should always be version specific. - */ - @Child(name="reference", type={}, order=2, min=0, max=1) - @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - protected Resource referenceTarget; - - /** - * Object type being audited. - */ - @Child(name="type", type={CodeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Object type being audited", formalDefinition="Object type being audited." ) - protected Enumeration type; - - /** - * Code representing the functional application role of Participant Object being audited. - */ - @Child(name="role", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Functional application role of Object", formalDefinition="Code representing the functional application role of Participant Object being audited." ) - protected Enumeration role; - - /** - * Identifier for the data life-cycle stage for the participant object. - */ - @Child(name="lifecycle", type={CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the participant object." ) - protected Enumeration lifecycle; - - /** - * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics. - */ - @Child(name="sensitivity", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Policy-defined sensitivity for the object", formalDefinition="Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics." ) - protected CodeableConcept sensitivity; - - /** - * An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - */ - @Child(name="name", type={StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Instance-specific descriptor for Object", formalDefinition="An instance-specific descriptor of the Participant Object ID audited, such as a person's name." ) - protected StringType name; - - /** - * Text that describes the object in more detail. - */ - @Child(name="description", type={StringType.class}, order=8, min=0, max=1) - @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the object in more detail." ) - protected StringType description; - - /** - * The actual query for a query-type participant object. - */ - @Child(name="query", type={Base64BinaryType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Actual query for object", formalDefinition="The actual query for a query-type participant object." ) - protected Base64BinaryType query; - - /** - * Additional Information about the Object. - */ - @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional Information about the Object", formalDefinition="Additional Information about the Object." ) - protected List detail; - - private static final long serialVersionUID = -268126947L; - - public SecurityEventObjectComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public SecurityEventObjectComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) - */ - public SecurityEventObjectComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} 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 a specific instance of the participant object. The reference should always be version specific.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} 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 a specific instance of the participant object. The reference should always be version specific.) - */ - public SecurityEventObjectComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #type} (Object type being audited.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Object type being audited.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SecurityEventObjectComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Object type being audited. - */ - public ObjectType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Object type being audited. - */ - public SecurityEventObjectComponent setType(ObjectType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(ObjectType.ENUM_FACTORY); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public Enumeration getRoleElement() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Enumeration(); - return this.role; - } - - public boolean hasRoleElement() { - return this.role != null && !this.role.isEmpty(); - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public SecurityEventObjectComponent setRoleElement(Enumeration value) { - this.role = value; - return this; - } - - /** - * @return Code representing the functional application role of Participant Object being audited. - */ - public ObjectRole getRole() { - return this.role == null ? null : this.role.getValue(); - } - - /** - * @param value Code representing the functional application role of Participant Object being audited. - */ - public SecurityEventObjectComponent setRole(ObjectRole value) { - if (value == null) - this.role = null; - else { - if (this.role == null) - this.role = new Enumeration(ObjectRole.ENUM_FACTORY); - this.role.setValue(value); - } - return this; - } - - /** - * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value - */ - public Enumeration getLifecycleElement() { - if (this.lifecycle == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.lifecycle"); - else if (Configuration.doAutoCreate()) - this.lifecycle = new Enumeration(); - return this.lifecycle; - } - - public boolean hasLifecycleElement() { - return this.lifecycle != null && !this.lifecycle.isEmpty(); - } - - public boolean hasLifecycle() { - return this.lifecycle != null && !this.lifecycle.isEmpty(); - } - - /** - * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value - */ - public SecurityEventObjectComponent setLifecycleElement(Enumeration value) { - this.lifecycle = value; - return this; - } - - /** - * @return Identifier for the data life-cycle stage for the participant object. - */ - public ObjectLifecycle getLifecycle() { - return this.lifecycle == null ? null : this.lifecycle.getValue(); - } - - /** - * @param value Identifier for the data life-cycle stage for the participant object. - */ - public SecurityEventObjectComponent setLifecycle(ObjectLifecycle value) { - if (value == null) - this.lifecycle = null; - else { - if (this.lifecycle == null) - this.lifecycle = new Enumeration(ObjectLifecycle.ENUM_FACTORY); - this.lifecycle.setValue(value); - } - return this; - } - - /** - * @return {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) - */ - public CodeableConcept getSensitivity() { - if (this.sensitivity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.sensitivity"); - else if (Configuration.doAutoCreate()) - this.sensitivity = new CodeableConcept(); - return this.sensitivity; - } - - public boolean hasSensitivity() { - return this.sensitivity != null && !this.sensitivity.isEmpty(); - } - - /** - * @param value {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) - */ - public SecurityEventObjectComponent setSensitivity(CodeableConcept value) { - this.sensitivity = value; - return this; - } - - /** - * @return {@link #name} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SecurityEventObjectComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - */ - public SecurityEventObjectComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Text that describes the object in more detail.). 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 SecurityEventObjectComponent.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} (Text that describes the object in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SecurityEventObjectComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text that describes the object in more detail. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text that describes the object in more detail. - */ - public SecurityEventObjectComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value - */ - public Base64BinaryType getQueryElement() { - if (this.query == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectComponent.query"); - else if (Configuration.doAutoCreate()) - this.query = new Base64BinaryType(); - return this.query; - } - - public boolean hasQueryElement() { - return this.query != null && !this.query.isEmpty(); - } - - public boolean hasQuery() { - return this.query != null && !this.query.isEmpty(); - } - - /** - * @param value {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value - */ - public SecurityEventObjectComponent setQueryElement(Base64BinaryType value) { - this.query = value; - return this; - } - - /** - * @return The actual query for a query-type participant object. - */ - public byte[] getQuery() { - return this.query == null ? null : this.query.getValue(); - } - - /** - * @param value The actual query for a query-type participant object. - */ - public SecurityEventObjectComponent setQuery(byte[] value) { - if (value == null) - this.query = null; - else { - if (this.query == null) - this.query = new Base64BinaryType(); - this.query.setValue(value); - } - return this; - } - - /** - * @return {@link #detail} (Additional Information about the Object.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (SecurityEventObjectDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Additional Information about the Object.) - */ - // syntactic sugar - public SecurityEventObjectDetailComponent addDetail() { //3 - SecurityEventObjectDetailComponent t = new SecurityEventObjectDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("type", "code", "Object type being audited.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("role", "code", "Code representing the functional application role of Participant Object being audited.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("lifecycle", "code", "Identifier for the data life-cycle stage for the participant object.", 0, java.lang.Integer.MAX_VALUE, lifecycle)); - childrenList.add(new Property("sensitivity", "CodeableConcept", "Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.", 0, java.lang.Integer.MAX_VALUE, sensitivity)); - childrenList.add(new Property("name", "string", "An instance-specific descriptor of the Participant Object ID audited, such as a person's name.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Text that describes the object in more detail.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("query", "base64Binary", "The actual query for a query-type participant object.", 0, java.lang.Integer.MAX_VALUE, query)); - childrenList.add(new Property("detail", "", "Additional Information about the Object.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public SecurityEventObjectComponent copy() { - SecurityEventObjectComponent dst = new SecurityEventObjectComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.type = type == null ? null : type.copy(); - dst.role = role == null ? null : role.copy(); - dst.lifecycle = lifecycle == null ? null : lifecycle.copy(); - dst.sensitivity = sensitivity == null ? null : sensitivity.copy(); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.query = query == null ? null : query.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (SecurityEventObjectDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) - && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty()) - && (sensitivity == null || sensitivity.isEmpty()) && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) - && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class SecurityEventObjectDetailComponent extends BackboneElement { - /** - * Name of the property. - */ - @Child(name="type", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." ) - protected StringType type; - - /** - * Property value. - */ - @Child(name="value", type={Base64BinaryType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Property value", formalDefinition="Property value." ) - protected Base64BinaryType value; - - private static final long serialVersionUID = 11139504L; - - public SecurityEventObjectDetailComponent() { - super(); - } - - public SecurityEventObjectDetailComponent(StringType type, Base64BinaryType value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); - 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} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SecurityEventObjectDetailComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return Name of the property. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Name of the property. - */ - public SecurityEventObjectDetailComponent setType(String value) { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Base64BinaryType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEventObjectDetailComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new Base64BinaryType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SecurityEventObjectDetailComponent setValueElement(Base64BinaryType value) { - this.value = value; - return this; - } - - /** - * @return Property value. - */ - public byte[] getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value Property value. - */ - public SecurityEventObjectDetailComponent setValue(byte[] value) { - if (this.value == null) - this.value = new Base64BinaryType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public SecurityEventObjectDetailComponent copy() { - SecurityEventObjectDetailComponent dst = new SecurityEventObjectDetailComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - } - - /** - * Identifies the name, action type, time, and disposition of the audited event. - */ - @Child(name="event", type={}, order=-1, min=1, max=1) - @Description(shortDefinition="What was done", formalDefinition="Identifies the name, action type, time, and disposition of the audited event." ) - protected SecurityEventEventComponent event; - - /** - * A person, a hardware device or software process. - */ - @Child(name="participant", type={}, order=0, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A person, a hardware device or software process", formalDefinition="A person, a hardware device or software process." ) - protected List participant; - - /** - * Application systems and processes. - */ - @Child(name="source", type={}, order=1, min=1, max=1) - @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." ) - protected SecurityEventSourceComponent source; - - /** - * Specific instances of data or objects that have been accessed. - */ - @Child(name="object", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." ) - protected List object; - - private static final long serialVersionUID = -1695871760L; - - public SecurityEvent() { - super(); - } - - public SecurityEvent(SecurityEventEventComponent event, SecurityEventSourceComponent source) { - super(); - this.event = event; - this.source = source; - } - - /** - * @return {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) - */ - public SecurityEventEventComponent getEvent() { - if (this.event == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEvent.event"); - else if (Configuration.doAutoCreate()) - this.event = new SecurityEventEventComponent(); - return this.event; - } - - public boolean hasEvent() { - return this.event != null && !this.event.isEmpty(); - } - - /** - * @param value {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) - */ - public SecurityEvent setEvent(SecurityEventEventComponent value) { - this.event = value; - return this; - } - - /** - * @return {@link #participant} (A person, a hardware device or software process.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (SecurityEventParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (A person, a hardware device or software process.) - */ - // syntactic sugar - public SecurityEventParticipantComponent addParticipant() { //3 - SecurityEventParticipantComponent t = new SecurityEventParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - /** - * @return {@link #source} (Application systems and processes.) - */ - public SecurityEventSourceComponent getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SecurityEvent.source"); - else if (Configuration.doAutoCreate()) - this.source = new SecurityEventSourceComponent(); - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Application systems and processes.) - */ - public SecurityEvent setSource(SecurityEventSourceComponent value) { - this.source = value; - return this; - } - - /** - * @return {@link #object} (Specific instances of data or objects that have been accessed.) - */ - public List getObject() { - if (this.object == null) - this.object = new ArrayList(); - return this.object; - } - - public boolean hasObject() { - if (this.object == null) - return false; - for (SecurityEventObjectComponent item : this.object) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #object} (Specific instances of data or objects that have been accessed.) - */ - // syntactic sugar - public SecurityEventObjectComponent addObject() { //3 - SecurityEventObjectComponent t = new SecurityEventObjectComponent(); - if (this.object == null) - this.object = new ArrayList(); - this.object.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "", "Identifies the name, action type, time, and disposition of the audited event.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("participant", "", "A person, a hardware device or software process.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("object", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, object)); - } - - public SecurityEvent copy() { - SecurityEvent dst = new SecurityEvent(); - copyValues(dst); - dst.event = event == null ? null : event.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (SecurityEventParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.source = source == null ? null : source.copy(); - if (object != null) { - dst.object = new ArrayList(); - for (SecurityEventObjectComponent i : object) - dst.object.add(i.copy()); - }; - return dst; - } - - protected SecurityEvent typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (participant == null || participant.isEmpty()) - && (source == null || source.isEmpty()) && (object == null || object.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SecurityEvent; - } - - @SearchParamDefinition(name="site", path="SecurityEvent.source.site", description="Logical source location within the enterprise", type="token" ) - public static final String SP_SITE = "site"; - @SearchParamDefinition(name="desc", path="SecurityEvent.object.name", description="Instance-specific descriptor for Object", type="string" ) - public static final String SP_DESC = "desc"; - @SearchParamDefinition(name="type", path="SecurityEvent.event.type", description="Type/identifier of event", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="date", path="SecurityEvent.event.dateTime", description="Time when the event occurred on source", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="reference", path="SecurityEvent.object.reference", description="Specific instance of resource (e.g. versioned)", type="reference" ) - public static final String SP_REFERENCE = "reference"; - @SearchParamDefinition(name="identity", path="SecurityEvent.object.identifier", description="Specific instance of object (e.g. versioned)", type="token" ) - public static final String SP_IDENTITY = "identity"; - @SearchParamDefinition(name="patient", path="", description="A patient that the .object.reference refers to", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="altid", path="SecurityEvent.participant.altId", description="Alternative User id e.g. authentication", type="token" ) - public static final String SP_ALTID = "altid"; - @SearchParamDefinition(name="patientid", path="", description="The id of the patient (one of multiple kinds of participations)", type="token" ) - public static final String SP_PATIENTID = "patientid"; - @SearchParamDefinition(name="source", path="SecurityEvent.source.identifier", description="The id of source where event originated", type="token" ) - public static final String SP_SOURCE = "source"; - @SearchParamDefinition(name="address", path="SecurityEvent.participant.network.identifier", description="Identifier for the network access point of the user device", type="token" ) - public static final String SP_ADDRESS = "address"; - @SearchParamDefinition(name="subtype", path="SecurityEvent.event.subtype", description="More specific type/id for the event", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - @SearchParamDefinition(name="name", path="SecurityEvent.participant.name", description="Human-meaningful name for the user", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="action", path="SecurityEvent.event.action", description="Type of action performed during the event", type="token" ) - public static final String SP_ACTION = "action"; - @SearchParamDefinition(name="object-type", path="SecurityEvent.object.type", description="Object type being audited", type="token" ) - public static final String SP_OBJECTTYPE = "object-type"; - @SearchParamDefinition(name="user", path="SecurityEvent.participant.userId", description="Unique identifier for the user", type="token" ) - public static final String SP_USER = "user"; - -} - + +/* + 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; +/** + * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + */ +@ResourceDef(name="SecurityEvent", profile="http://hl7.org/fhir/Profile/SecurityEvent") +public class SecurityEvent extends DomainResource { + + public enum SecurityEventAction implements FhirEnum { + /** + * Create a new database object, such as Placing an Order. + */ + C, + /** + * Display or print data, such as a Doctor Census. + */ + R, + /** + * Update data, such as Revise Patient Information. + */ + U, + /** + * Delete items, such as a doctor master file record. + */ + D, + /** + * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation. + */ + E, + /** + * added to help the parsers + */ + NULL; + + public static final SecurityEventActionEnumFactory ENUM_FACTORY = new SecurityEventActionEnumFactory(); + + public static SecurityEventAction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return C; + if ("R".equals(codeString)) + return R; + if ("U".equals(codeString)) + return U; + if ("D".equals(codeString)) + return D; + if ("E".equals(codeString)) + return E; + throw new IllegalArgumentException("Unknown SecurityEventAction code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case C: return "C"; + case R: return "R"; + case U: return "U"; + case D: return "D"; + case E: return "E"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case C: return ""; + case R: return ""; + case U: return ""; + case D: return ""; + case E: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case C: return "Create a new database object, such as Placing an Order."; + case R: return "Display or print data, such as a Doctor Census."; + case U: return "Update data, such as Revise Patient Information."; + case D: return "Delete items, such as a doctor master file record."; + case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case C: return "Create"; + case R: return "Read/View/Print"; + case U: return "Update"; + case D: return "Delete"; + case E: return "Execute"; + default: return "?"; + } + } + } + + public static class SecurityEventActionEnumFactory implements EnumFactory { + public SecurityEventAction fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("C".equals(codeString)) + return SecurityEventAction.C; + if ("R".equals(codeString)) + return SecurityEventAction.R; + if ("U".equals(codeString)) + return SecurityEventAction.U; + if ("D".equals(codeString)) + return SecurityEventAction.D; + if ("E".equals(codeString)) + return SecurityEventAction.E; + throw new IllegalArgumentException("Unknown SecurityEventAction code '"+codeString+"'"); + } + public String toCode(SecurityEventAction code) throws IllegalArgumentException { + if (code == SecurityEventAction.C) + return "C"; + if (code == SecurityEventAction.R) + return "R"; + if (code == SecurityEventAction.U) + return "U"; + if (code == SecurityEventAction.D) + return "D"; + if (code == SecurityEventAction.E) + return "E"; + return "?"; + } + } + + public enum SecurityEventOutcome implements FhirEnum { + /** + * The operation completed successfully (whether with warnings or not). + */ + _0, + /** + * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response). + */ + _4, + /** + * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response). + */ + _8, + /** + * An error of such magnitude occurred that the system is not longer available for use (i.e. the system died). + */ + _12, + /** + * added to help the parsers + */ + NULL; + + public static final SecurityEventOutcomeEnumFactory ENUM_FACTORY = new SecurityEventOutcomeEnumFactory(); + + public static SecurityEventOutcome fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return _0; + if ("4".equals(codeString)) + return _4; + if ("8".equals(codeString)) + return _8; + if ("12".equals(codeString)) + return _12; + throw new IllegalArgumentException("Unknown SecurityEventOutcome code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case _0: return "0"; + case _4: return "4"; + case _8: return "8"; + case _12: return "12"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _0: return ""; + case _4: return ""; + case _8: return ""; + case _12: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _0: return "The operation completed successfully (whether with warnings or not)."; + case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response)."; + case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response)."; + case _12: return "An error of such magnitude occurred that the system is not longer available for use (i.e. the system died)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _0: return "Success"; + case _4: return "Minor failure"; + case _8: return "Serious failure"; + case _12: return "Major failure"; + default: return "?"; + } + } + } + + public static class SecurityEventOutcomeEnumFactory implements EnumFactory { + public SecurityEventOutcome fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("0".equals(codeString)) + return SecurityEventOutcome._0; + if ("4".equals(codeString)) + return SecurityEventOutcome._4; + if ("8".equals(codeString)) + return SecurityEventOutcome._8; + if ("12".equals(codeString)) + return SecurityEventOutcome._12; + throw new IllegalArgumentException("Unknown SecurityEventOutcome code '"+codeString+"'"); + } + public String toCode(SecurityEventOutcome code) throws IllegalArgumentException { + if (code == SecurityEventOutcome._0) + return "0"; + if (code == SecurityEventOutcome._4) + return "4"; + if (code == SecurityEventOutcome._8) + return "8"; + if (code == SecurityEventOutcome._12) + return "12"; + return "?"; + } + } + + public enum NetworkType implements FhirEnum { + /** + * Machine Name, including DNS name. + */ + _1, + /** + * IP Address. + */ + _2, + /** + * Telephone Number. + */ + _3, + /** + * Email address. + */ + _4, + /** + * URI (User directory, HTTP-PUT, ftp, etc.). + */ + _5, + /** + * added to help the parsers + */ + NULL; + + public static final NetworkTypeEnumFactory ENUM_FACTORY = new NetworkTypeEnumFactory(); + + public static NetworkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + case _5: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "Machine Name, including DNS name."; + case _2: return "IP Address."; + case _3: return "Telephone Number."; + case _4: return "Email address."; + case _5: return "URI (User directory, HTTP-PUT, ftp, etc.)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + default: return "?"; + } + } + } + + public static class NetworkTypeEnumFactory implements EnumFactory { + public NetworkType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return NetworkType._1; + if ("2".equals(codeString)) + return NetworkType._2; + if ("3".equals(codeString)) + return NetworkType._3; + if ("4".equals(codeString)) + return NetworkType._4; + if ("5".equals(codeString)) + return NetworkType._5; + throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); + } + public String toCode(NetworkType code) throws IllegalArgumentException { + if (code == NetworkType._1) + return "1"; + if (code == NetworkType._2) + return "2"; + if (code == NetworkType._3) + return "3"; + if (code == NetworkType._4) + return "4"; + if (code == NetworkType._5) + return "5"; + return "?"; + } + } + + public enum ObjectType implements FhirEnum { + /** + * Person. + */ + _1, + /** + * System Object. + */ + _2, + /** + * Organization. + */ + _3, + /** + * Other. + */ + _4, + /** + * added to help the parsers + */ + NULL; + + public static final ObjectTypeEnumFactory ENUM_FACTORY = new ObjectTypeEnumFactory(); + + public static ObjectType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "Person."; + case _2: return "System Object."; + case _3: return "Organization."; + case _4: return "Other."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + default: return "?"; + } + } + } + + public static class ObjectTypeEnumFactory implements EnumFactory { + public ObjectType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return ObjectType._1; + if ("2".equals(codeString)) + return ObjectType._2; + if ("3".equals(codeString)) + return ObjectType._3; + if ("4".equals(codeString)) + return ObjectType._4; + throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); + } + public String toCode(ObjectType code) throws IllegalArgumentException { + if (code == ObjectType._1) + return "1"; + if (code == ObjectType._2) + return "2"; + if (code == ObjectType._3) + return "3"; + if (code == ObjectType._4) + return "4"; + return "?"; + } + } + + public enum ObjectRole implements FhirEnum { + /** + * This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal. + */ + _1, + /** + * This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location. + */ + _2, + /** + * This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere. + */ + _3, + /** + * A logical object related to the event. (Deprecated). + */ + _4, + /** + * This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc. + */ + _5, + /** + * A human participant not otherwise identified by some other category. + */ + _6, + /** + * (deprecated). + */ + _7, + /** + * Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work. + */ + _8, + /** + * A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place. + */ + _9, + /** + * Insurance company, or any other organization who accepts responsibility for paying for the healthcare event. + */ + _10, + /** + * A person or active system object involved in the event with a security role. + */ + _11, + /** + * A person or system object involved in the event with the authority to modify security roles of other objects. + */ + _12, + /** + * A passive object, such as a role table, that is relevant to the event. + */ + _13, + /** + * (deprecated) Relevant to certain RBAC security methodologies. + */ + _14, + /** + * Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient. + */ + _15, + /** + * The source or destination for data transfer, when it does not match some other role. + */ + _16, + /** + * A source or destination for data transfer, that acts as an archive, database, or similar role. + */ + _17, + /** + * An object that holds schedule information. This could be an appointment book, availability information, etc. + */ + _18, + /** + * An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal. + */ + _19, + /** + * An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS. + */ + _20, + /** + * A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP. + */ + _21, + /** + * (Deprecated). + */ + _22, + /** + * An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects. + */ + _23, + /** + * The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important. + */ + _24, + /** + * added to help the parsers + */ + NULL; + + public static final ObjectRoleEnumFactory ENUM_FACTORY = new ObjectRoleEnumFactory(); + + public static ObjectRole fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + if ("6".equals(codeString)) + return _6; + if ("7".equals(codeString)) + return _7; + if ("8".equals(codeString)) + return _8; + if ("9".equals(codeString)) + return _9; + if ("10".equals(codeString)) + return _10; + if ("11".equals(codeString)) + return _11; + if ("12".equals(codeString)) + return _12; + if ("13".equals(codeString)) + return _13; + if ("14".equals(codeString)) + return _14; + if ("15".equals(codeString)) + return _15; + if ("16".equals(codeString)) + return _16; + if ("17".equals(codeString)) + return _17; + if ("18".equals(codeString)) + return _18; + if ("19".equals(codeString)) + return _19; + if ("20".equals(codeString)) + return _20; + if ("21".equals(codeString)) + return _21; + if ("22".equals(codeString)) + return _22; + if ("23".equals(codeString)) + return _23; + if ("24".equals(codeString)) + return _24; + throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + case _6: return "6"; + case _7: return "7"; + case _8: return "8"; + case _9: return "9"; + case _10: return "10"; + case _11: return "11"; + case _12: return "12"; + case _13: return "13"; + case _14: return "14"; + case _15: return "15"; + case _16: return "16"; + case _17: return "17"; + case _18: return "18"; + case _19: return "19"; + case _20: return "20"; + case _21: return "21"; + case _22: return "22"; + case _23: return "23"; + case _24: return "24"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + case _5: return ""; + case _6: return ""; + case _7: return ""; + case _8: return ""; + case _9: return ""; + case _10: return ""; + case _11: return ""; + case _12: return ""; + case _13: return ""; + case _14: return ""; + case _15: return ""; + case _16: return ""; + case _17: return ""; + case _18: return ""; + case _19: return ""; + case _20: return ""; + case _21: return ""; + case _22: return ""; + case _23: return ""; + case _24: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal."; + case _2: return "This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location."; + case _3: return "This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere."; + case _4: return "A logical object related to the event. (Deprecated)."; + case _5: return "This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc."; + case _6: return "A human participant not otherwise identified by some other category."; + case _7: return "(deprecated)."; + case _8: return "Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work."; + case _9: return "A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place."; + case _10: return "Insurance company, or any other organization who accepts responsibility for paying for the healthcare event."; + case _11: return "A person or active system object involved in the event with a security role."; + case _12: return "A person or system object involved in the event with the authority to modify security roles of other objects."; + case _13: return "A passive object, such as a role table, that is relevant to the event."; + case _14: return "(deprecated) Relevant to certain RBAC security methodologies."; + case _15: return "Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient."; + case _16: return "The source or destination for data transfer, when it does not match some other role."; + case _17: return "A source or destination for data transfer, that acts as an archive, database, or similar role."; + case _18: return "An object that holds schedule information. This could be an appointment book, availability information, etc."; + case _19: return "An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal."; + case _20: return "An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS."; + case _21: return "A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP."; + case _22: return "(Deprecated)."; + case _23: return "An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects."; + case _24: return "The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return "Patient"; + case _2: return "Location"; + case _3: return "Report"; + case _4: return "DomainResource"; + case _5: return "Master file"; + case _6: return "User"; + case _7: return "List"; + case _8: return "Doctor"; + case _9: return "Subscriber"; + case _10: return "Guarantor"; + case _11: return "Security User Entity"; + case _12: return "Security User Group"; + case _13: return "Security Resource"; + case _14: return "Security Granularity Definition"; + case _15: return "Practitioner"; + case _16: return "Data Destination"; + case _17: return "Data Repository"; + case _18: return "Schedule"; + case _19: return "Customer"; + case _20: return "Job"; + case _21: return "Job Stream"; + case _22: return "Table"; + case _23: return "Routing Criteria"; + case _24: return "Query"; + default: return "?"; + } + } + } + + public static class ObjectRoleEnumFactory implements EnumFactory { + public ObjectRole fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return ObjectRole._1; + if ("2".equals(codeString)) + return ObjectRole._2; + if ("3".equals(codeString)) + return ObjectRole._3; + if ("4".equals(codeString)) + return ObjectRole._4; + if ("5".equals(codeString)) + return ObjectRole._5; + if ("6".equals(codeString)) + return ObjectRole._6; + if ("7".equals(codeString)) + return ObjectRole._7; + if ("8".equals(codeString)) + return ObjectRole._8; + if ("9".equals(codeString)) + return ObjectRole._9; + if ("10".equals(codeString)) + return ObjectRole._10; + if ("11".equals(codeString)) + return ObjectRole._11; + if ("12".equals(codeString)) + return ObjectRole._12; + if ("13".equals(codeString)) + return ObjectRole._13; + if ("14".equals(codeString)) + return ObjectRole._14; + if ("15".equals(codeString)) + return ObjectRole._15; + if ("16".equals(codeString)) + return ObjectRole._16; + if ("17".equals(codeString)) + return ObjectRole._17; + if ("18".equals(codeString)) + return ObjectRole._18; + if ("19".equals(codeString)) + return ObjectRole._19; + if ("20".equals(codeString)) + return ObjectRole._20; + if ("21".equals(codeString)) + return ObjectRole._21; + if ("22".equals(codeString)) + return ObjectRole._22; + if ("23".equals(codeString)) + return ObjectRole._23; + if ("24".equals(codeString)) + return ObjectRole._24; + throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); + } + public String toCode(ObjectRole code) throws IllegalArgumentException { + if (code == ObjectRole._1) + return "1"; + if (code == ObjectRole._2) + return "2"; + if (code == ObjectRole._3) + return "3"; + if (code == ObjectRole._4) + return "4"; + if (code == ObjectRole._5) + return "5"; + if (code == ObjectRole._6) + return "6"; + if (code == ObjectRole._7) + return "7"; + if (code == ObjectRole._8) + return "8"; + if (code == ObjectRole._9) + return "9"; + if (code == ObjectRole._10) + return "10"; + if (code == ObjectRole._11) + return "11"; + if (code == ObjectRole._12) + return "12"; + if (code == ObjectRole._13) + return "13"; + if (code == ObjectRole._14) + return "14"; + if (code == ObjectRole._15) + return "15"; + if (code == ObjectRole._16) + return "16"; + if (code == ObjectRole._17) + return "17"; + if (code == ObjectRole._18) + return "18"; + if (code == ObjectRole._19) + return "19"; + if (code == ObjectRole._20) + return "20"; + if (code == ObjectRole._21) + return "21"; + if (code == ObjectRole._22) + return "22"; + if (code == ObjectRole._23) + return "23"; + if (code == ObjectRole._24) + return "24"; + return "?"; + } + } + + public enum ObjectLifecycle implements FhirEnum { + /** + * Origination / Creation. + */ + _1, + /** + * Import / Copy from original. + */ + _2, + /** + * Amendment. + */ + _3, + /** + * Verification. + */ + _4, + /** + * Translation. + */ + _5, + /** + * Access / Use. + */ + _6, + /** + * De-identification. + */ + _7, + /** + * Aggregation, summarization, derivation. + */ + _8, + /** + * Report. + */ + _9, + /** + * Export / Copy to target. + */ + _10, + /** + * Disclosure. + */ + _11, + /** + * Receipt of disclosure. + */ + _12, + /** + * Archiving. + */ + _13, + /** + * Logical deletion. + */ + _14, + /** + * Permanent erasure / Physical destruction. + */ + _15, + /** + * added to help the parsers + */ + NULL; + + public static final ObjectLifecycleEnumFactory ENUM_FACTORY = new ObjectLifecycleEnumFactory(); + + public static ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return _1; + if ("2".equals(codeString)) + return _2; + if ("3".equals(codeString)) + return _3; + if ("4".equals(codeString)) + return _4; + if ("5".equals(codeString)) + return _5; + if ("6".equals(codeString)) + return _6; + if ("7".equals(codeString)) + return _7; + if ("8".equals(codeString)) + return _8; + if ("9".equals(codeString)) + return _9; + if ("10".equals(codeString)) + return _10; + if ("11".equals(codeString)) + return _11; + if ("12".equals(codeString)) + return _12; + if ("13".equals(codeString)) + return _13; + if ("14".equals(codeString)) + return _14; + if ("15".equals(codeString)) + return _15; + throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + case _6: return "6"; + case _7: return "7"; + case _8: return "8"; + case _9: return "9"; + case _10: return "10"; + case _11: return "11"; + case _12: return "12"; + case _13: return "13"; + case _14: return "14"; + case _15: return "15"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case _1: return ""; + case _2: return ""; + case _3: return ""; + case _4: return ""; + case _5: return ""; + case _6: return ""; + case _7: return ""; + case _8: return ""; + case _9: return ""; + case _10: return ""; + case _11: return ""; + case _12: return ""; + case _13: return ""; + case _14: return ""; + case _15: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case _1: return "Origination / Creation."; + case _2: return "Import / Copy from original."; + case _3: return "Amendment."; + case _4: return "Verification."; + case _5: return "Translation."; + case _6: return "Access / Use."; + case _7: return "De-identification."; + case _8: return "Aggregation, summarization, derivation."; + case _9: return "Report."; + case _10: return "Export / Copy to target."; + case _11: return "Disclosure."; + case _12: return "Receipt of disclosure."; + case _13: return "Archiving."; + case _14: return "Logical deletion."; + case _15: return "Permanent erasure / Physical destruction."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case _1: return "1"; + case _2: return "2"; + case _3: return "3"; + case _4: return "4"; + case _5: return "5"; + case _6: return "6"; + case _7: return "7"; + case _8: return "8"; + case _9: return "9"; + case _10: return "10"; + case _11: return "11"; + case _12: return "12"; + case _13: return "13"; + case _14: return "14"; + case _15: return "15"; + default: return "?"; + } + } + } + + public static class ObjectLifecycleEnumFactory implements EnumFactory { + public ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("1".equals(codeString)) + return ObjectLifecycle._1; + if ("2".equals(codeString)) + return ObjectLifecycle._2; + if ("3".equals(codeString)) + return ObjectLifecycle._3; + if ("4".equals(codeString)) + return ObjectLifecycle._4; + if ("5".equals(codeString)) + return ObjectLifecycle._5; + if ("6".equals(codeString)) + return ObjectLifecycle._6; + if ("7".equals(codeString)) + return ObjectLifecycle._7; + if ("8".equals(codeString)) + return ObjectLifecycle._8; + if ("9".equals(codeString)) + return ObjectLifecycle._9; + if ("10".equals(codeString)) + return ObjectLifecycle._10; + if ("11".equals(codeString)) + return ObjectLifecycle._11; + if ("12".equals(codeString)) + return ObjectLifecycle._12; + if ("13".equals(codeString)) + return ObjectLifecycle._13; + if ("14".equals(codeString)) + return ObjectLifecycle._14; + if ("15".equals(codeString)) + return ObjectLifecycle._15; + throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); + } + public String toCode(ObjectLifecycle code) throws IllegalArgumentException { + if (code == ObjectLifecycle._1) + return "1"; + if (code == ObjectLifecycle._2) + return "2"; + if (code == ObjectLifecycle._3) + return "3"; + if (code == ObjectLifecycle._4) + return "4"; + if (code == ObjectLifecycle._5) + return "5"; + if (code == ObjectLifecycle._6) + return "6"; + if (code == ObjectLifecycle._7) + return "7"; + if (code == ObjectLifecycle._8) + return "8"; + if (code == ObjectLifecycle._9) + return "9"; + if (code == ObjectLifecycle._10) + return "10"; + if (code == ObjectLifecycle._11) + return "11"; + if (code == ObjectLifecycle._12) + return "12"; + if (code == ObjectLifecycle._13) + return "13"; + if (code == ObjectLifecycle._14) + return "14"; + if (code == ObjectLifecycle._15) + return "15"; + return "?"; + } + } + + @Block() + public static class SecurityEventEventComponent extends BackboneElement { + /** + * Identifier for a family of the event. + */ + @Child(name="type", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event." ) + protected CodeableConcept type; + + /** + * Identifier for the category of event. + */ + @Child(name="subtype", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." ) + protected List subtype; + + /** + * Indicator for type of action performed during the event that generated the audit. + */ + @Child(name="action", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." ) + protected Enumeration action; + + /** + * The time when the event occurred on the source. + */ + @Child(name="dateTime", type={InstantType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." ) + protected InstantType dateTime; + + /** + * Indicates whether the event succeeded or failed. + */ + @Child(name="outcome", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." ) + protected Enumeration outcome; + + /** + * A free text description of the outcome of the event. + */ + @Child(name="outcomeDesc", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." ) + protected StringType outcomeDesc; + + private static final long serialVersionUID = 1351587588L; + + public SecurityEventEventComponent() { + super(); + } + + public SecurityEventEventComponent(CodeableConcept type, InstantType dateTime) { + super(); + this.type = type; + this.dateTime = dateTime; + } + + /** + * @return {@link #type} (Identifier for a family of the event.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventEventComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Identifier for a family of the event.) + */ + public SecurityEventEventComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #subtype} (Identifier for the category of event.) + */ + public List getSubtype() { + if (this.subtype == null) + this.subtype = new ArrayList(); + return this.subtype; + } + + public boolean hasSubtype() { + if (this.subtype == null) + return false; + for (CodeableConcept item : this.subtype) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subtype} (Identifier for the category of event.) + */ + // syntactic sugar + public CodeableConcept addSubtype() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.subtype == null) + this.subtype = new ArrayList(); + this.subtype.add(t); + return t; + } + + /** + * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public Enumeration getActionElement() { + if (this.action == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventEventComponent.action"); + else if (Configuration.doAutoCreate()) + this.action = new Enumeration(); + return this.action; + } + + public boolean hasActionElement() { + return this.action != null && !this.action.isEmpty(); + } + + public boolean hasAction() { + return this.action != null && !this.action.isEmpty(); + } + + /** + * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value + */ + public SecurityEventEventComponent setActionElement(Enumeration value) { + this.action = value; + return this; + } + + /** + * @return Indicator for type of action performed during the event that generated the audit. + */ + public SecurityEventAction getAction() { + return this.action == null ? null : this.action.getValue(); + } + + /** + * @param value Indicator for type of action performed during the event that generated the audit. + */ + public SecurityEventEventComponent setAction(SecurityEventAction value) { + if (value == null) + this.action = null; + else { + if (this.action == null) + this.action = new Enumeration(SecurityEventAction.ENUM_FACTORY); + this.action.setValue(value); + } + return this; + } + + /** + * @return {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public InstantType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventEventComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new InstantType(); + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public SecurityEventEventComponent setDateTimeElement(InstantType value) { + this.dateTime = value; + return this; + } + + /** + * @return The time when the event occurred on the source. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The time when the event occurred on the source. + */ + public SecurityEventEventComponent setDateTime(Date value) { + if (this.dateTime == null) + this.dateTime = new InstantType(); + this.dateTime.setValue(value); + return this; + } + + /** + * @return {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public Enumeration getOutcomeElement() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventEventComponent.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Enumeration(); + return this.outcome; + } + + public boolean hasOutcomeElement() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value + */ + public SecurityEventEventComponent setOutcomeElement(Enumeration value) { + this.outcome = value; + return this; + } + + /** + * @return Indicates whether the event succeeded or failed. + */ + public SecurityEventOutcome getOutcome() { + return this.outcome == null ? null : this.outcome.getValue(); + } + + /** + * @param value Indicates whether the event succeeded or failed. + */ + public SecurityEventEventComponent setOutcome(SecurityEventOutcome value) { + if (value == null) + this.outcome = null; + else { + if (this.outcome == null) + this.outcome = new Enumeration(SecurityEventOutcome.ENUM_FACTORY); + this.outcome.setValue(value); + } + return this; + } + + /** + * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value + */ + public StringType getOutcomeDescElement() { + if (this.outcomeDesc == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventEventComponent.outcomeDesc"); + else if (Configuration.doAutoCreate()) + this.outcomeDesc = new StringType(); + return this.outcomeDesc; + } + + public boolean hasOutcomeDescElement() { + return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); + } + + public boolean hasOutcomeDesc() { + return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); + } + + /** + * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value + */ + public SecurityEventEventComponent setOutcomeDescElement(StringType value) { + this.outcomeDesc = value; + return this; + } + + /** + * @return A free text description of the outcome of the event. + */ + public String getOutcomeDesc() { + return this.outcomeDesc == null ? null : this.outcomeDesc.getValue(); + } + + /** + * @param value A free text description of the outcome of the event. + */ + public SecurityEventEventComponent setOutcomeDesc(String value) { + if (Utilities.noString(value)) + this.outcomeDesc = null; + else { + if (this.outcomeDesc == null) + this.outcomeDesc = new StringType(); + this.outcomeDesc.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Identifier for a family of the event.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("subtype", "CodeableConcept", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action)); + childrenList.add(new Property("dateTime", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); + } + + public SecurityEventEventComponent copy() { + SecurityEventEventComponent dst = new SecurityEventEventComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + if (subtype != null) { + dst.subtype = new ArrayList(); + for (CodeableConcept i : subtype) + dst.subtype.add(i.copy()); + }; + dst.action = action == null ? null : action.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) + && (action == null || action.isEmpty()) && (dateTime == null || dateTime.isEmpty()) && (outcome == null || outcome.isEmpty()) + && (outcomeDesc == null || outcomeDesc.isEmpty()); + } + + } + + @Block() + public static class SecurityEventParticipantComponent extends BackboneElement { + /** + * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context. + */ + @Child(name="role", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="User roles (e.g. local RBAC codes)", formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context." ) + protected List role; + + /** + * Direct reference to a resource that identifies the participant. + */ + @Child(name="reference", type={Practitioner.class, Patient.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the participant." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (Direct reference to a resource that identifies the participant.) + */ + protected Resource referenceTarget; + + /** + * Unique identifier for the user actively participating in the event. + */ + @Child(name="userId", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." ) + protected StringType userId; + + /** + * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + */ + @Child(name="altId", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available." ) + protected StringType altId; + + /** + * Human-meaningful name for the user. + */ + @Child(name="name", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Human-meaningful name for the user", formalDefinition="Human-meaningful name for the user." ) + protected StringType name; + + /** + * Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + @Child(name="requestor", type={BooleanType.class}, order=6, min=1, max=1) + @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." ) + protected BooleanType requestor; + + /** + * Type of media involved. Used when the event is about exporting/importing onto media. + */ + @Child(name="media", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." ) + protected Coding media; + + /** + * Logical network location for application activity, if the activity has a network location. + */ + @Child(name="network", type={}, order=8, min=0, max=1) + @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." ) + protected SecurityEventParticipantNetworkComponent network; + + private static final long serialVersionUID = 594416195L; + + public SecurityEventParticipantComponent() { + super(); + } + + public SecurityEventParticipantComponent(BooleanType requestor) { + super(); + this.requestor = requestor; + } + + /** + * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) + */ + public List getRole() { + if (this.role == null) + this.role = new ArrayList(); + return this.role; + } + + public boolean hasRole() { + if (this.role == null) + return false; + for (CodeableConcept item : this.role) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #role} (Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.) + */ + // syntactic sugar + public CodeableConcept addRole() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.role == null) + this.role = new ArrayList(); + this.role.add(t); + return t; + } + + /** + * @return {@link #reference} (Direct reference to a resource that identifies the participant.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Direct reference to a resource that identifies the participant.) + */ + public SecurityEventParticipantComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} 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. (Direct reference to a resource that identifies the participant.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} 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. (Direct reference to a resource that identifies the participant.) + */ + public SecurityEventParticipantComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value + */ + public StringType getUserIdElement() { + if (this.userId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.userId"); + else if (Configuration.doAutoCreate()) + this.userId = new StringType(); + return this.userId; + } + + public boolean hasUserIdElement() { + return this.userId != null && !this.userId.isEmpty(); + } + + public boolean hasUserId() { + return this.userId != null && !this.userId.isEmpty(); + } + + /** + * @param value {@link #userId} (Unique identifier for the user actively participating in the event.). This is the underlying object with id, value and extensions. The accessor "getUserId" gives direct access to the value + */ + public SecurityEventParticipantComponent setUserIdElement(StringType value) { + this.userId = value; + return this; + } + + /** + * @return Unique identifier for the user actively participating in the event. + */ + public String getUserId() { + return this.userId == null ? null : this.userId.getValue(); + } + + /** + * @param value Unique identifier for the user actively participating in the event. + */ + public SecurityEventParticipantComponent setUserId(String value) { + if (Utilities.noString(value)) + this.userId = null; + else { + if (this.userId == null) + this.userId = new StringType(); + this.userId.setValue(value); + } + return this; + } + + /** + * @return {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value + */ + public StringType getAltIdElement() { + if (this.altId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.altId"); + else if (Configuration.doAutoCreate()) + this.altId = new StringType(); + return this.altId; + } + + public boolean hasAltIdElement() { + return this.altId != null && !this.altId.isEmpty(); + } + + public boolean hasAltId() { + return this.altId != null && !this.altId.isEmpty(); + } + + /** + * @param value {@link #altId} (Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value + */ + public SecurityEventParticipantComponent setAltIdElement(StringType value) { + this.altId = value; + return this; + } + + /** + * @return Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + */ + public String getAltId() { + return this.altId == null ? null : this.altId.getValue(); + } + + /** + * @param value Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + */ + public SecurityEventParticipantComponent setAltId(String value) { + if (Utilities.noString(value)) + this.altId = null; + else { + if (this.altId == null) + this.altId = new StringType(); + this.altId.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (Human-meaningful name for the user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SecurityEventParticipantComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return Human-meaningful name for the user. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value Human-meaningful name for the user. + */ + public SecurityEventParticipantComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value + */ + public BooleanType getRequestorElement() { + if (this.requestor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.requestor"); + else if (Configuration.doAutoCreate()) + this.requestor = new BooleanType(); + return this.requestor; + } + + public boolean hasRequestorElement() { + return this.requestor != null && !this.requestor.isEmpty(); + } + + public boolean hasRequestor() { + return this.requestor != null && !this.requestor.isEmpty(); + } + + /** + * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value + */ + public SecurityEventParticipantComponent setRequestorElement(BooleanType value) { + this.requestor = value; + return this; + } + + /** + * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + public boolean getRequestor() { + return this.requestor == null ? false : this.requestor.getValue(); + } + + /** + * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited. + */ + public SecurityEventParticipantComponent setRequestor(boolean value) { + if (this.requestor == null) + this.requestor = new BooleanType(); + this.requestor.setValue(value); + return this; + } + + /** + * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) + */ + public Coding getMedia() { + if (this.media == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.media"); + else if (Configuration.doAutoCreate()) + this.media = new Coding(); + return this.media; + } + + public boolean hasMedia() { + return this.media != null && !this.media.isEmpty(); + } + + /** + * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) + */ + public SecurityEventParticipantComponent setMedia(Coding value) { + this.media = value; + return this; + } + + /** + * @return {@link #network} (Logical network location for application activity, if the activity has a network location.) + */ + public SecurityEventParticipantNetworkComponent getNetwork() { + if (this.network == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantComponent.network"); + else if (Configuration.doAutoCreate()) + this.network = new SecurityEventParticipantNetworkComponent(); + return this.network; + } + + public boolean hasNetwork() { + return this.network != null && !this.network.isEmpty(); + } + + /** + * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.) + */ + public SecurityEventParticipantComponent setNetwork(SecurityEventParticipantNetworkComponent value) { + this.network = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "CodeableConcept", "Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("reference", "Reference(Practitioner|Patient|Device)", "Direct reference to a resource that identifies the participant.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("userId", "string", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId)); + childrenList.add(new Property("altId", "string", "Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available.", 0, java.lang.Integer.MAX_VALUE, altId)); + childrenList.add(new Property("name", "string", "Human-meaningful name for the user.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor)); + childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); + childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); + } + + public SecurityEventParticipantComponent copy() { + SecurityEventParticipantComponent dst = new SecurityEventParticipantComponent(); + copyValues(dst); + if (role != null) { + dst.role = new ArrayList(); + for (CodeableConcept i : role) + dst.role.add(i.copy()); + }; + dst.reference = reference == null ? null : reference.copy(); + dst.userId = userId == null ? null : userId.copy(); + dst.altId = altId == null ? null : altId.copy(); + dst.name = name == null ? null : name.copy(); + dst.requestor = requestor == null ? null : requestor.copy(); + dst.media = media == null ? null : media.copy(); + dst.network = network == null ? null : network.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty()) + && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty()) + && (requestor == null || requestor.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty()) + ; + } + + } + + @Block() + public static class SecurityEventParticipantNetworkComponent extends BackboneElement { + /** + * An identifier for the network access point of the user device for the audit event. + */ + @Child(name="identifier", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Identifier for the network access point of the user device", formalDefinition="An identifier for the network access point of the user device for the audit event." ) + protected StringType identifier; + + /** + * An identifier for the type of network access point that originated the audit event. + */ + @Child(name="type", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." ) + protected Enumeration type; + + private static final long serialVersionUID = -1946856025L; + + public SecurityEventParticipantNetworkComponent() { + super(); + } + + /** + * @return {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantNetworkComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public SecurityEventParticipantNetworkComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return An identifier for the network access point of the user device for the audit event. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value An identifier for the network access point of the user device for the audit event. + */ + public SecurityEventParticipantNetworkComponent setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventParticipantNetworkComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SecurityEventParticipantNetworkComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return An identifier for the type of network access point that originated the audit event. + */ + public NetworkType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value An identifier for the type of network access point that originated the audit event. + */ + public SecurityEventParticipantNetworkComponent setType(NetworkType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(NetworkType.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + public SecurityEventParticipantNetworkComponent copy() { + SecurityEventParticipantNetworkComponent dst = new SecurityEventParticipantNetworkComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.type = type == null ? null : type.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + ; + } + + } + + @Block() + public static class SecurityEventSourceComponent extends BackboneElement { + /** + * Logical source location within the healthcare enterprise network. + */ + @Child(name="site", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network." ) + protected StringType site; + + /** + * Identifier of the source where the event originated. + */ + @Child(name="identifier", type={StringType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The id of source where event originated", formalDefinition="Identifier of the source where the event originated." ) + protected StringType identifier; + + /** + * Code specifying the type of source where event originated. + */ + @Child(name="type", type={Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." ) + protected List type; + + private static final long serialVersionUID = -382040480L; + + public SecurityEventSourceComponent() { + super(); + } + + public SecurityEventSourceComponent(StringType identifier) { + super(); + this.identifier = identifier; + } + + /** + * @return {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value + */ + public StringType getSiteElement() { + if (this.site == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventSourceComponent.site"); + else if (Configuration.doAutoCreate()) + this.site = new StringType(); + return this.site; + } + + public boolean hasSiteElement() { + return this.site != null && !this.site.isEmpty(); + } + + public boolean hasSite() { + return this.site != null && !this.site.isEmpty(); + } + + /** + * @param value {@link #site} (Logical source location within the healthcare enterprise network.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value + */ + public SecurityEventSourceComponent setSiteElement(StringType value) { + this.site = value; + return this; + } + + /** + * @return Logical source location within the healthcare enterprise network. + */ + public String getSite() { + return this.site == null ? null : this.site.getValue(); + } + + /** + * @param value Logical source location within the healthcare enterprise network. + */ + public SecurityEventSourceComponent setSite(String value) { + if (Utilities.noString(value)) + this.site = null; + else { + if (this.site == null) + this.site = new StringType(); + this.site.setValue(value); + } + return this; + } + + /** + * @return {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public StringType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventSourceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new StringType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier of the source where the event originated.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public SecurityEventSourceComponent setIdentifierElement(StringType value) { + this.identifier = value; + return this; + } + + /** + * @return Identifier of the source where the event originated. + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value Identifier of the source where the event originated. + */ + public SecurityEventSourceComponent setIdentifier(String value) { + if (this.identifier == null) + this.identifier = new StringType(); + this.identifier.setValue(value); + return this; + } + + /** + * @return {@link #type} (Code specifying the type of source where event originated.) + */ + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; + } + + public boolean hasType() { + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #type} (Code specifying the type of source where event originated.) + */ + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network.", 0, java.lang.Integer.MAX_VALUE, site)); + childrenList.add(new Property("identifier", "string", "Identifier of the source where the event originated.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type)); + } + + public SecurityEventSourceComponent copy() { + SecurityEventSourceComponent dst = new SecurityEventSourceComponent(); + copyValues(dst); + dst.site = site == null ? null : site.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (type == null || type.isEmpty()); + } + + } + + @Block() + public static class SecurityEventObjectComponent extends BackboneElement { + /** + * Identifies a specific instance of the participant object. The reference should always be version specific. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) + protected Identifier identifier; + + /** + * Identifies a specific instance of the participant object. The reference should always be version specific. + */ + @Child(name="reference", type={}, order=2, min=0, max=1) + @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific." ) + protected Reference reference; + + /** + * The actual object that is the target of the reference (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + protected Resource referenceTarget; + + /** + * Object type being audited. + */ + @Child(name="type", type={CodeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Object type being audited", formalDefinition="Object type being audited." ) + protected Enumeration type; + + /** + * Code representing the functional application role of Participant Object being audited. + */ + @Child(name="role", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Functional application role of Object", formalDefinition="Code representing the functional application role of Participant Object being audited." ) + protected Enumeration role; + + /** + * Identifier for the data life-cycle stage for the participant object. + */ + @Child(name="lifecycle", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the participant object." ) + protected Enumeration lifecycle; + + /** + * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics. + */ + @Child(name="sensitivity", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Policy-defined sensitivity for the object", formalDefinition="Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics." ) + protected CodeableConcept sensitivity; + + /** + * An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + */ + @Child(name="name", type={StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Instance-specific descriptor for Object", formalDefinition="An instance-specific descriptor of the Participant Object ID audited, such as a person's name." ) + protected StringType name; + + /** + * Text that describes the object in more detail. + */ + @Child(name="description", type={StringType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the object in more detail." ) + protected StringType description; + + /** + * The actual query for a query-type participant object. + */ + @Child(name="query", type={Base64BinaryType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Actual query for object", formalDefinition="The actual query for a query-type participant object." ) + protected Base64BinaryType query; + + /** + * Additional Information about the Object. + */ + @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional Information about the Object", formalDefinition="Additional Information about the Object." ) + protected List detail; + + private static final long serialVersionUID = -268126947L; + + public SecurityEventObjectComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public SecurityEventObjectComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public Reference getReference() { + if (this.reference == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.reference"); + else if (Configuration.doAutoCreate()) + this.reference = new Reference(); + return this.reference; + } + + public boolean hasReference() { + return this.reference != null && !this.reference.isEmpty(); + } + + /** + * @param value {@link #reference} (Identifies a specific instance of the participant object. The reference should always be version specific.) + */ + public SecurityEventObjectComponent setReference(Reference value) { + this.reference = value; + return this; + } + + /** + * @return {@link #reference} 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 a specific instance of the participant object. The reference should always be version specific.) + */ + public Resource getReferenceTarget() { + return this.referenceTarget; + } + + /** + * @param value {@link #reference} 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 a specific instance of the participant object. The reference should always be version specific.) + */ + public SecurityEventObjectComponent setReferenceTarget(Resource value) { + this.referenceTarget = value; + return this; + } + + /** + * @return {@link #type} (Object type being audited.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Object type being audited.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SecurityEventObjectComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Object type being audited. + */ + public ObjectType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Object type being audited. + */ + public SecurityEventObjectComponent setType(ObjectType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(ObjectType.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public Enumeration getRoleElement() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new Enumeration(); + return this.role; + } + + public boolean hasRoleElement() { + return this.role != null && !this.role.isEmpty(); + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Code representing the functional application role of Participant Object being audited.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value + */ + public SecurityEventObjectComponent setRoleElement(Enumeration value) { + this.role = value; + return this; + } + + /** + * @return Code representing the functional application role of Participant Object being audited. + */ + public ObjectRole getRole() { + return this.role == null ? null : this.role.getValue(); + } + + /** + * @param value Code representing the functional application role of Participant Object being audited. + */ + public SecurityEventObjectComponent setRole(ObjectRole value) { + if (value == null) + this.role = null; + else { + if (this.role == null) + this.role = new Enumeration(ObjectRole.ENUM_FACTORY); + this.role.setValue(value); + } + return this; + } + + /** + * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value + */ + public Enumeration getLifecycleElement() { + if (this.lifecycle == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.lifecycle"); + else if (Configuration.doAutoCreate()) + this.lifecycle = new Enumeration(); + return this.lifecycle; + } + + public boolean hasLifecycleElement() { + return this.lifecycle != null && !this.lifecycle.isEmpty(); + } + + public boolean hasLifecycle() { + return this.lifecycle != null && !this.lifecycle.isEmpty(); + } + + /** + * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the participant object.). This is the underlying object with id, value and extensions. The accessor "getLifecycle" gives direct access to the value + */ + public SecurityEventObjectComponent setLifecycleElement(Enumeration value) { + this.lifecycle = value; + return this; + } + + /** + * @return Identifier for the data life-cycle stage for the participant object. + */ + public ObjectLifecycle getLifecycle() { + return this.lifecycle == null ? null : this.lifecycle.getValue(); + } + + /** + * @param value Identifier for the data life-cycle stage for the participant object. + */ + public SecurityEventObjectComponent setLifecycle(ObjectLifecycle value) { + if (value == null) + this.lifecycle = null; + else { + if (this.lifecycle == null) + this.lifecycle = new Enumeration(ObjectLifecycle.ENUM_FACTORY); + this.lifecycle.setValue(value); + } + return this; + } + + /** + * @return {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) + */ + public CodeableConcept getSensitivity() { + if (this.sensitivity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.sensitivity"); + else if (Configuration.doAutoCreate()) + this.sensitivity = new CodeableConcept(); + return this.sensitivity; + } + + public boolean hasSensitivity() { + return this.sensitivity != null && !this.sensitivity.isEmpty(); + } + + /** + * @param value {@link #sensitivity} (Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.) + */ + public SecurityEventObjectComponent setSensitivity(CodeableConcept value) { + this.sensitivity = value; + return this; + } + + /** + * @return {@link #name} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (An instance-specific descriptor of the Participant Object ID audited, such as a person's name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public SecurityEventObjectComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + */ + public SecurityEventObjectComponent setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #description} (Text that describes the object in more detail.). 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 SecurityEventObjectComponent.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} (Text that describes the object in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SecurityEventObjectComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Text that describes the object in more detail. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Text that describes the object in more detail. + */ + public SecurityEventObjectComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value + */ + public Base64BinaryType getQueryElement() { + if (this.query == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectComponent.query"); + else if (Configuration.doAutoCreate()) + this.query = new Base64BinaryType(); + return this.query; + } + + public boolean hasQueryElement() { + return this.query != null && !this.query.isEmpty(); + } + + public boolean hasQuery() { + return this.query != null && !this.query.isEmpty(); + } + + /** + * @param value {@link #query} (The actual query for a query-type participant object.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value + */ + public SecurityEventObjectComponent setQueryElement(Base64BinaryType value) { + this.query = value; + return this; + } + + /** + * @return The actual query for a query-type participant object. + */ + public byte[] getQuery() { + return this.query == null ? null : this.query.getValue(); + } + + /** + * @param value The actual query for a query-type participant object. + */ + public SecurityEventObjectComponent setQuery(byte[] value) { + if (value == null) + this.query = null; + else { + if (this.query == null) + this.query = new Base64BinaryType(); + this.query.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (Additional Information about the Object.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (SecurityEventObjectDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Additional Information about the Object.) + */ + // syntactic sugar + public SecurityEventObjectDetailComponent addDetail() { //3 + SecurityEventObjectDetailComponent t = new SecurityEventObjectDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the participant object. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("type", "code", "Object type being audited.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("role", "code", "Code representing the functional application role of Participant Object being audited.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("lifecycle", "code", "Identifier for the data life-cycle stage for the participant object.", 0, java.lang.Integer.MAX_VALUE, lifecycle)); + childrenList.add(new Property("sensitivity", "CodeableConcept", "Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics.", 0, java.lang.Integer.MAX_VALUE, sensitivity)); + childrenList.add(new Property("name", "string", "An instance-specific descriptor of the Participant Object ID audited, such as a person's name.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("description", "string", "Text that describes the object in more detail.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("query", "base64Binary", "The actual query for a query-type participant object.", 0, java.lang.Integer.MAX_VALUE, query)); + childrenList.add(new Property("detail", "", "Additional Information about the Object.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public SecurityEventObjectComponent copy() { + SecurityEventObjectComponent dst = new SecurityEventObjectComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.reference = reference == null ? null : reference.copy(); + dst.type = type == null ? null : type.copy(); + dst.role = role == null ? null : role.copy(); + dst.lifecycle = lifecycle == null ? null : lifecycle.copy(); + dst.sensitivity = sensitivity == null ? null : sensitivity.copy(); + dst.name = name == null ? null : name.copy(); + dst.description = description == null ? null : description.copy(); + dst.query = query == null ? null : query.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (SecurityEventObjectDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) + && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty()) + && (sensitivity == null || sensitivity.isEmpty()) && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) + && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class SecurityEventObjectDetailComponent extends BackboneElement { + /** + * Name of the property. + */ + @Child(name="type", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." ) + protected StringType type; + + /** + * Property value. + */ + @Child(name="value", type={Base64BinaryType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Property value", formalDefinition="Property value." ) + protected Base64BinaryType value; + + private static final long serialVersionUID = 11139504L; + + public SecurityEventObjectDetailComponent() { + super(); + } + + public SecurityEventObjectDetailComponent(StringType type, Base64BinaryType value) { + super(); + this.type = type; + this.value = value; + } + + /** + * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public StringType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new StringType(); + 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} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SecurityEventObjectDetailComponent setTypeElement(StringType value) { + this.type = value; + return this; + } + + /** + * @return Name of the property. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Name of the property. + */ + public SecurityEventObjectDetailComponent setType(String value) { + if (this.type == null) + this.type = new StringType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public Base64BinaryType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEventObjectDetailComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new Base64BinaryType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public SecurityEventObjectDetailComponent setValueElement(Base64BinaryType value) { + this.value = value; + return this; + } + + /** + * @return Property value. + */ + public byte[] getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value Property value. + */ + public SecurityEventObjectDetailComponent setValue(byte[] value) { + if (this.value == null) + this.value = new Base64BinaryType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public SecurityEventObjectDetailComponent copy() { + SecurityEventObjectDetailComponent dst = new SecurityEventObjectDetailComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) + ; + } + + } + + /** + * Identifies the name, action type, time, and disposition of the audited event. + */ + @Child(name="event", type={}, order=-1, min=1, max=1) + @Description(shortDefinition="What was done", formalDefinition="Identifies the name, action type, time, and disposition of the audited event." ) + protected SecurityEventEventComponent event; + + /** + * A person, a hardware device or software process. + */ + @Child(name="participant", type={}, order=0, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A person, a hardware device or software process", formalDefinition="A person, a hardware device or software process." ) + protected List participant; + + /** + * Application systems and processes. + */ + @Child(name="source", type={}, order=1, min=1, max=1) + @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." ) + protected SecurityEventSourceComponent source; + + /** + * Specific instances of data or objects that have been accessed. + */ + @Child(name="object", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." ) + protected List object; + + private static final long serialVersionUID = -1695871760L; + + public SecurityEvent() { + super(); + } + + public SecurityEvent(SecurityEventEventComponent event, SecurityEventSourceComponent source) { + super(); + this.event = event; + this.source = source; + } + + /** + * @return {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) + */ + public SecurityEventEventComponent getEvent() { + if (this.event == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEvent.event"); + else if (Configuration.doAutoCreate()) + this.event = new SecurityEventEventComponent(); + return this.event; + } + + public boolean hasEvent() { + return this.event != null && !this.event.isEmpty(); + } + + /** + * @param value {@link #event} (Identifies the name, action type, time, and disposition of the audited event.) + */ + public SecurityEvent setEvent(SecurityEventEventComponent value) { + this.event = value; + return this; + } + + /** + * @return {@link #participant} (A person, a hardware device or software process.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (SecurityEventParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (A person, a hardware device or software process.) + */ + // syntactic sugar + public SecurityEventParticipantComponent addParticipant() { //3 + SecurityEventParticipantComponent t = new SecurityEventParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + /** + * @return {@link #source} (Application systems and processes.) + */ + public SecurityEventSourceComponent getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SecurityEvent.source"); + else if (Configuration.doAutoCreate()) + this.source = new SecurityEventSourceComponent(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Application systems and processes.) + */ + public SecurityEvent setSource(SecurityEventSourceComponent value) { + this.source = value; + return this; + } + + /** + * @return {@link #object} (Specific instances of data or objects that have been accessed.) + */ + public List getObject() { + if (this.object == null) + this.object = new ArrayList(); + return this.object; + } + + public boolean hasObject() { + if (this.object == null) + return false; + for (SecurityEventObjectComponent item : this.object) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #object} (Specific instances of data or objects that have been accessed.) + */ + // syntactic sugar + public SecurityEventObjectComponent addObject() { //3 + SecurityEventObjectComponent t = new SecurityEventObjectComponent(); + if (this.object == null) + this.object = new ArrayList(); + this.object.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "", "Identifies the name, action type, time, and disposition of the audited event.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("participant", "", "A person, a hardware device or software process.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("object", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, object)); + } + + public SecurityEvent copy() { + SecurityEvent dst = new SecurityEvent(); + copyValues(dst); + dst.event = event == null ? null : event.copy(); + if (participant != null) { + dst.participant = new ArrayList(); + for (SecurityEventParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.source = source == null ? null : source.copy(); + if (object != null) { + dst.object = new ArrayList(); + for (SecurityEventObjectComponent i : object) + dst.object.add(i.copy()); + }; + return dst; + } + + protected SecurityEvent typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (participant == null || participant.isEmpty()) + && (source == null || source.isEmpty()) && (object == null || object.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SecurityEvent; + } + + @SearchParamDefinition(name="site", path="SecurityEvent.source.site", description="Logical source location within the enterprise", type="token" ) + public static final String SP_SITE = "site"; + @SearchParamDefinition(name="desc", path="SecurityEvent.object.name", description="Instance-specific descriptor for Object", type="string" ) + public static final String SP_DESC = "desc"; + @SearchParamDefinition(name="type", path="SecurityEvent.event.type", description="Type/identifier of event", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="date", path="SecurityEvent.event.dateTime", description="Time when the event occurred on source", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="reference", path="SecurityEvent.object.reference", description="Specific instance of resource (e.g. versioned)", type="reference" ) + public static final String SP_REFERENCE = "reference"; + @SearchParamDefinition(name="identity", path="SecurityEvent.object.identifier", description="Specific instance of object (e.g. versioned)", type="token" ) + public static final String SP_IDENTITY = "identity"; + @SearchParamDefinition(name="patient", path="", description="A patient that the .object.reference refers to", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="altid", path="SecurityEvent.participant.altId", description="Alternative User id e.g. authentication", type="token" ) + public static final String SP_ALTID = "altid"; + @SearchParamDefinition(name="patientid", path="", description="The id of the patient (one of multiple kinds of participations)", type="token" ) + public static final String SP_PATIENTID = "patientid"; + @SearchParamDefinition(name="source", path="SecurityEvent.source.identifier", description="The id of source where event originated", type="token" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="address", path="SecurityEvent.participant.network.identifier", description="Identifier for the network access point of the user device", type="token" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="subtype", path="SecurityEvent.event.subtype", description="More specific type/id for the event", type="token" ) + public static final String SP_SUBTYPE = "subtype"; + @SearchParamDefinition(name="name", path="SecurityEvent.participant.name", description="Human-meaningful name for the user", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="action", path="SecurityEvent.event.action", description="Type of action performed during the event", type="token" ) + public static final String SP_ACTION = "action"; + @SearchParamDefinition(name="object-type", path="SecurityEvent.object.type", description="Object type being audited", type="token" ) + public static final String SP_OBJECTTYPE = "object-type"; + @SearchParamDefinition(name="user", path="SecurityEvent.participant.userId", description="Unique identifier for the user", type="token" ) + public static final String SP_USER = "user"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java index 0737a9f950f..5e0c3bb458e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java @@ -1,31 +1,31 @@ -/* -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. - - */ +/* +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. + + */ package org.hl7.fhir.instance.model; /* @@ -48,40 +48,40 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.net.URI; - -public class SidType extends UriType { - - private static final long serialVersionUID = 2L; - - /** - * Constructor - */ - public SidType() { - super(); - } - - /** - * Constructor - */ - public SidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public SidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public SidType copy() { - return new SidType(getValue()); - } - -} + +import java.net.URI; + +public class SidType extends UriType { + + private static final long serialVersionUID = 2L; + + /** + * Constructor + */ + public SidType() { + super(); + } + + /** + * Constructor + */ + public SidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public SidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public SidType copy() { + return new SidType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java index 85d070cde1f..9fc9a8797e3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java @@ -20,675 +20,675 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * (informative) A slot of time on a schedule that may be available for booking appointments. - */ -@ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") -public class Slot extends DomainResource { - - public enum Slotstatus implements FhirEnum { - /** - * Indicates that the time interval is busy because one or more events have been scheduled for that interval. - */ - BUSY, - /** - * Indicates that the time interval is free for scheduling. - */ - FREE, - /** - * Indicates that the time interval is busy and that the interval can not be scheduled. - */ - BUSYUNAVAILABLE, - /** - * Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval. - */ - BUSYTENTATIVE, - /** - * added to help the parsers - */ - NULL; - - public static final SlotstatusEnumFactory ENUM_FACTORY = new SlotstatusEnumFactory(); - - public static Slotstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("BUSY".equals(codeString)) - return BUSY; - if ("FREE".equals(codeString)) - return FREE; - if ("BUSY-UNAVAILABLE".equals(codeString)) - return BUSYUNAVAILABLE; - if ("BUSY-TENTATIVE".equals(codeString)) - return BUSYTENTATIVE; - throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case BUSY: return "BUSY"; - case FREE: return "FREE"; - case BUSYUNAVAILABLE: return "BUSY-UNAVAILABLE"; - case BUSYTENTATIVE: return "BUSY-TENTATIVE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BUSY: return ""; - case FREE: return ""; - case BUSYUNAVAILABLE: return ""; - case BUSYTENTATIVE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BUSY: return "Indicates that the time interval is busy because one or more events have been scheduled for that interval."; - case FREE: return "Indicates that the time interval is free for scheduling."; - case BUSYUNAVAILABLE: return "Indicates that the time interval is busy and that the interval can not be scheduled."; - case BUSYTENTATIVE: return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BUSY: return "BUSY"; - case FREE: return "FREE"; - case BUSYUNAVAILABLE: return "BUSY-UNAVAILABLE"; - case BUSYTENTATIVE: return "BUSY-TENTATIVE"; - default: return "?"; - } - } - } - - public static class SlotstatusEnumFactory implements EnumFactory { - public Slotstatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("BUSY".equals(codeString)) - return Slotstatus.BUSY; - if ("FREE".equals(codeString)) - return Slotstatus.FREE; - if ("BUSY-UNAVAILABLE".equals(codeString)) - return Slotstatus.BUSYUNAVAILABLE; - if ("BUSY-TENTATIVE".equals(codeString)) - return Slotstatus.BUSYTENTATIVE; - throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); - } - public String toCode(Slotstatus code) throws IllegalArgumentException { - if (code == Slotstatus.BUSY) - return "BUSY"; - if (code == Slotstatus.FREE) - return "FREE"; - if (code == Slotstatus.BUSYUNAVAILABLE) - return "BUSY-UNAVAILABLE"; - if (code == Slotstatus.BUSYTENTATIVE) - return "BUSY-TENTATIVE"; - return "?"; - } - } - - /** - * External Ids for this item. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. - */ - @Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource", formalDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource." ) - protected CodeableConcept type; - - /** - * The availability resource that this slot defines an interval of status information. - */ - @Child(name="availability", type={Availability.class}, order=1, min=1, max=1) - @Description(shortDefinition="The availability resource that this slot defines an interval of status information", formalDefinition="The availability resource that this slot defines an interval of status information." ) - protected Reference availability; - - /** - * The actual object that is the target of the reference (The availability resource that this slot defines an interval of status information.) - */ - protected Availability availabilityTarget; - - /** - * BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. - */ - @Child(name="freeBusyType", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE", formalDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE." ) - protected Enumeration freeBusyType; - - /** - * Date/Time that the slot is to begin. - */ - @Child(name="start", type={InstantType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Date/Time that the slot is to begin", formalDefinition="Date/Time that the slot is to begin." ) - protected InstantType start; - - /** - * Date/Time that the slot is to conclude. - */ - @Child(name="end", type={InstantType.class}, order=4, min=1, max=1) - @Description(shortDefinition="Date/Time that the slot is to conclude", formalDefinition="Date/Time that the slot is to conclude." ) - protected InstantType end; - - /** - * This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - @Child(name="overbooked", type={BooleanType.class}, order=5, min=0, max=1) - @Description(shortDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time", formalDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time." ) - protected BooleanType overbooked; - - /** - * Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - @Child(name="comment", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", formalDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot." ) - protected StringType comment; - - /** - * When this slot was created, or last revised. - */ - @Child(name="lastModified", type={DateTimeType.class}, order=7, min=0, max=1) - @Description(shortDefinition="When this slot was created, or last revised", formalDefinition="When this slot was created, or last revised." ) - protected DateTimeType lastModified; - - private static final long serialVersionUID = 2056947959L; - - public Slot() { - super(); - } - - public Slot(Reference availability, Enumeration freeBusyType, InstantType start, InstantType end) { - super(); - this.availability = availability; - this.freeBusyType = freeBusyType; - this.start = start; - this.end = end; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) - */ - public Slot setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #availability} (The availability resource that this slot defines an interval of status information.) - */ - public Reference getAvailability() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Reference(); - return this.availability; - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (The availability resource that this slot defines an interval of status information.) - */ - public Slot setAvailability(Reference value) { - this.availability = value; - return this; - } - - /** - * @return {@link #availability} 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 availability resource that this slot defines an interval of status information.) - */ - public Availability getAvailabilityTarget() { - if (this.availabilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.availability"); - else if (Configuration.doAutoCreate()) - this.availabilityTarget = new Availability(); - return this.availabilityTarget; - } - - /** - * @param value {@link #availability} 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 availability resource that this slot defines an interval of status information.) - */ - public Slot setAvailabilityTarget(Availability value) { - this.availabilityTarget = value; - return this; - } - - /** - * @return {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value - */ - public Enumeration getFreeBusyTypeElement() { - if (this.freeBusyType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.freeBusyType"); - else if (Configuration.doAutoCreate()) - this.freeBusyType = new Enumeration(); - return this.freeBusyType; - } - - public boolean hasFreeBusyTypeElement() { - return this.freeBusyType != null && !this.freeBusyType.isEmpty(); - } - - public boolean hasFreeBusyType() { - return this.freeBusyType != null && !this.freeBusyType.isEmpty(); - } - - /** - * @param value {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value - */ - public Slot setFreeBusyTypeElement(Enumeration value) { - this.freeBusyType = value; - return this; - } - - /** - * @return BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. - */ - public Slotstatus getFreeBusyType() { - return this.freeBusyType == null ? null : this.freeBusyType.getValue(); - } - - /** - * @param value BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. - */ - public Slot setFreeBusyType(Slotstatus value) { - if (this.freeBusyType == null) - this.freeBusyType = new Enumeration(Slotstatus.ENUM_FACTORY); - this.freeBusyType.setValue(value); - return this; - } - - /** - * @return {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Slot setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the slot is to begin. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value Date/Time that the slot is to begin. - */ - public Slot setStart(Date value) { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Slot setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the slot is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the slot is to conclude. - */ - public Slot setEnd(Date value) { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value - */ - public BooleanType getOverbookedElement() { - if (this.overbooked == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.overbooked"); - else if (Configuration.doAutoCreate()) - this.overbooked = new BooleanType(); - return this.overbooked; - } - - public boolean hasOverbookedElement() { - return this.overbooked != null && !this.overbooked.isEmpty(); - } - - public boolean hasOverbooked() { - return this.overbooked != null && !this.overbooked.isEmpty(); - } - - /** - * @param value {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value - */ - public Slot setOverbookedElement(BooleanType value) { - this.overbooked = value; - return this; - } - - /** - * @return This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - public boolean getOverbooked() { - return this.overbooked == null ? false : this.overbooked.getValue(); - } - - /** - * @param value This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - public Slot setOverbooked(boolean value) { - if (value == false) - this.overbooked = null; - else { - if (this.overbooked == null) - this.overbooked = new BooleanType(); - this.overbooked.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Slot setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - public Slot setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #lastModified} (When this slot was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public DateTimeType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new DateTimeType(); - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (When this slot was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public Slot setLastModifiedElement(DateTimeType value) { - this.lastModified = value; - return this; - } - - /** - * @return When this slot was created, or last revised. - */ - public Date getLastModified() { - return this.lastModified == null ? null : this.lastModified.getValue(); - } - - /** - * @param value When this slot was created, or last revised. - */ - public Slot setLastModified(Date value) { - if (value == null) - this.lastModified = null; - else { - if (this.lastModified == null) - this.lastModified = new DateTimeType(); - this.lastModified.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("availability", "Reference(Availability)", "The availability resource that this slot defines an interval of status information.", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("freeBusyType", "code", "BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.", 0, java.lang.Integer.MAX_VALUE, freeBusyType)); - childrenList.add(new Property("start", "instant", "Date/Time that the slot is to begin.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the slot is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("overbooked", "boolean", "This slot has already been overbooked, appointments are unlikely to be accepted for this time.", 0, java.lang.Integer.MAX_VALUE, overbooked)); - childrenList.add(new Property("comment", "string", "Comments on the slot to describe any extended information. Such as custom constraints on the slot.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("lastModified", "dateTime", "When this slot was created, or last revised.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - } - - public Slot copy() { - Slot dst = new Slot(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.availability = availability == null ? null : availability.copy(); - dst.freeBusyType = freeBusyType == null ? null : freeBusyType.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.overbooked = overbooked == null ? null : overbooked.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - return dst; - } - - protected Slot typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (availability == null || availability.isEmpty()) && (freeBusyType == null || freeBusyType.isEmpty()) - && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (overbooked == null || overbooked.isEmpty()) - && (comment == null || comment.isEmpty()) && (lastModified == null || lastModified.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Slot; - } - - @SearchParamDefinition(name="start", path="Slot.start", description="Appointment date/time.", type="date" ) - public static final String SP_START = "start"; - @SearchParamDefinition(name="slottype", path="Slot.type", description="The type of appointments that can be booked into the slot", type="token" ) - public static final String SP_SLOTTYPE = "slottype"; - @SearchParamDefinition(name="fbtype", path="Slot.freeBusyType", description="The free/busy status of the appointment", type="token" ) - public static final String SP_FBTYPE = "fbtype"; - @SearchParamDefinition(name="availability", path="Slot.availability", description="The Availability Resource that we are seeking a slot within", type="reference" ) - public static final String SP_AVAILABILITY = "availability"; - -} - + +/* + 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; +/** + * (informative) A slot of time on a schedule that may be available for booking appointments. + */ +@ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") +public class Slot extends DomainResource { + + public enum Slotstatus implements FhirEnum { + /** + * Indicates that the time interval is busy because one or more events have been scheduled for that interval. + */ + BUSY, + /** + * Indicates that the time interval is free for scheduling. + */ + FREE, + /** + * Indicates that the time interval is busy and that the interval can not be scheduled. + */ + BUSYUNAVAILABLE, + /** + * Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval. + */ + BUSYTENTATIVE, + /** + * added to help the parsers + */ + NULL; + + public static final SlotstatusEnumFactory ENUM_FACTORY = new SlotstatusEnumFactory(); + + public static Slotstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("BUSY".equals(codeString)) + return BUSY; + if ("FREE".equals(codeString)) + return FREE; + if ("BUSY-UNAVAILABLE".equals(codeString)) + return BUSYUNAVAILABLE; + if ("BUSY-TENTATIVE".equals(codeString)) + return BUSYTENTATIVE; + throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case BUSY: return "BUSY"; + case FREE: return "FREE"; + case BUSYUNAVAILABLE: return "BUSY-UNAVAILABLE"; + case BUSYTENTATIVE: return "BUSY-TENTATIVE"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case BUSY: return ""; + case FREE: return ""; + case BUSYUNAVAILABLE: return ""; + case BUSYTENTATIVE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case BUSY: return "Indicates that the time interval is busy because one or more events have been scheduled for that interval."; + case FREE: return "Indicates that the time interval is free for scheduling."; + case BUSYUNAVAILABLE: return "Indicates that the time interval is busy and that the interval can not be scheduled."; + case BUSYTENTATIVE: return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case BUSY: return "BUSY"; + case FREE: return "FREE"; + case BUSYUNAVAILABLE: return "BUSY-UNAVAILABLE"; + case BUSYTENTATIVE: return "BUSY-TENTATIVE"; + default: return "?"; + } + } + } + + public static class SlotstatusEnumFactory implements EnumFactory { + public Slotstatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("BUSY".equals(codeString)) + return Slotstatus.BUSY; + if ("FREE".equals(codeString)) + return Slotstatus.FREE; + if ("BUSY-UNAVAILABLE".equals(codeString)) + return Slotstatus.BUSYUNAVAILABLE; + if ("BUSY-TENTATIVE".equals(codeString)) + return Slotstatus.BUSYTENTATIVE; + throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); + } + public String toCode(Slotstatus code) throws IllegalArgumentException { + if (code == Slotstatus.BUSY) + return "BUSY"; + if (code == Slotstatus.FREE) + return "FREE"; + if (code == Slotstatus.BUSYUNAVAILABLE) + return "BUSY-UNAVAILABLE"; + if (code == Slotstatus.BUSYTENTATIVE) + return "BUSY-TENTATIVE"; + return "?"; + } + } + + /** + * External Ids for this item. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) + protected List identifier; + + /** + * The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. + */ + @Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource", formalDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource." ) + protected CodeableConcept type; + + /** + * The availability resource that this slot defines an interval of status information. + */ + @Child(name="availability", type={Availability.class}, order=1, min=1, max=1) + @Description(shortDefinition="The availability resource that this slot defines an interval of status information", formalDefinition="The availability resource that this slot defines an interval of status information." ) + protected Reference availability; + + /** + * The actual object that is the target of the reference (The availability resource that this slot defines an interval of status information.) + */ + protected Availability availabilityTarget; + + /** + * BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + */ + @Child(name="freeBusyType", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE", formalDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE." ) + protected Enumeration freeBusyType; + + /** + * Date/Time that the slot is to begin. + */ + @Child(name="start", type={InstantType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Date/Time that the slot is to begin", formalDefinition="Date/Time that the slot is to begin." ) + protected InstantType start; + + /** + * Date/Time that the slot is to conclude. + */ + @Child(name="end", type={InstantType.class}, order=4, min=1, max=1) + @Description(shortDefinition="Date/Time that the slot is to conclude", formalDefinition="Date/Time that the slot is to conclude." ) + protected InstantType end; + + /** + * This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + @Child(name="overbooked", type={BooleanType.class}, order=5, min=0, max=1) + @Description(shortDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time", formalDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time." ) + protected BooleanType overbooked; + + /** + * Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + @Child(name="comment", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", formalDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot." ) + protected StringType comment; + + /** + * When this slot was created, or last revised. + */ + @Child(name="lastModified", type={DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="When this slot was created, or last revised", formalDefinition="When this slot was created, or last revised." ) + protected DateTimeType lastModified; + + private static final long serialVersionUID = 2056947959L; + + public Slot() { + super(); + } + + public Slot(Reference availability, Enumeration freeBusyType, InstantType start, InstantType end) { + super(); + this.availability = availability; + this.freeBusyType = freeBusyType; + this.start = start; + this.end = end; + } + + /** + * @return {@link #identifier} (External Ids for this item.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (External Ids for this item.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.) + */ + public Slot setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #availability} (The availability resource that this slot defines an interval of status information.) + */ + public Reference getAvailability() { + if (this.availability == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.availability"); + else if (Configuration.doAutoCreate()) + this.availability = new Reference(); + return this.availability; + } + + public boolean hasAvailability() { + return this.availability != null && !this.availability.isEmpty(); + } + + /** + * @param value {@link #availability} (The availability resource that this slot defines an interval of status information.) + */ + public Slot setAvailability(Reference value) { + this.availability = value; + return this; + } + + /** + * @return {@link #availability} 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 availability resource that this slot defines an interval of status information.) + */ + public Availability getAvailabilityTarget() { + if (this.availabilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.availability"); + else if (Configuration.doAutoCreate()) + this.availabilityTarget = new Availability(); + return this.availabilityTarget; + } + + /** + * @param value {@link #availability} 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 availability resource that this slot defines an interval of status information.) + */ + public Slot setAvailabilityTarget(Availability value) { + this.availabilityTarget = value; + return this; + } + + /** + * @return {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value + */ + public Enumeration getFreeBusyTypeElement() { + if (this.freeBusyType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.freeBusyType"); + else if (Configuration.doAutoCreate()) + this.freeBusyType = new Enumeration(); + return this.freeBusyType; + } + + public boolean hasFreeBusyTypeElement() { + return this.freeBusyType != null && !this.freeBusyType.isEmpty(); + } + + public boolean hasFreeBusyType() { + return this.freeBusyType != null && !this.freeBusyType.isEmpty(); + } + + /** + * @param value {@link #freeBusyType} (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.). This is the underlying object with id, value and extensions. The accessor "getFreeBusyType" gives direct access to the value + */ + public Slot setFreeBusyTypeElement(Enumeration value) { + this.freeBusyType = value; + return this; + } + + /** + * @return BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + */ + public Slotstatus getFreeBusyType() { + return this.freeBusyType == null ? null : this.freeBusyType.getValue(); + } + + /** + * @param value BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + */ + public Slot setFreeBusyType(Slotstatus value) { + if (this.freeBusyType == null) + this.freeBusyType = new Enumeration(Slotstatus.ENUM_FACTORY); + this.freeBusyType.setValue(value); + return this; + } + + /** + * @return {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public InstantType getStartElement() { + if (this.start == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.start"); + else if (Configuration.doAutoCreate()) + this.start = new InstantType(); + return this.start; + } + + public boolean hasStartElement() { + return this.start != null && !this.start.isEmpty(); + } + + public boolean hasStart() { + return this.start != null && !this.start.isEmpty(); + } + + /** + * @param value {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value + */ + public Slot setStartElement(InstantType value) { + this.start = value; + return this; + } + + /** + * @return Date/Time that the slot is to begin. + */ + public Date getStart() { + return this.start == null ? null : this.start.getValue(); + } + + /** + * @param value Date/Time that the slot is to begin. + */ + public Slot setStart(Date value) { + if (this.start == null) + this.start = new InstantType(); + this.start.setValue(value); + return this; + } + + /** + * @return {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Slot setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Date/Time that the slot is to conclude. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Date/Time that the slot is to conclude. + */ + public Slot setEnd(Date value) { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + return this; + } + + /** + * @return {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value + */ + public BooleanType getOverbookedElement() { + if (this.overbooked == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.overbooked"); + else if (Configuration.doAutoCreate()) + this.overbooked = new BooleanType(); + return this.overbooked; + } + + public boolean hasOverbookedElement() { + return this.overbooked != null && !this.overbooked.isEmpty(); + } + + public boolean hasOverbooked() { + return this.overbooked != null && !this.overbooked.isEmpty(); + } + + /** + * @param value {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value + */ + public Slot setOverbookedElement(BooleanType value) { + this.overbooked = value; + return this; + } + + /** + * @return This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + public boolean getOverbooked() { + return this.overbooked == null ? false : this.overbooked.getValue(); + } + + /** + * @param value This slot has already been overbooked, appointments are unlikely to be accepted for this time. + */ + public Slot setOverbooked(boolean value) { + if (value == false) + this.overbooked = null; + else { + if (this.overbooked == null) + this.overbooked = new BooleanType(); + this.overbooked.setValue(value); + } + return this; + } + + /** + * @return {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public StringType getCommentElement() { + if (this.comment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.comment"); + else if (Configuration.doAutoCreate()) + this.comment = new StringType(); + return this.comment; + } + + public boolean hasCommentElement() { + return this.comment != null && !this.comment.isEmpty(); + } + + public boolean hasComment() { + return this.comment != null && !this.comment.isEmpty(); + } + + /** + * @param value {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value + */ + public Slot setCommentElement(StringType value) { + this.comment = value; + return this; + } + + /** + * @return Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + public String getComment() { + return this.comment == null ? null : this.comment.getValue(); + } + + /** + * @param value Comments on the slot to describe any extended information. Such as custom constraints on the slot. + */ + public Slot setComment(String value) { + if (Utilities.noString(value)) + this.comment = null; + else { + if (this.comment == null) + this.comment = new StringType(); + this.comment.setValue(value); + } + return this; + } + + /** + * @return {@link #lastModified} (When this slot was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public DateTimeType getLastModifiedElement() { + if (this.lastModified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Slot.lastModified"); + else if (Configuration.doAutoCreate()) + this.lastModified = new DateTimeType(); + return this.lastModified; + } + + public boolean hasLastModifiedElement() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + public boolean hasLastModified() { + return this.lastModified != null && !this.lastModified.isEmpty(); + } + + /** + * @param value {@link #lastModified} (When this slot was created, or last revised.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value + */ + public Slot setLastModifiedElement(DateTimeType value) { + this.lastModified = value; + return this; + } + + /** + * @return When this slot was created, or last revised. + */ + public Date getLastModified() { + return this.lastModified == null ? null : this.lastModified.getValue(); + } + + /** + * @param value When this slot was created, or last revised. + */ + public Slot setLastModified(Date value) { + if (value == null) + this.lastModified = null; + else { + if (this.lastModified == null) + this.lastModified = new DateTimeType(); + this.lastModified.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("availability", "Reference(Availability)", "The availability resource that this slot defines an interval of status information.", 0, java.lang.Integer.MAX_VALUE, availability)); + childrenList.add(new Property("freeBusyType", "code", "BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE.", 0, java.lang.Integer.MAX_VALUE, freeBusyType)); + childrenList.add(new Property("start", "instant", "Date/Time that the slot is to begin.", 0, java.lang.Integer.MAX_VALUE, start)); + childrenList.add(new Property("end", "instant", "Date/Time that the slot is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("overbooked", "boolean", "This slot has already been overbooked, appointments are unlikely to be accepted for this time.", 0, java.lang.Integer.MAX_VALUE, overbooked)); + childrenList.add(new Property("comment", "string", "Comments on the slot to describe any extended information. Such as custom constraints on the slot.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("lastModified", "dateTime", "When this slot was created, or last revised.", 0, java.lang.Integer.MAX_VALUE, lastModified)); + } + + public Slot copy() { + Slot dst = new Slot(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + dst.availability = availability == null ? null : availability.copy(); + dst.freeBusyType = freeBusyType == null ? null : freeBusyType.copy(); + dst.start = start == null ? null : start.copy(); + dst.end = end == null ? null : end.copy(); + dst.overbooked = overbooked == null ? null : overbooked.copy(); + dst.comment = comment == null ? null : comment.copy(); + dst.lastModified = lastModified == null ? null : lastModified.copy(); + return dst; + } + + protected Slot typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (availability == null || availability.isEmpty()) && (freeBusyType == null || freeBusyType.isEmpty()) + && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (overbooked == null || overbooked.isEmpty()) + && (comment == null || comment.isEmpty()) && (lastModified == null || lastModified.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Slot; + } + + @SearchParamDefinition(name="start", path="Slot.start", description="Appointment date/time.", type="date" ) + public static final String SP_START = "start"; + @SearchParamDefinition(name="slottype", path="Slot.type", description="The type of appointments that can be booked into the slot", type="token" ) + public static final String SP_SLOTTYPE = "slottype"; + @SearchParamDefinition(name="fbtype", path="Slot.freeBusyType", description="The free/busy status of the appointment", type="token" ) + public static final String SP_FBTYPE = "fbtype"; + @SearchParamDefinition(name="availability", path="Slot.availability", description="The Availability Resource that we are seeking a slot within", type="reference" ) + public static final String SP_AVAILABILITY = "availability"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java index bf7ace243ca..453ab648e80 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java @@ -20,1458 +20,1458 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Sample for analysis. - */ -@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") -public class Specimen extends DomainResource { - - public enum HierarchicalRelationshipType implements FhirEnum { - /** - * The target resource is the parent of the focal specimen resource. - */ - PARENT, - /** - * The target resource is the child of the focal specimen resource. - */ - CHILD, - /** - * added to help the parsers - */ - NULL; - - public static final HierarchicalRelationshipTypeEnumFactory ENUM_FACTORY = new HierarchicalRelationshipTypeEnumFactory(); - - public static HierarchicalRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("parent".equals(codeString)) - return PARENT; - if ("child".equals(codeString)) - return CHILD; - throw new IllegalArgumentException("Unknown HierarchicalRelationshipType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case PARENT: return "parent"; - case CHILD: return "child"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PARENT: return ""; - case CHILD: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PARENT: return "The target resource is the parent of the focal specimen resource."; - case CHILD: return "The target resource is the child of the focal specimen resource."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PARENT: return "Parent"; - case CHILD: return "Child"; - default: return "?"; - } - } - } - - public static class HierarchicalRelationshipTypeEnumFactory implements EnumFactory { - public HierarchicalRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("parent".equals(codeString)) - return HierarchicalRelationshipType.PARENT; - if ("child".equals(codeString)) - return HierarchicalRelationshipType.CHILD; - throw new IllegalArgumentException("Unknown HierarchicalRelationshipType code '"+codeString+"'"); - } - public String toCode(HierarchicalRelationshipType code) throws IllegalArgumentException { - if (code == HierarchicalRelationshipType.PARENT) - return "parent"; - if (code == HierarchicalRelationshipType.CHILD) - return "child"; - return "?"; - } - } - - @Block() - public static class SpecimenSourceComponent extends BackboneElement { - /** - * Whether this relationship is to a parent or to a child. - */ - @Child(name="relationship", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="parent | child", formalDefinition="Whether this relationship is to a parent or to a child." ) - protected Enumeration relationship; - - /** - * The specimen resource that is the target of this relationship. - */ - @Child(name="target", type={Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="The subject of the relationship", formalDefinition="The specimen resource that is the target of this relationship." ) - protected List target; - /** - * The actual objects that are the target of the reference (The specimen resource that is the target of this relationship.) - */ - protected List targetTarget; - - - private static final long serialVersionUID = 1653620362L; - - public SpecimenSourceComponent() { - super(); - } - - public SpecimenSourceComponent(Enumeration relationship) { - super(); - this.relationship = relationship; - } - - /** - * @return {@link #relationship} (Whether this relationship is to a parent or to a child.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value - */ - public Enumeration getRelationshipElement() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenSourceComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Enumeration(); - return this.relationship; - } - - public boolean hasRelationshipElement() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (Whether this relationship is to a parent or to a child.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value - */ - public SpecimenSourceComponent setRelationshipElement(Enumeration value) { - this.relationship = value; - return this; - } - - /** - * @return Whether this relationship is to a parent or to a child. - */ - public HierarchicalRelationshipType getRelationship() { - return this.relationship == null ? null : this.relationship.getValue(); - } - - /** - * @param value Whether this relationship is to a parent or to a child. - */ - public SpecimenSourceComponent setRelationship(HierarchicalRelationshipType value) { - if (this.relationship == null) - this.relationship = new Enumeration(HierarchicalRelationshipType.ENUM_FACTORY); - this.relationship.setValue(value); - return this; - } - - /** - * @return {@link #target} (The specimen resource that is the target of this relationship.) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (Reference item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (The specimen resource that is the target of this relationship.) - */ - // syntactic sugar - public Reference addTarget() { //3 - Reference t = new Reference(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @return {@link #target} (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 specimen resource that is the target of this relationship.) - */ - public List getTargetTarget() { - if (this.targetTarget == null) - this.targetTarget = new ArrayList(); - return this.targetTarget; - } - - // syntactic sugar - /** - * @return {@link #target} (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 specimen resource that is the target of this relationship.) - */ - public Specimen addTargetTarget() { - Specimen r = new Specimen(); - if (this.targetTarget == null) - this.targetTarget = new ArrayList(); - this.targetTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relationship", "code", "Whether this relationship is to a parent or to a child.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("target", "Reference(Specimen)", "The specimen resource that is the target of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - public SpecimenSourceComponent copy() { - SpecimenSourceComponent dst = new SpecimenSourceComponent(); - copyValues(dst); - dst.relationship = relationship == null ? null : relationship.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (Reference i : target) - dst.target.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - } - - @Block() - public static class SpecimenCollectionComponent extends BackboneElement { - /** - * Person who collected the specimen. - */ - @Child(name="collector", type={Practitioner.class}, order=1, min=0, max=1) - @Description(shortDefinition="Who collected the specimen", formalDefinition="Person who collected the specimen." ) - protected Reference collector; - - /** - * The actual object that is the target of the reference (Person who collected the specimen.) - */ - protected Practitioner collectorTarget; - - /** - * To communicate any details or issues encountered during the specimen collection procedure. - */ - @Child(name="comment", type={StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Collector comments", formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." ) - protected List comment; - - /** - * Time when specimen was collected from subject - the physiologically relevant time. - */ - @Child(name="collected", type={DateTimeType.class, Period.class}, order=3, min=0, max=1) - @Description(shortDefinition="Collection time", formalDefinition="Time when specimen was collected from subject - the physiologically relevant time." ) - protected Type collected; - - /** - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="The quantity of specimen collected", formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample." ) - protected Quantity quantity; - - /** - * A coded value specifying the technique that is used to perform the procedure. - */ - @Child(name="method", type={CodeableConcept.class}, order=5, min=0, max=1) - @Description(shortDefinition="Technique used to perform collection", formalDefinition="A coded value specifying the technique that is used to perform the procedure." ) - protected CodeableConcept method; - - /** - * Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens. - */ - @Child(name="sourceSite", type={CodeableConcept.class}, order=6, min=0, max=1) - @Description(shortDefinition="Anatomical collection site", formalDefinition="Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens." ) - protected CodeableConcept sourceSite; - - private static final long serialVersionUID = 498103158L; - - public SpecimenCollectionComponent() { - super(); - } - - /** - * @return {@link #collector} (Person who collected the specimen.) - */ - public Reference getCollector() { - if (this.collector == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); - else if (Configuration.doAutoCreate()) - this.collector = new Reference(); - return this.collector; - } - - public boolean hasCollector() { - return this.collector != null && !this.collector.isEmpty(); - } - - /** - * @param value {@link #collector} (Person who collected the specimen.) - */ - public SpecimenCollectionComponent setCollector(Reference value) { - this.collector = value; - return this; - } - - /** - * @return {@link #collector} 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. (Person who collected the specimen.) - */ - public Practitioner getCollectorTarget() { - if (this.collectorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); - else if (Configuration.doAutoCreate()) - this.collectorTarget = new Practitioner(); - return this.collectorTarget; - } - - /** - * @param value {@link #collector} 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. (Person who collected the specimen.) - */ - public SpecimenCollectionComponent setCollectorTarget(Practitioner value) { - this.collectorTarget = value; - return this; - } - - /** - * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - public List getComment() { - if (this.comment == null) - this.comment = new ArrayList(); - return this.comment; - } - - public boolean hasComment() { - if (this.comment == null) - return false; - for (StringType item : this.comment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - // syntactic sugar - public StringType addCommentElement() {//2 - StringType t = new StringType(); - if (this.comment == null) - this.comment = new ArrayList(); - this.comment.add(t); - return t; - } - - /** - * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - public SpecimenCollectionComponent addComment(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.comment == null) - this.comment = new ArrayList(); - this.comment.add(t); - return this; - } - - /** - * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) - */ - public boolean hasComment(String value) { - if (this.comment == null) - return false; - for (StringType v : this.comment) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public Type getCollected() { - return this.collected; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public DateTimeType getCollectedDateTimeType() throws Exception { - if (!(this.collected instanceof DateTimeType)) - throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.collected.getClass().getName()+" was encountered"); - return (DateTimeType) this.collected; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public Period getCollectedPeriod() throws Exception { - if (!(this.collected instanceof Period)) - throw new Exception("Type mismatch: the type Period was expected, but "+this.collected.getClass().getName()+" was encountered"); - return (Period) this.collected; - } - - public boolean hasCollected() { - return this.collected != null && !this.collected.isEmpty(); - } - - /** - * @param value {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public SpecimenCollectionComponent setCollected(Type value) { - this.collected = value; - return this; - } - - /** - * @return {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) - */ - public SpecimenCollectionComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #method} (A coded value specifying the technique that is used to perform the procedure.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value specifying the technique that is used to perform the procedure.) - */ - public SpecimenCollectionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #sourceSite} (Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens.) - */ - public CodeableConcept getSourceSite() { - if (this.sourceSite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.sourceSite"); - else if (Configuration.doAutoCreate()) - this.sourceSite = new CodeableConcept(); - return this.sourceSite; - } - - public boolean hasSourceSite() { - return this.sourceSite != null && !this.sourceSite.isEmpty(); - } - - /** - * @param value {@link #sourceSite} (Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens.) - */ - public SpecimenCollectionComponent setSourceSite(CodeableConcept value) { - this.sourceSite = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("collector", "Reference(Practitioner)", "Person who collected the specimen.", 0, java.lang.Integer.MAX_VALUE, collector)); - childrenList.add(new Property("comment", "string", "To communicate any details or issues encountered during the specimen collection procedure.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("collected[x]", "dateTime|Period", "Time when specimen was collected from subject - the physiologically relevant time.", 0, java.lang.Integer.MAX_VALUE, collected)); - childrenList.add(new Property("quantity", "Quantity", "The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value specifying the technique that is used to perform the procedure.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("sourceSite", "CodeableConcept", "Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens.", 0, java.lang.Integer.MAX_VALUE, sourceSite)); - } - - public SpecimenCollectionComponent copy() { - SpecimenCollectionComponent dst = new SpecimenCollectionComponent(); - copyValues(dst); - dst.collector = collector == null ? null : collector.copy(); - if (comment != null) { - dst.comment = new ArrayList(); - for (StringType i : comment) - dst.comment.add(i.copy()); - }; - dst.collected = collected == null ? null : collected.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.method = method == null ? null : method.copy(); - dst.sourceSite = sourceSite == null ? null : sourceSite.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (collector == null || collector.isEmpty()) && (comment == null || comment.isEmpty()) - && (collected == null || collected.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (method == null || method.isEmpty()) && (sourceSite == null || sourceSite.isEmpty()); - } - - } - - @Block() - public static class SpecimenTreatmentComponent extends BackboneElement { - /** - * Textual description of procedure. - */ - @Child(name="description", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Textual description of procedure", formalDefinition="Textual description of procedure." ) - protected StringType description; - - /** - * A coded value specifying the procedure used to process the specimen. - */ - @Child(name="procedure", type={CodeableConcept.class}, order=2, min=0, max=1) - @Description(shortDefinition="Indicates the treatment or processing step applied to the specimen", formalDefinition="A coded value specifying the procedure used to process the specimen." ) - protected CodeableConcept procedure; - - /** - * Material used in the processing step. - */ - @Child(name="additive", type={Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Material used in the processing step", formalDefinition="Material used in the processing step." ) - protected List additive; - /** - * The actual objects that are the target of the reference (Material used in the processing step.) - */ - protected List additiveTarget; - - - private static final long serialVersionUID = -373251521L; - - public SpecimenTreatmentComponent() { - super(); - } - - /** - * @return {@link #description} (Textual description of procedure.). 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 SpecimenTreatmentComponent.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} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SpecimenTreatmentComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Textual description of procedure. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Textual description of procedure. - */ - public SpecimenTreatmentComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (A coded value specifying the procedure used to process the specimen.) - */ - public CodeableConcept getProcedure() { - if (this.procedure == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenTreatmentComponent.procedure"); - else if (Configuration.doAutoCreate()) - this.procedure = new CodeableConcept(); - return this.procedure; - } - - public boolean hasProcedure() { - return this.procedure != null && !this.procedure.isEmpty(); - } - - /** - * @param value {@link #procedure} (A coded value specifying the procedure used to process the specimen.) - */ - public SpecimenTreatmentComponent setProcedure(CodeableConcept value) { - this.procedure = value; - return this; - } - - /** - * @return {@link #additive} (Material used in the processing step.) - */ - public List getAdditive() { - if (this.additive == null) - this.additive = new ArrayList(); - return this.additive; - } - - public boolean hasAdditive() { - if (this.additive == null) - return false; - for (Reference item : this.additive) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additive} (Material used in the processing step.) - */ - // syntactic sugar - public Reference addAdditive() { //3 - Reference t = new Reference(); - if (this.additive == null) - this.additive = new ArrayList(); - this.additive.add(t); - return t; - } - - /** - * @return {@link #additive} (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. Material used in the processing step.) - */ - public List getAdditiveTarget() { - if (this.additiveTarget == null) - this.additiveTarget = new ArrayList(); - return this.additiveTarget; - } - - // syntactic sugar - /** - * @return {@link #additive} (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. Material used in the processing step.) - */ - public Substance addAdditiveTarget() { - Substance r = new Substance(); - if (this.additiveTarget == null) - this.additiveTarget = new ArrayList(); - this.additiveTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Textual description of procedure.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("procedure", "CodeableConcept", "A coded value specifying the procedure used to process the specimen.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("additive", "Reference(Substance)", "Material used in the processing step.", 0, java.lang.Integer.MAX_VALUE, additive)); - } - - public SpecimenTreatmentComponent copy() { - SpecimenTreatmentComponent dst = new SpecimenTreatmentComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.procedure = procedure == null ? null : procedure.copy(); - if (additive != null) { - dst.additive = new ArrayList(); - for (Reference i : additive) - dst.additive.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (procedure == null || procedure.isEmpty()) - && (additive == null || additive.isEmpty()); - } - - } - - @Block() - public static class SpecimenContainerComponent extends BackboneElement { - /** - * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Id for the container", formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances." ) - protected List identifier; - - /** - * Textual description of the container. - */ - @Child(name="description", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Textual description of the container", formalDefinition="Textual description of the container." ) - protected StringType description; - - /** - * The type of container associated with the specimen (e.g. slide, aliquot, etc). - */ - @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Kind of container directly associated with specimen", formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc)." ) - protected CodeableConcept type; - - /** - * The capacity (volume or other measure) the container may contain. - */ - @Child(name="capacity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Container volume or size", formalDefinition="The capacity (volume or other measure) the container may contain." ) - protected Quantity capacity; - - /** - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. - */ - @Child(name="specimenQuantity", type={Quantity.class}, order=5, min=0, max=1) - @Description(shortDefinition="Quantity of specimen within container", formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type." ) - protected Quantity specimenQuantity; - - /** - * Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA. - */ - @Child(name="additive", type={CodeableConcept.class, Substance.class}, order=6, min=0, max=1) - @Description(shortDefinition="Additive associated with container", formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA." ) - protected Type additive; - - private static final long serialVersionUID = -1608132325L; - - public SpecimenContainerComponent() { - super(); - } - - /** - * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #description} (Textual description of the container.). 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 SpecimenContainerComponent.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} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SpecimenContainerComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Textual description of the container. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Textual description of the container. - */ - public SpecimenContainerComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) - */ - public SpecimenContainerComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #capacity} (The capacity (volume or other measure) the container may contain.) - */ - public Quantity getCapacity() { - if (this.capacity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.capacity"); - else if (Configuration.doAutoCreate()) - this.capacity = new Quantity(); - return this.capacity; - } - - public boolean hasCapacity() { - return this.capacity != null && !this.capacity.isEmpty(); - } - - /** - * @param value {@link #capacity} (The capacity (volume or other measure) the container may contain.) - */ - public SpecimenContainerComponent setCapacity(Quantity value) { - this.capacity = value; - return this; - } - - /** - * @return {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) - */ - public Quantity getSpecimenQuantity() { - if (this.specimenQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.specimenQuantity"); - else if (Configuration.doAutoCreate()) - this.specimenQuantity = new Quantity(); - return this.specimenQuantity; - } - - public boolean hasSpecimenQuantity() { - return this.specimenQuantity != null && !this.specimenQuantity.isEmpty(); - } - - /** - * @param value {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) - */ - public SpecimenContainerComponent setSpecimenQuantity(Quantity value) { - this.specimenQuantity = value; - return this; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public Type getAdditive() { - return this.additive; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public CodeableConcept getAdditiveCodeableConcept() throws Exception { - if (!(this.additive instanceof CodeableConcept)) - throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.additive.getClass().getName()+" was encountered"); - return (CodeableConcept) this.additive; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public Reference getAdditiveReference() throws Exception { - if (!(this.additive instanceof Reference)) - throw new Exception("Type mismatch: the type Reference was expected, but "+this.additive.getClass().getName()+" was encountered"); - return (Reference) this.additive; - } - - public boolean hasAdditive() { - return this.additive != null && !this.additive.isEmpty(); - } - - /** - * @param value {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) - */ - public SpecimenContainerComponent setAdditive(Type value) { - this.additive = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("description", "string", "Textual description of the container.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("type", "CodeableConcept", "The type of container associated with the specimen (e.g. slide, aliquot, etc).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("capacity", "Quantity", "The capacity (volume or other measure) the container may contain.", 0, java.lang.Integer.MAX_VALUE, capacity)); - childrenList.add(new Property("specimenQuantity", "Quantity", "The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.", 0, java.lang.Integer.MAX_VALUE, specimenQuantity)); - childrenList.add(new Property("additive[x]", "CodeableConcept|Reference(Substance)", "Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.", 0, java.lang.Integer.MAX_VALUE, additive)); - } - - public SpecimenContainerComponent copy() { - SpecimenContainerComponent dst = new SpecimenContainerComponent(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.type = type == null ? null : type.copy(); - dst.capacity = capacity == null ? null : capacity.copy(); - dst.specimenQuantity = specimenQuantity == null ? null : specimenQuantity.copy(); - dst.additive = additive == null ? null : additive.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (description == null || description.isEmpty()) - && (type == null || type.isEmpty()) && (capacity == null || capacity.isEmpty()) && (specimenQuantity == null || specimenQuantity.isEmpty()) - && (additive == null || additive.isEmpty()); - } - - } - - /** - * Id for specimen. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="External Identifier", formalDefinition="Id for specimen." ) - protected List identifier; - - /** - * Kind of material that forms the specimen. - */ - @Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=1) - @Description(shortDefinition="Kind of material that forms the specimen", formalDefinition="Kind of material that forms the specimen." ) - protected CodeableConcept type; - - /** - * Parent specimen from which the focal specimen was a component. - */ - @Child(name="source", type={}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parent of specimen", formalDefinition="Parent specimen from which the focal specimen was a component." ) - protected List source; - - /** - * Where the specimen came from. This may be the patient(s) or from the environment or a device. - */ - @Child(name="subject", type={Patient.class, Group.class, Device.class, Substance.class}, order=2, min=1, max=1) - @Description(shortDefinition="Where the specimen came from. This may be the patient(s) or from the environment or a device", formalDefinition="Where the specimen came from. This may be the patient(s) or from the environment or a device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Where the specimen came from. This may be the patient(s) or from the environment or a device.) - */ - protected Resource subjectTarget; - - /** - * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. - */ - @Child(name="accessionIdentifier", type={Identifier.class}, order=3, min=0, max=1) - @Description(shortDefinition="Identifier assigned by the lab", formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures." ) - protected Identifier accessionIdentifier; - - /** - * Time when specimen was received for processing or testing. - */ - @Child(name="receivedTime", type={DateTimeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="The time when specimen was received for processing", formalDefinition="Time when specimen was received for processing or testing." ) - protected DateTimeType receivedTime; - - /** - * Details concerning the specimen collection. - */ - @Child(name="collection", type={}, order=5, min=0, max=1) - @Description(shortDefinition="Collection details", formalDefinition="Details concerning the specimen collection." ) - protected SpecimenCollectionComponent collection; - - /** - * Details concerning treatment and processing steps for the specimen. - */ - @Child(name="treatment", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Treatment and processing step details", formalDefinition="Details concerning treatment and processing steps for the specimen." ) - protected List treatment; - - /** - * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. - */ - @Child(name="container", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Direct container of specimen (tube/slide, etc)", formalDefinition="The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here." ) - protected List container; - - private static final long serialVersionUID = 862754396L; - - public Specimen() { - super(); - } - - public Specimen(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #identifier} (Id for specimen.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (Id for specimen.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #type} (Kind of material that forms the specimen.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Kind of material that forms the specimen.) - */ - public Specimen setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #source} (Parent specimen from which the focal specimen was a component.) - */ - public List getSource() { - if (this.source == null) - this.source = new ArrayList(); - return this.source; - } - - public boolean hasSource() { - if (this.source == null) - return false; - for (SpecimenSourceComponent item : this.source) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #source} (Parent specimen from which the focal specimen was a component.) - */ - // syntactic sugar - public SpecimenSourceComponent addSource() { //3 - SpecimenSourceComponent t = new SpecimenSourceComponent(); - if (this.source == null) - this.source = new ArrayList(); - this.source.add(t); - return t; - } - - /** - * @return {@link #subject} (Where the specimen came from. This may be the patient(s) or from the environment or a device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.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} (Where the specimen came from. This may be the patient(s) or from the environment or a device.) - */ - public Specimen 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. (Where the specimen came from. This may be the patient(s) or from the environment or a device.) - */ - public Resource getSubjectTarget() { - 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. (Where the specimen came from. This may be the patient(s) or from the environment or a device.) - */ - public Specimen setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) - */ - public Identifier getAccessionIdentifier() { - if (this.accessionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.accessionIdentifier"); - else if (Configuration.doAutoCreate()) - this.accessionIdentifier = new Identifier(); - return this.accessionIdentifier; - } - - public boolean hasAccessionIdentifier() { - return this.accessionIdentifier != null && !this.accessionIdentifier.isEmpty(); - } - - /** - * @param value {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) - */ - public Specimen setAccessionIdentifier(Identifier value) { - this.accessionIdentifier = value; - return this; - } - - /** - * @return {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value - */ - public DateTimeType getReceivedTimeElement() { - if (this.receivedTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.receivedTime"); - else if (Configuration.doAutoCreate()) - this.receivedTime = new DateTimeType(); - return this.receivedTime; - } - - public boolean hasReceivedTimeElement() { - return this.receivedTime != null && !this.receivedTime.isEmpty(); - } - - public boolean hasReceivedTime() { - return this.receivedTime != null && !this.receivedTime.isEmpty(); - } - - /** - * @param value {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value - */ - public Specimen setReceivedTimeElement(DateTimeType value) { - this.receivedTime = value; - return this; - } - - /** - * @return Time when specimen was received for processing or testing. - */ - public Date getReceivedTime() { - return this.receivedTime == null ? null : this.receivedTime.getValue(); - } - - /** - * @param value Time when specimen was received for processing or testing. - */ - public Specimen setReceivedTime(Date value) { - if (value == null) - this.receivedTime = null; - else { - if (this.receivedTime == null) - this.receivedTime = new DateTimeType(); - this.receivedTime.setValue(value); - } - return this; - } - - /** - * @return {@link #collection} (Details concerning the specimen collection.) - */ - public SpecimenCollectionComponent getCollection() { - if (this.collection == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.collection"); - else if (Configuration.doAutoCreate()) - this.collection = new SpecimenCollectionComponent(); - return this.collection; - } - - public boolean hasCollection() { - return this.collection != null && !this.collection.isEmpty(); - } - - /** - * @param value {@link #collection} (Details concerning the specimen collection.) - */ - public Specimen setCollection(SpecimenCollectionComponent value) { - this.collection = value; - return this; - } - - /** - * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) - */ - public List getTreatment() { - if (this.treatment == null) - this.treatment = new ArrayList(); - return this.treatment; - } - - public boolean hasTreatment() { - if (this.treatment == null) - return false; - for (SpecimenTreatmentComponent item : this.treatment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) - */ - // syntactic sugar - public SpecimenTreatmentComponent addTreatment() { //3 - SpecimenTreatmentComponent t = new SpecimenTreatmentComponent(); - if (this.treatment == null) - this.treatment = new ArrayList(); - this.treatment.add(t); - return t; - } - - /** - * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) - */ - public List getContainer() { - if (this.container == null) - this.container = new ArrayList(); - return this.container; - } - - public boolean hasContainer() { - if (this.container == null) - return false; - for (SpecimenContainerComponent item : this.container) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) - */ - // syntactic sugar - public SpecimenContainerComponent addContainer() { //3 - SpecimenContainerComponent t = new SpecimenContainerComponent(); - if (this.container == null) - this.container = new ArrayList(); - this.container.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Id for specimen.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "Kind of material that forms the specimen.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("source", "", "Parent specimen from which the focal specimen was a component.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Where the specimen came from. This may be the patient(s) or from the environment or a device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("accessionIdentifier", "Identifier", "The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.", 0, java.lang.Integer.MAX_VALUE, accessionIdentifier)); - childrenList.add(new Property("receivedTime", "dateTime", "Time when specimen was received for processing or testing.", 0, java.lang.Integer.MAX_VALUE, receivedTime)); - childrenList.add(new Property("collection", "", "Details concerning the specimen collection.", 0, java.lang.Integer.MAX_VALUE, collection)); - childrenList.add(new Property("treatment", "", "Details concerning treatment and processing steps for the specimen.", 0, java.lang.Integer.MAX_VALUE, treatment)); - childrenList.add(new Property("container", "", "The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.", 0, java.lang.Integer.MAX_VALUE, container)); - } - - public Specimen copy() { - Specimen dst = new Specimen(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (source != null) { - dst.source = new ArrayList(); - for (SpecimenSourceComponent i : source) - dst.source.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.accessionIdentifier = accessionIdentifier == null ? null : accessionIdentifier.copy(); - dst.receivedTime = receivedTime == null ? null : receivedTime.copy(); - dst.collection = collection == null ? null : collection.copy(); - if (treatment != null) { - dst.treatment = new ArrayList(); - for (SpecimenTreatmentComponent i : treatment) - dst.treatment.add(i.copy()); - }; - if (container != null) { - dst.container = new ArrayList(); - for (SpecimenContainerComponent i : container) - dst.container.add(i.copy()); - }; - return dst; - } - - protected Specimen typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (source == null || source.isEmpty()) && (subject == null || subject.isEmpty()) && (accessionIdentifier == null || accessionIdentifier.isEmpty()) - && (receivedTime == null || receivedTime.isEmpty()) && (collection == null || collection.isEmpty()) - && (treatment == null || treatment.isEmpty()) && (container == null || container.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Specimen; - } - - @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference" ) - public static final String SP_SUBJECT = "subject"; - -} - + +/* + 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; +/** + * Sample for analysis. + */ +@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") +public class Specimen extends DomainResource { + + public enum HierarchicalRelationshipType implements FhirEnum { + /** + * The target resource is the parent of the focal specimen resource. + */ + PARENT, + /** + * The target resource is the child of the focal specimen resource. + */ + CHILD, + /** + * added to help the parsers + */ + NULL; + + public static final HierarchicalRelationshipTypeEnumFactory ENUM_FACTORY = new HierarchicalRelationshipTypeEnumFactory(); + + public static HierarchicalRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("parent".equals(codeString)) + return PARENT; + if ("child".equals(codeString)) + return CHILD; + throw new IllegalArgumentException("Unknown HierarchicalRelationshipType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PARENT: return "parent"; + case CHILD: return "child"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PARENT: return ""; + case CHILD: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PARENT: return "The target resource is the parent of the focal specimen resource."; + case CHILD: return "The target resource is the child of the focal specimen resource."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PARENT: return "Parent"; + case CHILD: return "Child"; + default: return "?"; + } + } + } + + public static class HierarchicalRelationshipTypeEnumFactory implements EnumFactory { + public HierarchicalRelationshipType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("parent".equals(codeString)) + return HierarchicalRelationshipType.PARENT; + if ("child".equals(codeString)) + return HierarchicalRelationshipType.CHILD; + throw new IllegalArgumentException("Unknown HierarchicalRelationshipType code '"+codeString+"'"); + } + public String toCode(HierarchicalRelationshipType code) throws IllegalArgumentException { + if (code == HierarchicalRelationshipType.PARENT) + return "parent"; + if (code == HierarchicalRelationshipType.CHILD) + return "child"; + return "?"; + } + } + + @Block() + public static class SpecimenSourceComponent extends BackboneElement { + /** + * Whether this relationship is to a parent or to a child. + */ + @Child(name="relationship", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="parent | child", formalDefinition="Whether this relationship is to a parent or to a child." ) + protected Enumeration relationship; + + /** + * The specimen resource that is the target of this relationship. + */ + @Child(name="target", type={Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The subject of the relationship", formalDefinition="The specimen resource that is the target of this relationship." ) + protected List target; + /** + * The actual objects that are the target of the reference (The specimen resource that is the target of this relationship.) + */ + protected List targetTarget; + + + private static final long serialVersionUID = 1653620362L; + + public SpecimenSourceComponent() { + super(); + } + + public SpecimenSourceComponent(Enumeration relationship) { + super(); + this.relationship = relationship; + } + + /** + * @return {@link #relationship} (Whether this relationship is to a parent or to a child.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value + */ + public Enumeration getRelationshipElement() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenSourceComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Enumeration(); + return this.relationship; + } + + public boolean hasRelationshipElement() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (Whether this relationship is to a parent or to a child.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value + */ + public SpecimenSourceComponent setRelationshipElement(Enumeration value) { + this.relationship = value; + return this; + } + + /** + * @return Whether this relationship is to a parent or to a child. + */ + public HierarchicalRelationshipType getRelationship() { + return this.relationship == null ? null : this.relationship.getValue(); + } + + /** + * @param value Whether this relationship is to a parent or to a child. + */ + public SpecimenSourceComponent setRelationship(HierarchicalRelationshipType value) { + if (this.relationship == null) + this.relationship = new Enumeration(HierarchicalRelationshipType.ENUM_FACTORY); + this.relationship.setValue(value); + return this; + } + + /** + * @return {@link #target} (The specimen resource that is the target of this relationship.) + */ + public List getTarget() { + if (this.target == null) + this.target = new ArrayList(); + return this.target; + } + + public boolean hasTarget() { + if (this.target == null) + return false; + for (Reference item : this.target) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #target} (The specimen resource that is the target of this relationship.) + */ + // syntactic sugar + public Reference addTarget() { //3 + Reference t = new Reference(); + if (this.target == null) + this.target = new ArrayList(); + this.target.add(t); + return t; + } + + /** + * @return {@link #target} (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 specimen resource that is the target of this relationship.) + */ + public List getTargetTarget() { + if (this.targetTarget == null) + this.targetTarget = new ArrayList(); + return this.targetTarget; + } + + // syntactic sugar + /** + * @return {@link #target} (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 specimen resource that is the target of this relationship.) + */ + public Specimen addTargetTarget() { + Specimen r = new Specimen(); + if (this.targetTarget == null) + this.targetTarget = new ArrayList(); + this.targetTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("relationship", "code", "Whether this relationship is to a parent or to a child.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("target", "Reference(Specimen)", "The specimen resource that is the target of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); + } + + public SpecimenSourceComponent copy() { + SpecimenSourceComponent dst = new SpecimenSourceComponent(); + copyValues(dst); + dst.relationship = relationship == null ? null : relationship.copy(); + if (target != null) { + dst.target = new ArrayList(); + for (Reference i : target) + dst.target.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (target == null || target.isEmpty()) + ; + } + + } + + @Block() + public static class SpecimenCollectionComponent extends BackboneElement { + /** + * Person who collected the specimen. + */ + @Child(name="collector", type={Practitioner.class}, order=1, min=0, max=1) + @Description(shortDefinition="Who collected the specimen", formalDefinition="Person who collected the specimen." ) + protected Reference collector; + + /** + * The actual object that is the target of the reference (Person who collected the specimen.) + */ + protected Practitioner collectorTarget; + + /** + * To communicate any details or issues encountered during the specimen collection procedure. + */ + @Child(name="comment", type={StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Collector comments", formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." ) + protected List comment; + + /** + * Time when specimen was collected from subject - the physiologically relevant time. + */ + @Child(name="collected", type={DateTimeType.class, Period.class}, order=3, min=0, max=1) + @Description(shortDefinition="Collection time", formalDefinition="Time when specimen was collected from subject - the physiologically relevant time." ) + protected Type collected; + + /** + * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="The quantity of specimen collected", formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample." ) + protected Quantity quantity; + + /** + * A coded value specifying the technique that is used to perform the procedure. + */ + @Child(name="method", type={CodeableConcept.class}, order=5, min=0, max=1) + @Description(shortDefinition="Technique used to perform collection", formalDefinition="A coded value specifying the technique that is used to perform the procedure." ) + protected CodeableConcept method; + + /** + * Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens. + */ + @Child(name="sourceSite", type={CodeableConcept.class}, order=6, min=0, max=1) + @Description(shortDefinition="Anatomical collection site", formalDefinition="Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens." ) + protected CodeableConcept sourceSite; + + private static final long serialVersionUID = 498103158L; + + public SpecimenCollectionComponent() { + super(); + } + + /** + * @return {@link #collector} (Person who collected the specimen.) + */ + public Reference getCollector() { + if (this.collector == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); + else if (Configuration.doAutoCreate()) + this.collector = new Reference(); + return this.collector; + } + + public boolean hasCollector() { + return this.collector != null && !this.collector.isEmpty(); + } + + /** + * @param value {@link #collector} (Person who collected the specimen.) + */ + public SpecimenCollectionComponent setCollector(Reference value) { + this.collector = value; + return this; + } + + /** + * @return {@link #collector} 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. (Person who collected the specimen.) + */ + public Practitioner getCollectorTarget() { + if (this.collectorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); + else if (Configuration.doAutoCreate()) + this.collectorTarget = new Practitioner(); + return this.collectorTarget; + } + + /** + * @param value {@link #collector} 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. (Person who collected the specimen.) + */ + public SpecimenCollectionComponent setCollectorTarget(Practitioner value) { + this.collectorTarget = value; + return this; + } + + /** + * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + public List getComment() { + if (this.comment == null) + this.comment = new ArrayList(); + return this.comment; + } + + public boolean hasComment() { + if (this.comment == null) + return false; + for (StringType item : this.comment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + // syntactic sugar + public StringType addCommentElement() {//2 + StringType t = new StringType(); + if (this.comment == null) + this.comment = new ArrayList(); + this.comment.add(t); + return t; + } + + /** + * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + public SpecimenCollectionComponent addComment(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.comment == null) + this.comment = new ArrayList(); + this.comment.add(t); + return this; + } + + /** + * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.) + */ + public boolean hasComment(String value) { + if (this.comment == null) + return false; + for (StringType v : this.comment) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public Type getCollected() { + return this.collected; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public DateTimeType getCollectedDateTimeType() throws Exception { + if (!(this.collected instanceof DateTimeType)) + throw new Exception("Type mismatch: the type DateTimeType was expected, but "+this.collected.getClass().getName()+" was encountered"); + return (DateTimeType) this.collected; + } + + /** + * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public Period getCollectedPeriod() throws Exception { + if (!(this.collected instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.collected.getClass().getName()+" was encountered"); + return (Period) this.collected; + } + + public boolean hasCollected() { + return this.collected != null && !this.collected.isEmpty(); + } + + /** + * @param value {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) + */ + public SpecimenCollectionComponent setCollected(Type value) { + this.collected = value; + return this; + } + + /** + * @return {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) + */ + public SpecimenCollectionComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #method} (A coded value specifying the technique that is used to perform the procedure.) + */ + public CodeableConcept getMethod() { + if (this.method == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.method"); + else if (Configuration.doAutoCreate()) + this.method = new CodeableConcept(); + return this.method; + } + + public boolean hasMethod() { + return this.method != null && !this.method.isEmpty(); + } + + /** + * @param value {@link #method} (A coded value specifying the technique that is used to perform the procedure.) + */ + public SpecimenCollectionComponent setMethod(CodeableConcept value) { + this.method = value; + return this; + } + + /** + * @return {@link #sourceSite} (Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens.) + */ + public CodeableConcept getSourceSite() { + if (this.sourceSite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenCollectionComponent.sourceSite"); + else if (Configuration.doAutoCreate()) + this.sourceSite = new CodeableConcept(); + return this.sourceSite; + } + + public boolean hasSourceSite() { + return this.sourceSite != null && !this.sourceSite.isEmpty(); + } + + /** + * @param value {@link #sourceSite} (Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens.) + */ + public SpecimenCollectionComponent setSourceSite(CodeableConcept value) { + this.sourceSite = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("collector", "Reference(Practitioner)", "Person who collected the specimen.", 0, java.lang.Integer.MAX_VALUE, collector)); + childrenList.add(new Property("comment", "string", "To communicate any details or issues encountered during the specimen collection procedure.", 0, java.lang.Integer.MAX_VALUE, comment)); + childrenList.add(new Property("collected[x]", "dateTime|Period", "Time when specimen was collected from subject - the physiologically relevant time.", 0, java.lang.Integer.MAX_VALUE, collected)); + childrenList.add(new Property("quantity", "Quantity", "The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("method", "CodeableConcept", "A coded value specifying the technique that is used to perform the procedure.", 0, java.lang.Integer.MAX_VALUE, method)); + childrenList.add(new Property("sourceSite", "CodeableConcept", "Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens.", 0, java.lang.Integer.MAX_VALUE, sourceSite)); + } + + public SpecimenCollectionComponent copy() { + SpecimenCollectionComponent dst = new SpecimenCollectionComponent(); + copyValues(dst); + dst.collector = collector == null ? null : collector.copy(); + if (comment != null) { + dst.comment = new ArrayList(); + for (StringType i : comment) + dst.comment.add(i.copy()); + }; + dst.collected = collected == null ? null : collected.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.method = method == null ? null : method.copy(); + dst.sourceSite = sourceSite == null ? null : sourceSite.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (collector == null || collector.isEmpty()) && (comment == null || comment.isEmpty()) + && (collected == null || collected.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (method == null || method.isEmpty()) && (sourceSite == null || sourceSite.isEmpty()); + } + + } + + @Block() + public static class SpecimenTreatmentComponent extends BackboneElement { + /** + * Textual description of procedure. + */ + @Child(name="description", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Textual description of procedure", formalDefinition="Textual description of procedure." ) + protected StringType description; + + /** + * A coded value specifying the procedure used to process the specimen. + */ + @Child(name="procedure", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Indicates the treatment or processing step applied to the specimen", formalDefinition="A coded value specifying the procedure used to process the specimen." ) + protected CodeableConcept procedure; + + /** + * Material used in the processing step. + */ + @Child(name="additive", type={Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Material used in the processing step", formalDefinition="Material used in the processing step." ) + protected List additive; + /** + * The actual objects that are the target of the reference (Material used in the processing step.) + */ + protected List additiveTarget; + + + private static final long serialVersionUID = -373251521L; + + public SpecimenTreatmentComponent() { + super(); + } + + /** + * @return {@link #description} (Textual description of procedure.). 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 SpecimenTreatmentComponent.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} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SpecimenTreatmentComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Textual description of procedure. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Textual description of procedure. + */ + public SpecimenTreatmentComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #procedure} (A coded value specifying the procedure used to process the specimen.) + */ + public CodeableConcept getProcedure() { + if (this.procedure == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenTreatmentComponent.procedure"); + else if (Configuration.doAutoCreate()) + this.procedure = new CodeableConcept(); + return this.procedure; + } + + public boolean hasProcedure() { + return this.procedure != null && !this.procedure.isEmpty(); + } + + /** + * @param value {@link #procedure} (A coded value specifying the procedure used to process the specimen.) + */ + public SpecimenTreatmentComponent setProcedure(CodeableConcept value) { + this.procedure = value; + return this; + } + + /** + * @return {@link #additive} (Material used in the processing step.) + */ + public List getAdditive() { + if (this.additive == null) + this.additive = new ArrayList(); + return this.additive; + } + + public boolean hasAdditive() { + if (this.additive == null) + return false; + for (Reference item : this.additive) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additive} (Material used in the processing step.) + */ + // syntactic sugar + public Reference addAdditive() { //3 + Reference t = new Reference(); + if (this.additive == null) + this.additive = new ArrayList(); + this.additive.add(t); + return t; + } + + /** + * @return {@link #additive} (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. Material used in the processing step.) + */ + public List getAdditiveTarget() { + if (this.additiveTarget == null) + this.additiveTarget = new ArrayList(); + return this.additiveTarget; + } + + // syntactic sugar + /** + * @return {@link #additive} (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. Material used in the processing step.) + */ + public Substance addAdditiveTarget() { + Substance r = new Substance(); + if (this.additiveTarget == null) + this.additiveTarget = new ArrayList(); + this.additiveTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("description", "string", "Textual description of procedure.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("procedure", "CodeableConcept", "A coded value specifying the procedure used to process the specimen.", 0, java.lang.Integer.MAX_VALUE, procedure)); + childrenList.add(new Property("additive", "Reference(Substance)", "Material used in the processing step.", 0, java.lang.Integer.MAX_VALUE, additive)); + } + + public SpecimenTreatmentComponent copy() { + SpecimenTreatmentComponent dst = new SpecimenTreatmentComponent(); + copyValues(dst); + dst.description = description == null ? null : description.copy(); + dst.procedure = procedure == null ? null : procedure.copy(); + if (additive != null) { + dst.additive = new ArrayList(); + for (Reference i : additive) + dst.additive.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (description == null || description.isEmpty()) && (procedure == null || procedure.isEmpty()) + && (additive == null || additive.isEmpty()); + } + + } + + @Block() + public static class SpecimenContainerComponent extends BackboneElement { + /** + * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Id for the container", formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances." ) + protected List identifier; + + /** + * Textual description of the container. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Textual description of the container", formalDefinition="Textual description of the container." ) + protected StringType description; + + /** + * The type of container associated with the specimen (e.g. slide, aliquot, etc). + */ + @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Kind of container directly associated with specimen", formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc)." ) + protected CodeableConcept type; + + /** + * The capacity (volume or other measure) the container may contain. + */ + @Child(name="capacity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Container volume or size", formalDefinition="The capacity (volume or other measure) the container may contain." ) + protected Quantity capacity; + + /** + * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. + */ + @Child(name="specimenQuantity", type={Quantity.class}, order=5, min=0, max=1) + @Description(shortDefinition="Quantity of specimen within container", formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type." ) + protected Quantity specimenQuantity; + + /** + * Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA. + */ + @Child(name="additive", type={CodeableConcept.class, Substance.class}, order=6, min=0, max=1) + @Description(shortDefinition="Additive associated with container", formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA." ) + protected Type additive; + + private static final long serialVersionUID = -1608132325L; + + public SpecimenContainerComponent() { + super(); + } + + /** + * @return {@link #identifier} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #description} (Textual description of the container.). 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 SpecimenContainerComponent.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} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SpecimenContainerComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Textual description of the container. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Textual description of the container. + */ + public SpecimenContainerComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc).) + */ + public SpecimenContainerComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #capacity} (The capacity (volume or other measure) the container may contain.) + */ + public Quantity getCapacity() { + if (this.capacity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.capacity"); + else if (Configuration.doAutoCreate()) + this.capacity = new Quantity(); + return this.capacity; + } + + public boolean hasCapacity() { + return this.capacity != null && !this.capacity.isEmpty(); + } + + /** + * @param value {@link #capacity} (The capacity (volume or other measure) the container may contain.) + */ + public SpecimenContainerComponent setCapacity(Quantity value) { + this.capacity = value; + return this; + } + + /** + * @return {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) + */ + public Quantity getSpecimenQuantity() { + if (this.specimenQuantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SpecimenContainerComponent.specimenQuantity"); + else if (Configuration.doAutoCreate()) + this.specimenQuantity = new Quantity(); + return this.specimenQuantity; + } + + public boolean hasSpecimenQuantity() { + return this.specimenQuantity != null && !this.specimenQuantity.isEmpty(); + } + + /** + * @param value {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) + */ + public SpecimenContainerComponent setSpecimenQuantity(Quantity value) { + this.specimenQuantity = value; + return this; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public Type getAdditive() { + return this.additive; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public CodeableConcept getAdditiveCodeableConcept() throws Exception { + if (!(this.additive instanceof CodeableConcept)) + throw new Exception("Type mismatch: the type CodeableConcept was expected, but "+this.additive.getClass().getName()+" was encountered"); + return (CodeableConcept) this.additive; + } + + /** + * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public Reference getAdditiveReference() throws Exception { + if (!(this.additive instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.additive.getClass().getName()+" was encountered"); + return (Reference) this.additive; + } + + public boolean hasAdditive() { + return this.additive != null && !this.additive.isEmpty(); + } + + /** + * @param value {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.) + */ + public SpecimenContainerComponent setAdditive(Type value) { + this.additive = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("description", "string", "Textual description of the container.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("type", "CodeableConcept", "The type of container associated with the specimen (e.g. slide, aliquot, etc).", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("capacity", "Quantity", "The capacity (volume or other measure) the container may contain.", 0, java.lang.Integer.MAX_VALUE, capacity)); + childrenList.add(new Property("specimenQuantity", "Quantity", "The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.", 0, java.lang.Integer.MAX_VALUE, specimenQuantity)); + childrenList.add(new Property("additive[x]", "CodeableConcept|Reference(Substance)", "Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA.", 0, java.lang.Integer.MAX_VALUE, additive)); + } + + public SpecimenContainerComponent copy() { + SpecimenContainerComponent dst = new SpecimenContainerComponent(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.type = type == null ? null : type.copy(); + dst.capacity = capacity == null ? null : capacity.copy(); + dst.specimenQuantity = specimenQuantity == null ? null : specimenQuantity.copy(); + dst.additive = additive == null ? null : additive.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (description == null || description.isEmpty()) + && (type == null || type.isEmpty()) && (capacity == null || capacity.isEmpty()) && (specimenQuantity == null || specimenQuantity.isEmpty()) + && (additive == null || additive.isEmpty()); + } + + } + + /** + * Id for specimen. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Identifier", formalDefinition="Id for specimen." ) + protected List identifier; + + /** + * Kind of material that forms the specimen. + */ + @Child(name="type", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="Kind of material that forms the specimen", formalDefinition="Kind of material that forms the specimen." ) + protected CodeableConcept type; + + /** + * Parent specimen from which the focal specimen was a component. + */ + @Child(name="source", type={}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parent of specimen", formalDefinition="Parent specimen from which the focal specimen was a component." ) + protected List source; + + /** + * Where the specimen came from. This may be the patient(s) or from the environment or a device. + */ + @Child(name="subject", type={Patient.class, Group.class, Device.class, Substance.class}, order=2, min=1, max=1) + @Description(shortDefinition="Where the specimen came from. This may be the patient(s) or from the environment or a device", formalDefinition="Where the specimen came from. This may be the patient(s) or from the environment or a device." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (Where the specimen came from. This may be the patient(s) or from the environment or a device.) + */ + protected Resource subjectTarget; + + /** + * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. + */ + @Child(name="accessionIdentifier", type={Identifier.class}, order=3, min=0, max=1) + @Description(shortDefinition="Identifier assigned by the lab", formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures." ) + protected Identifier accessionIdentifier; + + /** + * Time when specimen was received for processing or testing. + */ + @Child(name="receivedTime", type={DateTimeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="The time when specimen was received for processing", formalDefinition="Time when specimen was received for processing or testing." ) + protected DateTimeType receivedTime; + + /** + * Details concerning the specimen collection. + */ + @Child(name="collection", type={}, order=5, min=0, max=1) + @Description(shortDefinition="Collection details", formalDefinition="Details concerning the specimen collection." ) + protected SpecimenCollectionComponent collection; + + /** + * Details concerning treatment and processing steps for the specimen. + */ + @Child(name="treatment", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Treatment and processing step details", formalDefinition="Details concerning treatment and processing steps for the specimen." ) + protected List treatment; + + /** + * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. + */ + @Child(name="container", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Direct container of specimen (tube/slide, etc)", formalDefinition="The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here." ) + protected List container; + + private static final long serialVersionUID = 862754396L; + + public Specimen() { + super(); + } + + public Specimen(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (Id for specimen.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (Id for specimen.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #type} (Kind of material that forms the specimen.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Kind of material that forms the specimen.) + */ + public Specimen setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #source} (Parent specimen from which the focal specimen was a component.) + */ + public List getSource() { + if (this.source == null) + this.source = new ArrayList(); + return this.source; + } + + public boolean hasSource() { + if (this.source == null) + return false; + for (SpecimenSourceComponent item : this.source) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #source} (Parent specimen from which the focal specimen was a component.) + */ + // syntactic sugar + public SpecimenSourceComponent addSource() { //3 + SpecimenSourceComponent t = new SpecimenSourceComponent(); + if (this.source == null) + this.source = new ArrayList(); + this.source.add(t); + return t; + } + + /** + * @return {@link #subject} (Where the specimen came from. This may be the patient(s) or from the environment or a device.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.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} (Where the specimen came from. This may be the patient(s) or from the environment or a device.) + */ + public Specimen 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. (Where the specimen came from. This may be the patient(s) or from the environment or a device.) + */ + public Resource getSubjectTarget() { + 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. (Where the specimen came from. This may be the patient(s) or from the environment or a device.) + */ + public Specimen setSubjectTarget(Resource value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) + */ + public Identifier getAccessionIdentifier() { + if (this.accessionIdentifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.accessionIdentifier"); + else if (Configuration.doAutoCreate()) + this.accessionIdentifier = new Identifier(); + return this.accessionIdentifier; + } + + public boolean hasAccessionIdentifier() { + return this.accessionIdentifier != null && !this.accessionIdentifier.isEmpty(); + } + + /** + * @param value {@link #accessionIdentifier} (The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.) + */ + public Specimen setAccessionIdentifier(Identifier value) { + this.accessionIdentifier = value; + return this; + } + + /** + * @return {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value + */ + public DateTimeType getReceivedTimeElement() { + if (this.receivedTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.receivedTime"); + else if (Configuration.doAutoCreate()) + this.receivedTime = new DateTimeType(); + return this.receivedTime; + } + + public boolean hasReceivedTimeElement() { + return this.receivedTime != null && !this.receivedTime.isEmpty(); + } + + public boolean hasReceivedTime() { + return this.receivedTime != null && !this.receivedTime.isEmpty(); + } + + /** + * @param value {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value + */ + public Specimen setReceivedTimeElement(DateTimeType value) { + this.receivedTime = value; + return this; + } + + /** + * @return Time when specimen was received for processing or testing. + */ + public Date getReceivedTime() { + return this.receivedTime == null ? null : this.receivedTime.getValue(); + } + + /** + * @param value Time when specimen was received for processing or testing. + */ + public Specimen setReceivedTime(Date value) { + if (value == null) + this.receivedTime = null; + else { + if (this.receivedTime == null) + this.receivedTime = new DateTimeType(); + this.receivedTime.setValue(value); + } + return this; + } + + /** + * @return {@link #collection} (Details concerning the specimen collection.) + */ + public SpecimenCollectionComponent getCollection() { + if (this.collection == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Specimen.collection"); + else if (Configuration.doAutoCreate()) + this.collection = new SpecimenCollectionComponent(); + return this.collection; + } + + public boolean hasCollection() { + return this.collection != null && !this.collection.isEmpty(); + } + + /** + * @param value {@link #collection} (Details concerning the specimen collection.) + */ + public Specimen setCollection(SpecimenCollectionComponent value) { + this.collection = value; + return this; + } + + /** + * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) + */ + public List getTreatment() { + if (this.treatment == null) + this.treatment = new ArrayList(); + return this.treatment; + } + + public boolean hasTreatment() { + if (this.treatment == null) + return false; + for (SpecimenTreatmentComponent item : this.treatment) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) + */ + // syntactic sugar + public SpecimenTreatmentComponent addTreatment() { //3 + SpecimenTreatmentComponent t = new SpecimenTreatmentComponent(); + if (this.treatment == null) + this.treatment = new ArrayList(); + this.treatment.add(t); + return t; + } + + /** + * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) + */ + public List getContainer() { + if (this.container == null) + this.container = new ArrayList(); + return this.container; + } + + public boolean hasContainer() { + if (this.container == null) + return false; + for (SpecimenContainerComponent item : this.container) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) + */ + // syntactic sugar + public SpecimenContainerComponent addContainer() { //3 + SpecimenContainerComponent t = new SpecimenContainerComponent(); + if (this.container == null) + this.container = new ArrayList(); + this.container.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Id for specimen.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("type", "CodeableConcept", "Kind of material that forms the specimen.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("source", "", "Parent specimen from which the focal specimen was a component.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Where the specimen came from. This may be the patient(s) or from the environment or a device.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("accessionIdentifier", "Identifier", "The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.", 0, java.lang.Integer.MAX_VALUE, accessionIdentifier)); + childrenList.add(new Property("receivedTime", "dateTime", "Time when specimen was received for processing or testing.", 0, java.lang.Integer.MAX_VALUE, receivedTime)); + childrenList.add(new Property("collection", "", "Details concerning the specimen collection.", 0, java.lang.Integer.MAX_VALUE, collection)); + childrenList.add(new Property("treatment", "", "Details concerning treatment and processing steps for the specimen.", 0, java.lang.Integer.MAX_VALUE, treatment)); + childrenList.add(new Property("container", "", "The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.", 0, java.lang.Integer.MAX_VALUE, container)); + } + + public Specimen copy() { + Specimen dst = new Specimen(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.type = type == null ? null : type.copy(); + if (source != null) { + dst.source = new ArrayList(); + for (SpecimenSourceComponent i : source) + dst.source.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + dst.accessionIdentifier = accessionIdentifier == null ? null : accessionIdentifier.copy(); + dst.receivedTime = receivedTime == null ? null : receivedTime.copy(); + dst.collection = collection == null ? null : collection.copy(); + if (treatment != null) { + dst.treatment = new ArrayList(); + for (SpecimenTreatmentComponent i : treatment) + dst.treatment.add(i.copy()); + }; + if (container != null) { + dst.container = new ArrayList(); + for (SpecimenContainerComponent i : container) + dst.container.add(i.copy()); + }; + return dst; + } + + protected Specimen typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) + && (source == null || source.isEmpty()) && (subject == null || subject.isEmpty()) && (accessionIdentifier == null || accessionIdentifier.isEmpty()) + && (receivedTime == null || receivedTime.isEmpty()) && (collection == null || collection.isEmpty()) + && (treatment == null || treatment.isEmpty()) && (container == null || container.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Specimen; + } + + @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference" ) + public static final String SP_SUBJECT = "subject"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java index 3fcd99bf7e2..c10ca522fb2 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java @@ -20,532 +20,532 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * This resource provides the request and response details for the resource for which the stsatus is to be checked. - */ -@ResourceDef(name="StatusRequest", profile="http://hl7.org/fhir/Profile/StatusRequest") -public class StatusRequest extends DomainResource { - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Reference of resource to reverse. - */ - @Child(name="request", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Reference of resource to reverse.) - */ - protected Resource requestTarget; - - /** - * Reference of response to resource to reverse. - */ - @Child(name="response", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Reference of response to resource to reverse.) - */ - protected Resource responseTarget; - - private static final long serialVersionUID = 2018065278L; - - public StatusRequest() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 StatusRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public StatusRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 StatusRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public StatusRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public StatusRequest setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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 StatusRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public StatusRequest setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 StatusRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public StatusRequest setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 StatusRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public StatusRequest setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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. (Reference of resource to reverse.) - */ - public Resource getRequestTarget() { - 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. (Reference of resource to reverse.) - */ - public StatusRequest setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource to reverse.) - */ - public StatusRequest setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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. (Reference of response to resource to reverse.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} 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 of response to resource to reverse.) - */ - public StatusRequest setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - protected void listChildren(List 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("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("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)); - childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); - } - - public StatusRequest copy() { - StatusRequest dst = new StatusRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - return dst; - } - - protected StatusRequest typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.StatusRequest; - } - - @SearchParamDefinition(name="identifier", path="StatusRequest.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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.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; +/** + * This resource provides the request and response details for the resource for which the stsatus is to be checked. + */ +@ResourceDef(name="StatusRequest", profile="http://hl7.org/fhir/Profile/StatusRequest") +public class StatusRequest extends DomainResource { + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer who is target of the request. + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer who is target of the request.) + */ + protected Organization targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Reference of resource to reverse. + */ + @Child(name="request", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Reference of resource to reverse.) + */ + protected Resource requestTarget; + + /** + * Reference of response to resource to reverse. + */ + @Child(name="response", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Reference of response to resource to reverse.) + */ + protected Resource responseTarget; + + private static final long serialVersionUID = 2018065278L; + + public StatusRequest() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 StatusRequest setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public StatusRequest setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 StatusRequest setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public StatusRequest setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer who is target of the request.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer who is target of the request.) + */ + public StatusRequest setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer who is target of the request.) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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 StatusRequest setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public StatusRequest setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 StatusRequest setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public StatusRequest setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 StatusRequest setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Reference of resource to reverse.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Reference of resource to reverse.) + */ + public StatusRequest setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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. (Reference of resource to reverse.) + */ + public Resource getRequestTarget() { + 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. (Reference of resource to reverse.) + */ + public StatusRequest setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Reference of response to resource to reverse.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusRequest.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Reference of response to resource to reverse.) + */ + public StatusRequest setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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. (Reference of response to resource to reverse.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} 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 of response to resource to reverse.) + */ + public StatusRequest setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + protected void listChildren(List 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("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("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)); + childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); + } + + public StatusRequest copy() { + StatusRequest dst = new StatusRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + return dst; + } + + protected StatusRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.StatusRequest; + } + + @SearchParamDefinition(name="identifier", path="StatusRequest.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java index cdae9baeac7..15e99ff3a13 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java @@ -20,814 +20,814 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * This resource provides processing status, errors and notes from the processing of a resource. - */ -@ResourceDef(name="StatusResponse", profile="http://hl7.org/fhir/Profile/StatusResponse") -public class StatusResponse extends DomainResource { - - @Block() - public static class StatusResponseNotesComponent extends BackboneElement { - /** - * The note purpose: Print/Display. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name="text", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Notes text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 129959202L; - - public StatusResponseNotesComponent() { - super(); - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponseNotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public StatusResponseNotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponseNotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StatusResponseNotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public StatusResponseNotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - public StatusResponseNotesComponent copy() { - StatusResponseNotesComponent dst = new StatusResponseNotesComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @Child(name="request", type={OralHealthClaim.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 OralHealthClaim requestTarget; - - /** - * Transaction status: error, complete, held. - */ - @Child(name="outcome", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) - protected Coding outcome; - - /** - * A description of the status of the adjudication or processing. - */ - @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - /** - * The form to be used for printing the content. - */ - @Child(name="form", type={Coding.class}, order=9, min=0, max=1) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Suite of processing note or additional requirements is the processing has been held. - */ - @Child(name="notes", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) - protected List notes; - - /** - * Processing errors. - */ - @Child(name="error", type={Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) - protected List error; - - private static final long serialVersionUID = 342376292L; - - public StatusResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public StatusResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 OralHealthClaim getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new OralHealthClaim(); - 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 StatusResponse setRequestTarget(OralHealthClaim value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete, held.) - */ - public Coding getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Coding(); - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete, held.) - */ - public StatusResponse setOutcome(Coding value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StatusResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication or processing. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication or processing. - */ - public StatusResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 StatusResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public StatusResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 StatusResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 StatusResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public StatusResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 Insurer who produced this adjudicated response.) - */ - public StatusResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public StatusResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} 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 StatusResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public StatusResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} 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 StatusResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public StatusResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StatusResponseNotesComponent item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) - */ - // syntactic sugar - public StatusResponseNotesComponent addNotes() { //3 - StatusResponseNotesComponent t = new StatusResponseNotesComponent(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @return {@link #error} (Processing errors.) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (Coding item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Processing errors.) - */ - // syntactic sugar - public Coding addError() { //3 - Coding t = new Coding(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - protected void listChildren(List 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(OralHealthClaim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 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("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)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); - } - - public StatusResponse copy() { - StatusResponse dst = new StatusResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.form = form == null ? null : form.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (StatusResponseNotesComponent i : notes) - dst.notes.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (Coding i : error) - dst.error.add(i.copy()); - }; - return dst; - } - - protected StatusResponse typedCopy() { - return copy(); - } - - public boolean isEmpty() { - 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()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.StatusResponse; - } - - @SearchParamDefinition(name="identifier", path="StatusResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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; +/** + * This resource provides processing status, errors and notes from the processing of a resource. + */ +@ResourceDef(name="StatusResponse", profile="http://hl7.org/fhir/Profile/StatusResponse") +public class StatusResponse extends DomainResource { + + @Block() + public static class StatusResponseNotesComponent extends BackboneElement { + /** + * The note purpose: Print/Display. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) + protected Coding type; + + /** + * The note text. + */ + @Child(name="text", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Notes text", formalDefinition="The note text." ) + protected StringType text; + + private static final long serialVersionUID = 129959202L; + + public StatusResponseNotesComponent() { + super(); + } + + /** + * @return {@link #type} (The note purpose: Print/Display.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponseNotesComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The note purpose: Print/Display.) + */ + public StatusResponseNotesComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StringType getTextElement() { + if (this.text == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponseNotesComponent.text"); + else if (Configuration.doAutoCreate()) + this.text = new StringType(); + return this.text; + } + + public boolean hasTextElement() { + return this.text != null && !this.text.isEmpty(); + } + + public boolean hasText() { + return this.text != null && !this.text.isEmpty(); + } + + /** + * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value + */ + public StatusResponseNotesComponent setTextElement(StringType value) { + this.text = value; + return this; + } + + /** + * @return The note text. + */ + public String getText() { + return this.text == null ? null : this.text.getValue(); + } + + /** + * @param value The note text. + */ + public StatusResponseNotesComponent setText(String value) { + if (Utilities.noString(value)) + this.text = null; + else { + if (this.text == null) + this.text = new StringType(); + this.text.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); + } + + public StatusResponseNotesComponent copy() { + StatusResponseNotesComponent dst = new StatusResponseNotesComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.text = text == null ? null : text.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) + ; + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * Original request resource referrence. + */ + @Child(name="request", type={OralHealthClaim.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 OralHealthClaim requestTarget; + + /** + * Transaction status: error, complete, held. + */ + @Child(name="outcome", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) + protected Coding outcome; + + /** + * A description of the status of the adjudication or processing. + */ + @Child(name="disposition", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) + protected StringType disposition; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=3, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=4, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * The Insurer who produced this adjudicated response. + */ + @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) + */ + protected Organization organizationTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference requestProvider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner requestProviderTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference requestOrganization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization requestOrganizationTarget; + + /** + * The form to be used for printing the content. + */ + @Child(name="form", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) + protected Coding form; + + /** + * Suite of processing note or additional requirements is the processing has been held. + */ + @Child(name="notes", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) + protected List notes; + + /** + * Processing errors. + */ + @Child(name="error", type={Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) + protected List error; + + private static final long serialVersionUID = 342376292L; + + public StatusResponse() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #request} (Original request resource referrence.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request resource referrence.) + */ + public StatusResponse setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 OralHealthClaim getRequestTarget() { + if (this.requestTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.request"); + else if (Configuration.doAutoCreate()) + this.requestTarget = new OralHealthClaim(); + 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 StatusResponse setRequestTarget(OralHealthClaim value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #outcome} (Transaction status: error, complete, held.) + */ + public Coding getOutcome() { + if (this.outcome == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.outcome"); + else if (Configuration.doAutoCreate()) + this.outcome = new Coding(); + return this.outcome; + } + + public boolean hasOutcome() { + return this.outcome != null && !this.outcome.isEmpty(); + } + + /** + * @param value {@link #outcome} (Transaction status: error, complete, held.) + */ + public StatusResponse setOutcome(Coding value) { + this.outcome = value; + return this; + } + + /** + * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StringType getDispositionElement() { + if (this.disposition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.disposition"); + else if (Configuration.doAutoCreate()) + this.disposition = new StringType(); + return this.disposition; + } + + public boolean hasDispositionElement() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + public boolean hasDisposition() { + return this.disposition != null && !this.disposition.isEmpty(); + } + + /** + * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value + */ + public StatusResponse setDispositionElement(StringType value) { + this.disposition = value; + return this; + } + + /** + * @return A description of the status of the adjudication or processing. + */ + public String getDisposition() { + return this.disposition == null ? null : this.disposition.getValue(); + } + + /** + * @param value A description of the status of the adjudication or processing. + */ + public StatusResponse setDisposition(String value) { + if (Utilities.noString(value)) + this.disposition = null; + else { + if (this.disposition == null) + this.disposition = new StringType(); + this.disposition.setValue(value); + } + return this; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 StatusResponse setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public StatusResponse setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 StatusResponse setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 StatusResponse setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The Insurer who produced this adjudicated response.) + */ + public StatusResponse setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 Insurer who produced this adjudicated response.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 Insurer who produced this adjudicated response.) + */ + public StatusResponse setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getRequestProvider() { + if (this.requestProvider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProvider = new Reference(); + return this.requestProvider; + } + + public boolean hasRequestProvider() { + return this.requestProvider != null && !this.requestProvider.isEmpty(); + } + + /** + * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public StatusResponse setRequestProvider(Reference value) { + this.requestProvider = value; + return this; + } + + /** + * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getRequestProviderTarget() { + if (this.requestProviderTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.requestProvider"); + else if (Configuration.doAutoCreate()) + this.requestProviderTarget = new Practitioner(); + return this.requestProviderTarget; + } + + /** + * @param value {@link #requestProvider} 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 StatusResponse setRequestProviderTarget(Practitioner value) { + this.requestProviderTarget = value; + return this; + } + + /** + * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getRequestOrganization() { + if (this.requestOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganization = new Reference(); + return this.requestOrganization; + } + + public boolean hasRequestOrganization() { + return this.requestOrganization != null && !this.requestOrganization.isEmpty(); + } + + /** + * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) + */ + public StatusResponse setRequestOrganization(Reference value) { + this.requestOrganization = value; + return this; + } + + /** + * @return {@link #requestOrganization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getRequestOrganizationTarget() { + if (this.requestOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.requestOrganization"); + else if (Configuration.doAutoCreate()) + this.requestOrganizationTarget = new Organization(); + return this.requestOrganizationTarget; + } + + /** + * @param value {@link #requestOrganization} 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 StatusResponse setRequestOrganizationTarget(Organization value) { + this.requestOrganizationTarget = value; + return this; + } + + /** + * @return {@link #form} (The form to be used for printing the content.) + */ + public Coding getForm() { + if (this.form == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create StatusResponse.form"); + else if (Configuration.doAutoCreate()) + this.form = new Coding(); + return this.form; + } + + public boolean hasForm() { + return this.form != null && !this.form.isEmpty(); + } + + /** + * @param value {@link #form} (The form to be used for printing the content.) + */ + public StatusResponse setForm(Coding value) { + this.form = value; + return this; + } + + /** + * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + */ + public List getNotes() { + if (this.notes == null) + this.notes = new ArrayList(); + return this.notes; + } + + public boolean hasNotes() { + if (this.notes == null) + return false; + for (StatusResponseNotesComponent item : this.notes) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) + */ + // syntactic sugar + public StatusResponseNotesComponent addNotes() { //3 + StatusResponseNotesComponent t = new StatusResponseNotesComponent(); + if (this.notes == null) + this.notes = new ArrayList(); + this.notes.add(t); + return t; + } + + /** + * @return {@link #error} (Processing errors.) + */ + public List getError() { + if (this.error == null) + this.error = new ArrayList(); + return this.error; + } + + public boolean hasError() { + if (this.error == null) + return false; + for (Coding item : this.error) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #error} (Processing errors.) + */ + // syntactic sugar + public Coding addError() { //3 + Coding t = new Coding(); + if (this.error == null) + this.error = new ArrayList(); + this.error.add(t); + return t; + } + + protected void listChildren(List 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(OralHealthClaim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); + childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 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("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)); + childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); + childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); + } + + public StatusResponse copy() { + StatusResponse dst = new StatusResponse(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.request = request == null ? null : request.copy(); + dst.outcome = outcome == null ? null : outcome.copy(); + dst.disposition = disposition == null ? null : disposition.copy(); + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.form = form == null ? null : form.copy(); + if (notes != null) { + dst.notes = new ArrayList(); + for (StatusResponseNotesComponent i : notes) + dst.notes.add(i.copy()); + }; + if (error != null) { + dst.error = new ArrayList(); + for (Coding i : error) + dst.error.add(i.copy()); + }; + return dst; + } + + protected StatusResponse typedCopy() { + return copy(); + } + + public boolean isEmpty() { + 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()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.StatusResponse; + } + + @SearchParamDefinition(name="identifier", path="StatusResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java index 80f8b620522..0f33d849ea3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.instance.model; /* @@ -48,73 +48,73 @@ package org.hl7.fhir.instance.model; * #L% */ - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - - -/** - * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length - */ -@DatatypeDef(name = "string") -public class StringType extends PrimitiveType { - - private static final long serialVersionUID = 2L; - - /** - * Create a new String - */ - public StringType() { - super(); - } - - /** - * Create a new String - */ - public StringType(String theValue) { - setValue(theValue); - } - - /** - * Returns the value of this StringType, or an empty string ("") if the - * value is null. This method is provided as a convenience to - * users of this API. - */ - public String getValueNotNull() { - return StringUtils.defaultString(getValue()); - } - - /** - * Returns the value of this string, or null if no value - * is present - */ - @Override - public String toString() { - return getValue(); - } - - /** - * Returns true if this datatype has no extensions, and has either a null value or an empty ("") value. - */ - @Override - public boolean isEmpty() { - boolean retVal = super.isEmpty() && StringUtils.isBlank(getValue()); - return retVal; - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public StringType copy() { - return new StringType(getValue()); - } - -} + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + + +/** + * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length + */ +@DatatypeDef(name = "string") +public class StringType extends PrimitiveType { + + private static final long serialVersionUID = 2L; + + /** + * Create a new String + */ + public StringType() { + super(); + } + + /** + * Create a new String + */ + public StringType(String theValue) { + setValue(theValue); + } + + /** + * Returns the value of this StringType, or an empty string ("") if the + * value is null. This method is provided as a convenience to + * users of this API. + */ + public String getValueNotNull() { + return StringUtils.defaultString(getValue()); + } + + /** + * Returns the value of this string, or null if no value + * is present + */ + @Override + public String toString() { + return getValue(); + } + + /** + * Returns true if this datatype has no extensions, and has either a null value or an empty ("") value. + */ + @Override + public boolean isEmpty() { + boolean retVal = super.isEmpty() && StringUtils.isBlank(getValue()); + return retVal; + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public StringType copy() { + return new StringType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java index 2fe30260e80..cdc03dadd69 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java @@ -20,1177 +20,1177 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * Todo. - */ -@ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") -public class Subscription extends DomainResource { - - public enum SubscriptionStatus implements FhirEnum { - /** - * The client has requested the subscription, and the server has not yet set it up. - */ - REQUESTED, - /** - * The subscription is active. - */ - ACTIVE, - /** - * The server has an error executing the notification. - */ - ERROR, - /** - * Too many errors have occurred or the subscription has expired. - */ - OFF, - /** - * added to help the parsers - */ - NULL; - - public static final SubscriptionStatusEnumFactory ENUM_FACTORY = new SubscriptionStatusEnumFactory(); - - public static SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("error".equals(codeString)) - return ERROR; - if ("off".equals(codeString)) - return OFF; - throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case ERROR: return "error"; - case OFF: return "off"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case ACTIVE: return ""; - case ERROR: return ""; - case OFF: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The client has requested the subscription, and the server has not yet set it up."; - case ACTIVE: return "The subscription is active."; - case ERROR: return "The server has an error executing the notification."; - case OFF: return "Too many errors have occurred or the subscription has expired."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case ERROR: return "error"; - case OFF: return "off"; - default: return "?"; - } - } - } - - public static class SubscriptionStatusEnumFactory implements EnumFactory { - public SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return SubscriptionStatus.REQUESTED; - if ("active".equals(codeString)) - return SubscriptionStatus.ACTIVE; - if ("error".equals(codeString)) - return SubscriptionStatus.ERROR; - if ("off".equals(codeString)) - return SubscriptionStatus.OFF; - throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); - } - public String toCode(SubscriptionStatus code) throws IllegalArgumentException { - if (code == SubscriptionStatus.REQUESTED) - return "requested"; - if (code == SubscriptionStatus.ACTIVE) - return "active"; - if (code == SubscriptionStatus.ERROR) - return "error"; - if (code == SubscriptionStatus.OFF) - return "off"; - return "?"; - } - } - - public enum SubscriptionChannelType implements FhirEnum { - /** - * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. - */ - RESTHOOK, - /** - * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. - */ - WEBSOCKET, - /** - * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). - */ - EMAIL, - /** - * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). - */ - SMS, - /** - * The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI. - */ - MESSAGE, - /** - * added to help the parsers - */ - NULL; - - public static final SubscriptionChannelTypeEnumFactory ENUM_FACTORY = new SubscriptionChannelTypeEnumFactory(); - - public static SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return RESTHOOK; - if ("websocket".equals(codeString)) - return WEBSOCKET; - if ("email".equals(codeString)) - return EMAIL; - if ("sms".equals(codeString)) - return SMS; - if ("message".equals(codeString)) - return MESSAGE; - throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case RESTHOOK: return "rest-hook"; - case WEBSOCKET: return "websocket"; - case EMAIL: return "email"; - case SMS: return "sms"; - case MESSAGE: return "message"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESTHOOK: return ""; - case WEBSOCKET: return ""; - case EMAIL: return ""; - case SMS: return ""; - case MESSAGE: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESTHOOK: return "The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made."; - case WEBSOCKET: return "The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL."; - case EMAIL: return "The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:)."; - case SMS: return "The channel is executed by sending an SMS message to the phone number identified in the URL (tel:)."; - case MESSAGE: return "The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESTHOOK: return "rest-hook"; - case WEBSOCKET: return "websocket"; - case EMAIL: return "email"; - case SMS: return "sms"; - case MESSAGE: return "message"; - default: return "?"; - } - } - } - - public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { - public SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return SubscriptionChannelType.RESTHOOK; - if ("websocket".equals(codeString)) - return SubscriptionChannelType.WEBSOCKET; - if ("email".equals(codeString)) - return SubscriptionChannelType.EMAIL; - if ("sms".equals(codeString)) - return SubscriptionChannelType.SMS; - if ("message".equals(codeString)) - return SubscriptionChannelType.MESSAGE; - throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - public String toCode(SubscriptionChannelType code) throws IllegalArgumentException { - if (code == SubscriptionChannelType.RESTHOOK) - return "rest-hook"; - if (code == SubscriptionChannelType.WEBSOCKET) - return "websocket"; - if (code == SubscriptionChannelType.EMAIL) - return "email"; - if (code == SubscriptionChannelType.SMS) - return "sms"; - if (code == SubscriptionChannelType.MESSAGE) - return "message"; - return "?"; - } - } - - @Block() - public static class SubscriptionChannelComponent extends BackboneElement { - /** - * Todo. - */ - @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="rest-hook | websocket | email | sms | message", formalDefinition="Todo." ) - protected Enumeration type; - - /** - * Todo. - */ - @Child(name="url", type={UriType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Where the channel points to", formalDefinition="Todo." ) - protected UriType url; - - /** - * ToDo. - */ - @Child(name="payload", type={StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Mimetype to send, or blank for no payload", formalDefinition="ToDo." ) - protected StringType payload; - - /** - * Usage depends on the channel type. - */ - @Child(name="header", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Usage depends on the channel type." ) - protected StringType header; - - private static final long serialVersionUID = 904575965L; - - public SubscriptionChannelComponent() { - super(); - } - - public SubscriptionChannelComponent(Enumeration type, StringType payload) { - super(); - this.type = type; - this.payload = payload; - } - - /** - * @return {@link #type} (Todo.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(); - 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} (Todo.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SubscriptionChannelComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Todo. - */ - public SubscriptionChannelType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Todo. - */ - public SubscriptionChannelComponent setType(SubscriptionChannelType value) { - if (this.type == null) - this.type = new Enumeration(SubscriptionChannelType.ENUM_FACTORY); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #url} (Todo.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (Todo.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SubscriptionChannelComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return Todo. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value Todo. - */ - public SubscriptionChannelComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #payload} (ToDo.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value - */ - public StringType getPayloadElement() { - if (this.payload == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.payload"); - else if (Configuration.doAutoCreate()) - this.payload = new StringType(); - return this.payload; - } - - public boolean hasPayloadElement() { - return this.payload != null && !this.payload.isEmpty(); - } - - public boolean hasPayload() { - return this.payload != null && !this.payload.isEmpty(); - } - - /** - * @param value {@link #payload} (ToDo.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value - */ - public SubscriptionChannelComponent setPayloadElement(StringType value) { - this.payload = value; - return this; - } - - /** - * @return ToDo. - */ - public String getPayload() { - return this.payload == null ? null : this.payload.getValue(); - } - - /** - * @param value ToDo. - */ - public SubscriptionChannelComponent setPayload(String value) { - if (this.payload == null) - this.payload = new StringType(); - this.payload.setValue(value); - return this; - } - - /** - * @return {@link #header} (Usage depends on the channel type.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value - */ - public StringType getHeaderElement() { - if (this.header == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.header"); - else if (Configuration.doAutoCreate()) - this.header = new StringType(); - return this.header; - } - - public boolean hasHeaderElement() { - return this.header != null && !this.header.isEmpty(); - } - - public boolean hasHeader() { - return this.header != null && !this.header.isEmpty(); - } - - /** - * @param value {@link #header} (Usage depends on the channel type.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value - */ - public SubscriptionChannelComponent setHeaderElement(StringType value) { - this.header = value; - return this; - } - - /** - * @return Usage depends on the channel type. - */ - public String getHeader() { - return this.header == null ? null : this.header.getValue(); - } - - /** - * @param value Usage depends on the channel type. - */ - public SubscriptionChannelComponent setHeader(String value) { - if (Utilities.noString(value)) - this.header = null; - else { - if (this.header == null) - this.header = new StringType(); - this.header.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Todo.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("url", "uri", "Todo.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("payload", "string", "ToDo.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("header", "string", "Usage depends on the channel type.", 0, java.lang.Integer.MAX_VALUE, header)); - } - - public SubscriptionChannelComponent copy() { - SubscriptionChannelComponent dst = new SubscriptionChannelComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.url = url == null ? null : url.copy(); - dst.payload = payload == null ? null : payload.copy(); - dst.header = header == null ? null : header.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) - && (payload == null || payload.isEmpty()) && (header == null || header.isEmpty()); - } - - } - - @Block() - public static class SubscriptionTagComponent extends BackboneElement { - /** - * Todo. - */ - @Child(name="term", type={UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="The term that identifies the tag", formalDefinition="Todo." ) - protected UriType term; - - /** - * Todo. - */ - @Child(name="scheme", type={UriType.class}, order=2, min=1, max=1) - @Description(shortDefinition="The scheme for the tag (kind of tag)", formalDefinition="Todo." ) - protected UriType scheme; - - /** - * Todo. - */ - @Child(name="description", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Tag description label", formalDefinition="Todo." ) - protected StringType description; - - private static final long serialVersionUID = 957833176L; - - public SubscriptionTagComponent() { - super(); - } - - public SubscriptionTagComponent(UriType term, UriType scheme) { - super(); - this.term = term; - this.scheme = scheme; - } - - /** - * @return {@link #term} (Todo.). This is the underlying object with id, value and extensions. The accessor "getTerm" gives direct access to the value - */ - public UriType getTermElement() { - if (this.term == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionTagComponent.term"); - else if (Configuration.doAutoCreate()) - this.term = new UriType(); - return this.term; - } - - public boolean hasTermElement() { - return this.term != null && !this.term.isEmpty(); - } - - public boolean hasTerm() { - return this.term != null && !this.term.isEmpty(); - } - - /** - * @param value {@link #term} (Todo.). This is the underlying object with id, value and extensions. The accessor "getTerm" gives direct access to the value - */ - public SubscriptionTagComponent setTermElement(UriType value) { - this.term = value; - return this; - } - - /** - * @return Todo. - */ - public String getTerm() { - return this.term == null ? null : this.term.getValue(); - } - - /** - * @param value Todo. - */ - public SubscriptionTagComponent setTerm(String value) { - if (this.term == null) - this.term = new UriType(); - this.term.setValue(value); - return this; - } - - /** - * @return {@link #scheme} (Todo.). This is the underlying object with id, value and extensions. The accessor "getScheme" gives direct access to the value - */ - public UriType getSchemeElement() { - if (this.scheme == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionTagComponent.scheme"); - else if (Configuration.doAutoCreate()) - this.scheme = new UriType(); - return this.scheme; - } - - public boolean hasSchemeElement() { - return this.scheme != null && !this.scheme.isEmpty(); - } - - public boolean hasScheme() { - return this.scheme != null && !this.scheme.isEmpty(); - } - - /** - * @param value {@link #scheme} (Todo.). This is the underlying object with id, value and extensions. The accessor "getScheme" gives direct access to the value - */ - public SubscriptionTagComponent setSchemeElement(UriType value) { - this.scheme = value; - return this; - } - - /** - * @return Todo. - */ - public String getScheme() { - return this.scheme == null ? null : this.scheme.getValue(); - } - - /** - * @param value Todo. - */ - public SubscriptionTagComponent setScheme(String value) { - if (this.scheme == null) - this.scheme = new UriType(); - this.scheme.setValue(value); - return this; - } - - /** - * @return {@link #description} (Todo.). 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 SubscriptionTagComponent.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} (Todo.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SubscriptionTagComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Todo. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Todo. - */ - public SubscriptionTagComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("term", "uri", "Todo.", 0, java.lang.Integer.MAX_VALUE, term)); - childrenList.add(new Property("scheme", "uri", "Todo.", 0, java.lang.Integer.MAX_VALUE, scheme)); - childrenList.add(new Property("description", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, description)); - } - - public SubscriptionTagComponent copy() { - SubscriptionTagComponent dst = new SubscriptionTagComponent(); - copyValues(dst); - dst.term = term == null ? null : term.copy(); - dst.scheme = scheme == null ? null : scheme.copy(); - dst.description = description == null ? null : description.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (term == null || term.isEmpty()) && (scheme == null || scheme.isEmpty()) - && (description == null || description.isEmpty()); - } - - } - - /** - * Todo. - */ - @Child(name="criteria", type={StringType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Rule for server push criteria", formalDefinition="Todo." ) - protected StringType criteria; - - /** - * Todo. - */ - @Child(name="contact", type={ContactPoint.class}, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Todo." ) - protected List contact; - - /** - * Todo. - */ - @Child(name="reason", type={StringType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Description of why this subscription was created", formalDefinition="Todo." ) - protected StringType reason; - - /** - * Todo. - */ - @Child(name="status", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="requested | active | error | off", formalDefinition="Todo." ) - protected Enumeration status; - - /** - * Todo. - */ - @Child(name="error", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Latest error note", formalDefinition="Todo." ) - protected StringType error; - - /** - * Todo. - */ - @Child(name="channel", type={}, order=4, min=1, max=1) - @Description(shortDefinition="The channel on which to report matches to the criteria", formalDefinition="Todo." ) - protected SubscriptionChannelComponent channel; - - /** - * Todo. - */ - @Child(name="end", type={InstantType.class}, order=5, min=0, max=1) - @Description(shortDefinition="When to automatically delete the subscription", formalDefinition="Todo." ) - protected InstantType end; - - /** - * Todo. - */ - @Child(name="tag", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A tag to add to matching resources", formalDefinition="Todo." ) - protected List tag; - - private static final long serialVersionUID = 68195650L; - - public Subscription() { - super(); - } - - public Subscription(StringType criteria, StringType reason, Enumeration status, SubscriptionChannelComponent channel) { - super(); - this.criteria = criteria; - this.reason = reason; - this.status = status; - this.channel = channel; - } - - /** - * @return {@link #criteria} (Todo.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public StringType getCriteriaElement() { - if (this.criteria == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.criteria"); - else if (Configuration.doAutoCreate()) - this.criteria = new StringType(); - return this.criteria; - } - - public boolean hasCriteriaElement() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - public boolean hasCriteria() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - /** - * @param value {@link #criteria} (Todo.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public Subscription setCriteriaElement(StringType value) { - this.criteria = value; - return this; - } - - /** - * @return Todo. - */ - public String getCriteria() { - return this.criteria == null ? null : this.criteria.getValue(); - } - - /** - * @param value Todo. - */ - public Subscription setCriteria(String value) { - if (this.criteria == null) - this.criteria = new StringType(); - this.criteria.setValue(value); - return this; - } - - /** - * @return {@link #contact} (Todo.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactPoint item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Todo.) - */ - // syntactic sugar - public ContactPoint addContact() { //3 - ContactPoint t = new ContactPoint(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - /** - * @return {@link #reason} (Todo.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public StringType getReasonElement() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new StringType(); - return this.reason; - } - - public boolean hasReasonElement() { - return this.reason != null && !this.reason.isEmpty(); - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Todo.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public Subscription setReasonElement(StringType value) { - this.reason = value; - return this; - } - - /** - * @return Todo. - */ - public String getReason() { - return this.reason == null ? null : this.reason.getValue(); - } - - /** - * @param value Todo. - */ - public Subscription setReason(String value) { - if (this.reason == null) - this.reason = new StringType(); - this.reason.setValue(value); - return this; - } - - /** - * @return {@link #status} (Todo.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Todo.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Subscription setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Todo. - */ - public SubscriptionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Todo. - */ - public Subscription setStatus(SubscriptionStatus value) { - if (this.status == null) - this.status = new Enumeration(SubscriptionStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #error} (Todo.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value - */ - public StringType getErrorElement() { - if (this.error == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.error"); - else if (Configuration.doAutoCreate()) - this.error = new StringType(); - return this.error; - } - - public boolean hasErrorElement() { - return this.error != null && !this.error.isEmpty(); - } - - public boolean hasError() { - return this.error != null && !this.error.isEmpty(); - } - - /** - * @param value {@link #error} (Todo.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value - */ - public Subscription setErrorElement(StringType value) { - this.error = value; - return this; - } - - /** - * @return Todo. - */ - public String getError() { - return this.error == null ? null : this.error.getValue(); - } - - /** - * @param value Todo. - */ - public Subscription setError(String value) { - if (Utilities.noString(value)) - this.error = null; - else { - if (this.error == null) - this.error = new StringType(); - this.error.setValue(value); - } - return this; - } - - /** - * @return {@link #channel} (Todo.) - */ - public SubscriptionChannelComponent getChannel() { - if (this.channel == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.channel"); - else if (Configuration.doAutoCreate()) - this.channel = new SubscriptionChannelComponent(); - return this.channel; - } - - public boolean hasChannel() { - return this.channel != null && !this.channel.isEmpty(); - } - - /** - * @param value {@link #channel} (Todo.) - */ - public Subscription setChannel(SubscriptionChannelComponent value) { - this.channel = value; - return this; - } - - /** - * @return {@link #end} (Todo.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Todo.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Subscription setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Todo. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Todo. - */ - public Subscription setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - /** - * @return {@link #tag} (Todo.) - */ - public List getTag() { - if (this.tag == null) - this.tag = new ArrayList(); - return this.tag; - } - - public boolean hasTag() { - if (this.tag == null) - return false; - for (SubscriptionTagComponent item : this.tag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #tag} (Todo.) - */ - // syntactic sugar - public SubscriptionTagComponent addTag() { //3 - SubscriptionTagComponent t = new SubscriptionTagComponent(); - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("criteria", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, criteria)); - childrenList.add(new Property("contact", "ContactPoint", "Todo.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("reason", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("status", "code", "Todo.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("error", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("channel", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, channel)); - childrenList.add(new Property("end", "instant", "Todo.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("tag", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, tag)); - } - - public Subscription copy() { - Subscription dst = new Subscription(); - copyValues(dst); - dst.criteria = criteria == null ? null : criteria.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactPoint i : contact) - dst.contact.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - dst.status = status == null ? null : status.copy(); - dst.error = error == null ? null : error.copy(); - dst.channel = channel == null ? null : channel.copy(); - dst.end = end == null ? null : end.copy(); - if (tag != null) { - dst.tag = new ArrayList(); - for (SubscriptionTagComponent i : tag) - dst.tag.add(i.copy()); - }; - return dst; - } - - protected Subscription typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (criteria == null || criteria.isEmpty()) && (contact == null || contact.isEmpty()) - && (reason == null || reason.isEmpty()) && (status == null || status.isEmpty()) && (error == null || error.isEmpty()) - && (channel == null || channel.isEmpty()) && (end == null || end.isEmpty()) && (tag == null || tag.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Subscription; - } - - @SearchParamDefinition(name="criteria", path="Subscription.criteria", description="Rule for server push criteria", type="string" ) - public static final String SP_CRITERIA = "criteria"; - @SearchParamDefinition(name="status", path="Subscription.status", description="requested | active | error | off", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="tag", path="Subscription.tag.term", description="The term that identifies the tag", type="string" ) - public static final String SP_TAG = "tag"; - @SearchParamDefinition(name="payload", path="Subscription.channel.payload", description="Mimetype to send, or blank for no payload", type="string" ) - public static final String SP_PAYLOAD = "payload"; - @SearchParamDefinition(name="type", path="Subscription.channel.type", description="rest-hook | websocket | email | sms | message", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="contact", path="Subscription.contact", description="Contact details for source (e.g. troubleshooting)", type="token" ) - public static final String SP_CONTACT = "contact"; - @SearchParamDefinition(name="url", path="Subscription.channel.url", description="Where the channel points to", type="string" ) - public static final String SP_URL = "url"; - -} - + +/* + 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; +/** + * Todo. + */ +@ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") +public class Subscription extends DomainResource { + + public enum SubscriptionStatus implements FhirEnum { + /** + * The client has requested the subscription, and the server has not yet set it up. + */ + REQUESTED, + /** + * The subscription is active. + */ + ACTIVE, + /** + * The server has an error executing the notification. + */ + ERROR, + /** + * Too many errors have occurred or the subscription has expired. + */ + OFF, + /** + * added to help the parsers + */ + NULL; + + public static final SubscriptionStatusEnumFactory ENUM_FACTORY = new SubscriptionStatusEnumFactory(); + + public static SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("active".equals(codeString)) + return ACTIVE; + if ("error".equals(codeString)) + return ERROR; + if ("off".equals(codeString)) + return OFF; + throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case ERROR: return "error"; + case OFF: return "off"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case ACTIVE: return ""; + case ERROR: return ""; + case OFF: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "The client has requested the subscription, and the server has not yet set it up."; + case ACTIVE: return "The subscription is active."; + case ERROR: return "The server has an error executing the notification."; + case OFF: return "Too many errors have occurred or the subscription has expired."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "requested"; + case ACTIVE: return "active"; + case ERROR: return "error"; + case OFF: return "off"; + default: return "?"; + } + } + } + + public static class SubscriptionStatusEnumFactory implements EnumFactory { + public SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return SubscriptionStatus.REQUESTED; + if ("active".equals(codeString)) + return SubscriptionStatus.ACTIVE; + if ("error".equals(codeString)) + return SubscriptionStatus.ERROR; + if ("off".equals(codeString)) + return SubscriptionStatus.OFF; + throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); + } + public String toCode(SubscriptionStatus code) throws IllegalArgumentException { + if (code == SubscriptionStatus.REQUESTED) + return "requested"; + if (code == SubscriptionStatus.ACTIVE) + return "active"; + if (code == SubscriptionStatus.ERROR) + return "error"; + if (code == SubscriptionStatus.OFF) + return "off"; + return "?"; + } + } + + public enum SubscriptionChannelType implements FhirEnum { + /** + * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. + */ + RESTHOOK, + /** + * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. + */ + WEBSOCKET, + /** + * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). + */ + EMAIL, + /** + * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). + */ + SMS, + /** + * The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI. + */ + MESSAGE, + /** + * added to help the parsers + */ + NULL; + + public static final SubscriptionChannelTypeEnumFactory ENUM_FACTORY = new SubscriptionChannelTypeEnumFactory(); + + public static SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("rest-hook".equals(codeString)) + return RESTHOOK; + if ("websocket".equals(codeString)) + return WEBSOCKET; + if ("email".equals(codeString)) + return EMAIL; + if ("sms".equals(codeString)) + return SMS; + if ("message".equals(codeString)) + return MESSAGE; + throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case RESTHOOK: return "rest-hook"; + case WEBSOCKET: return "websocket"; + case EMAIL: return "email"; + case SMS: return "sms"; + case MESSAGE: return "message"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case RESTHOOK: return ""; + case WEBSOCKET: return ""; + case EMAIL: return ""; + case SMS: return ""; + case MESSAGE: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case RESTHOOK: return "The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made."; + case WEBSOCKET: return "The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL."; + case EMAIL: return "The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:)."; + case SMS: return "The channel is executed by sending an SMS message to the phone number identified in the URL (tel:)."; + case MESSAGE: return "The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case RESTHOOK: return "rest-hook"; + case WEBSOCKET: return "websocket"; + case EMAIL: return "email"; + case SMS: return "sms"; + case MESSAGE: return "message"; + default: return "?"; + } + } + } + + public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { + public SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("rest-hook".equals(codeString)) + return SubscriptionChannelType.RESTHOOK; + if ("websocket".equals(codeString)) + return SubscriptionChannelType.WEBSOCKET; + if ("email".equals(codeString)) + return SubscriptionChannelType.EMAIL; + if ("sms".equals(codeString)) + return SubscriptionChannelType.SMS; + if ("message".equals(codeString)) + return SubscriptionChannelType.MESSAGE; + throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); + } + public String toCode(SubscriptionChannelType code) throws IllegalArgumentException { + if (code == SubscriptionChannelType.RESTHOOK) + return "rest-hook"; + if (code == SubscriptionChannelType.WEBSOCKET) + return "websocket"; + if (code == SubscriptionChannelType.EMAIL) + return "email"; + if (code == SubscriptionChannelType.SMS) + return "sms"; + if (code == SubscriptionChannelType.MESSAGE) + return "message"; + return "?"; + } + } + + @Block() + public static class SubscriptionChannelComponent extends BackboneElement { + /** + * Todo. + */ + @Child(name="type", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="rest-hook | websocket | email | sms | message", formalDefinition="Todo." ) + protected Enumeration type; + + /** + * Todo. + */ + @Child(name="url", type={UriType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Where the channel points to", formalDefinition="Todo." ) + protected UriType url; + + /** + * ToDo. + */ + @Child(name="payload", type={StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Mimetype to send, or blank for no payload", formalDefinition="ToDo." ) + protected StringType payload; + + /** + * Usage depends on the channel type. + */ + @Child(name="header", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Usage depends on the channel type." ) + protected StringType header; + + private static final long serialVersionUID = 904575965L; + + public SubscriptionChannelComponent() { + super(); + } + + public SubscriptionChannelComponent(Enumeration type, StringType payload) { + super(); + this.type = type; + this.payload = payload; + } + + /** + * @return {@link #type} (Todo.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + 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} (Todo.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public SubscriptionChannelComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Todo. + */ + public SubscriptionChannelType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Todo. + */ + public SubscriptionChannelComponent setType(SubscriptionChannelType value) { + if (this.type == null) + this.type = new Enumeration(SubscriptionChannelType.ENUM_FACTORY); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #url} (Todo.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public UriType getUrlElement() { + if (this.url == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.url"); + else if (Configuration.doAutoCreate()) + this.url = new UriType(); + return this.url; + } + + public boolean hasUrlElement() { + return this.url != null && !this.url.isEmpty(); + } + + public boolean hasUrl() { + return this.url != null && !this.url.isEmpty(); + } + + /** + * @param value {@link #url} (Todo.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value + */ + public SubscriptionChannelComponent setUrlElement(UriType value) { + this.url = value; + return this; + } + + /** + * @return Todo. + */ + public String getUrl() { + return this.url == null ? null : this.url.getValue(); + } + + /** + * @param value Todo. + */ + public SubscriptionChannelComponent setUrl(String value) { + if (Utilities.noString(value)) + this.url = null; + else { + if (this.url == null) + this.url = new UriType(); + this.url.setValue(value); + } + return this; + } + + /** + * @return {@link #payload} (ToDo.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value + */ + public StringType getPayloadElement() { + if (this.payload == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.payload"); + else if (Configuration.doAutoCreate()) + this.payload = new StringType(); + return this.payload; + } + + public boolean hasPayloadElement() { + return this.payload != null && !this.payload.isEmpty(); + } + + public boolean hasPayload() { + return this.payload != null && !this.payload.isEmpty(); + } + + /** + * @param value {@link #payload} (ToDo.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value + */ + public SubscriptionChannelComponent setPayloadElement(StringType value) { + this.payload = value; + return this; + } + + /** + * @return ToDo. + */ + public String getPayload() { + return this.payload == null ? null : this.payload.getValue(); + } + + /** + * @param value ToDo. + */ + public SubscriptionChannelComponent setPayload(String value) { + if (this.payload == null) + this.payload = new StringType(); + this.payload.setValue(value); + return this; + } + + /** + * @return {@link #header} (Usage depends on the channel type.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value + */ + public StringType getHeaderElement() { + if (this.header == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionChannelComponent.header"); + else if (Configuration.doAutoCreate()) + this.header = new StringType(); + return this.header; + } + + public boolean hasHeaderElement() { + return this.header != null && !this.header.isEmpty(); + } + + public boolean hasHeader() { + return this.header != null && !this.header.isEmpty(); + } + + /** + * @param value {@link #header} (Usage depends on the channel type.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value + */ + public SubscriptionChannelComponent setHeaderElement(StringType value) { + this.header = value; + return this; + } + + /** + * @return Usage depends on the channel type. + */ + public String getHeader() { + return this.header == null ? null : this.header.getValue(); + } + + /** + * @param value Usage depends on the channel type. + */ + public SubscriptionChannelComponent setHeader(String value) { + if (Utilities.noString(value)) + this.header = null; + else { + if (this.header == null) + this.header = new StringType(); + this.header.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Todo.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("url", "uri", "Todo.", 0, java.lang.Integer.MAX_VALUE, url)); + childrenList.add(new Property("payload", "string", "ToDo.", 0, java.lang.Integer.MAX_VALUE, payload)); + childrenList.add(new Property("header", "string", "Usage depends on the channel type.", 0, java.lang.Integer.MAX_VALUE, header)); + } + + public SubscriptionChannelComponent copy() { + SubscriptionChannelComponent dst = new SubscriptionChannelComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.url = url == null ? null : url.copy(); + dst.payload = payload == null ? null : payload.copy(); + dst.header = header == null ? null : header.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) + && (payload == null || payload.isEmpty()) && (header == null || header.isEmpty()); + } + + } + + @Block() + public static class SubscriptionTagComponent extends BackboneElement { + /** + * Todo. + */ + @Child(name="term", type={UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="The term that identifies the tag", formalDefinition="Todo." ) + protected UriType term; + + /** + * Todo. + */ + @Child(name="scheme", type={UriType.class}, order=2, min=1, max=1) + @Description(shortDefinition="The scheme for the tag (kind of tag)", formalDefinition="Todo." ) + protected UriType scheme; + + /** + * Todo. + */ + @Child(name="description", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Tag description label", formalDefinition="Todo." ) + protected StringType description; + + private static final long serialVersionUID = 957833176L; + + public SubscriptionTagComponent() { + super(); + } + + public SubscriptionTagComponent(UriType term, UriType scheme) { + super(); + this.term = term; + this.scheme = scheme; + } + + /** + * @return {@link #term} (Todo.). This is the underlying object with id, value and extensions. The accessor "getTerm" gives direct access to the value + */ + public UriType getTermElement() { + if (this.term == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionTagComponent.term"); + else if (Configuration.doAutoCreate()) + this.term = new UriType(); + return this.term; + } + + public boolean hasTermElement() { + return this.term != null && !this.term.isEmpty(); + } + + public boolean hasTerm() { + return this.term != null && !this.term.isEmpty(); + } + + /** + * @param value {@link #term} (Todo.). This is the underlying object with id, value and extensions. The accessor "getTerm" gives direct access to the value + */ + public SubscriptionTagComponent setTermElement(UriType value) { + this.term = value; + return this; + } + + /** + * @return Todo. + */ + public String getTerm() { + return this.term == null ? null : this.term.getValue(); + } + + /** + * @param value Todo. + */ + public SubscriptionTagComponent setTerm(String value) { + if (this.term == null) + this.term = new UriType(); + this.term.setValue(value); + return this; + } + + /** + * @return {@link #scheme} (Todo.). This is the underlying object with id, value and extensions. The accessor "getScheme" gives direct access to the value + */ + public UriType getSchemeElement() { + if (this.scheme == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubscriptionTagComponent.scheme"); + else if (Configuration.doAutoCreate()) + this.scheme = new UriType(); + return this.scheme; + } + + public boolean hasSchemeElement() { + return this.scheme != null && !this.scheme.isEmpty(); + } + + public boolean hasScheme() { + return this.scheme != null && !this.scheme.isEmpty(); + } + + /** + * @param value {@link #scheme} (Todo.). This is the underlying object with id, value and extensions. The accessor "getScheme" gives direct access to the value + */ + public SubscriptionTagComponent setSchemeElement(UriType value) { + this.scheme = value; + return this; + } + + /** + * @return Todo. + */ + public String getScheme() { + return this.scheme == null ? null : this.scheme.getValue(); + } + + /** + * @param value Todo. + */ + public SubscriptionTagComponent setScheme(String value) { + if (this.scheme == null) + this.scheme = new UriType(); + this.scheme.setValue(value); + return this; + } + + /** + * @return {@link #description} (Todo.). 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 SubscriptionTagComponent.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} (Todo.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public SubscriptionTagComponent setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Todo. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Todo. + */ + public SubscriptionTagComponent setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("term", "uri", "Todo.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("scheme", "uri", "Todo.", 0, java.lang.Integer.MAX_VALUE, scheme)); + childrenList.add(new Property("description", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, description)); + } + + public SubscriptionTagComponent copy() { + SubscriptionTagComponent dst = new SubscriptionTagComponent(); + copyValues(dst); + dst.term = term == null ? null : term.copy(); + dst.scheme = scheme == null ? null : scheme.copy(); + dst.description = description == null ? null : description.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (term == null || term.isEmpty()) && (scheme == null || scheme.isEmpty()) + && (description == null || description.isEmpty()); + } + + } + + /** + * Todo. + */ + @Child(name="criteria", type={StringType.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Rule for server push criteria", formalDefinition="Todo." ) + protected StringType criteria; + + /** + * Todo. + */ + @Child(name="contact", type={ContactPoint.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Todo." ) + protected List contact; + + /** + * Todo. + */ + @Child(name="reason", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Description of why this subscription was created", formalDefinition="Todo." ) + protected StringType reason; + + /** + * Todo. + */ + @Child(name="status", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="requested | active | error | off", formalDefinition="Todo." ) + protected Enumeration status; + + /** + * Todo. + */ + @Child(name="error", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Latest error note", formalDefinition="Todo." ) + protected StringType error; + + /** + * Todo. + */ + @Child(name="channel", type={}, order=4, min=1, max=1) + @Description(shortDefinition="The channel on which to report matches to the criteria", formalDefinition="Todo." ) + protected SubscriptionChannelComponent channel; + + /** + * Todo. + */ + @Child(name="end", type={InstantType.class}, order=5, min=0, max=1) + @Description(shortDefinition="When to automatically delete the subscription", formalDefinition="Todo." ) + protected InstantType end; + + /** + * Todo. + */ + @Child(name="tag", type={}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A tag to add to matching resources", formalDefinition="Todo." ) + protected List tag; + + private static final long serialVersionUID = 68195650L; + + public Subscription() { + super(); + } + + public Subscription(StringType criteria, StringType reason, Enumeration status, SubscriptionChannelComponent channel) { + super(); + this.criteria = criteria; + this.reason = reason; + this.status = status; + this.channel = channel; + } + + /** + * @return {@link #criteria} (Todo.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public StringType getCriteriaElement() { + if (this.criteria == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.criteria"); + else if (Configuration.doAutoCreate()) + this.criteria = new StringType(); + return this.criteria; + } + + public boolean hasCriteriaElement() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + public boolean hasCriteria() { + return this.criteria != null && !this.criteria.isEmpty(); + } + + /** + * @param value {@link #criteria} (Todo.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value + */ + public Subscription setCriteriaElement(StringType value) { + this.criteria = value; + return this; + } + + /** + * @return Todo. + */ + public String getCriteria() { + return this.criteria == null ? null : this.criteria.getValue(); + } + + /** + * @param value Todo. + */ + public Subscription setCriteria(String value) { + if (this.criteria == null) + this.criteria = new StringType(); + this.criteria.setValue(value); + return this; + } + + /** + * @return {@link #contact} (Todo.) + */ + public List getContact() { + if (this.contact == null) + this.contact = new ArrayList(); + return this.contact; + } + + public boolean hasContact() { + if (this.contact == null) + return false; + for (ContactPoint item : this.contact) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contact} (Todo.) + */ + // syntactic sugar + public ContactPoint addContact() { //3 + ContactPoint t = new ContactPoint(); + if (this.contact == null) + this.contact = new ArrayList(); + this.contact.add(t); + return t; + } + + /** + * @return {@link #reason} (Todo.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public StringType getReasonElement() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); + return this.reason; + } + + public boolean hasReasonElement() { + return this.reason != null && !this.reason.isEmpty(); + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Todo.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public Subscription setReasonElement(StringType value) { + this.reason = value; + return this; + } + + /** + * @return Todo. + */ + public String getReason() { + return this.reason == null ? null : this.reason.getValue(); + } + + /** + * @param value Todo. + */ + public Subscription setReason(String value) { + if (this.reason == null) + this.reason = new StringType(); + this.reason.setValue(value); + return this; + } + + /** + * @return {@link #status} (Todo.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Todo.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Subscription setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Todo. + */ + public SubscriptionStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Todo. + */ + public Subscription setStatus(SubscriptionStatus value) { + if (this.status == null) + this.status = new Enumeration(SubscriptionStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #error} (Todo.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value + */ + public StringType getErrorElement() { + if (this.error == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.error"); + else if (Configuration.doAutoCreate()) + this.error = new StringType(); + return this.error; + } + + public boolean hasErrorElement() { + return this.error != null && !this.error.isEmpty(); + } + + public boolean hasError() { + return this.error != null && !this.error.isEmpty(); + } + + /** + * @param value {@link #error} (Todo.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value + */ + public Subscription setErrorElement(StringType value) { + this.error = value; + return this; + } + + /** + * @return Todo. + */ + public String getError() { + return this.error == null ? null : this.error.getValue(); + } + + /** + * @param value Todo. + */ + public Subscription setError(String value) { + if (Utilities.noString(value)) + this.error = null; + else { + if (this.error == null) + this.error = new StringType(); + this.error.setValue(value); + } + return this; + } + + /** + * @return {@link #channel} (Todo.) + */ + public SubscriptionChannelComponent getChannel() { + if (this.channel == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.channel"); + else if (Configuration.doAutoCreate()) + this.channel = new SubscriptionChannelComponent(); + return this.channel; + } + + public boolean hasChannel() { + return this.channel != null && !this.channel.isEmpty(); + } + + /** + * @param value {@link #channel} (Todo.) + */ + public Subscription setChannel(SubscriptionChannelComponent value) { + this.channel = value; + return this; + } + + /** + * @return {@link #end} (Todo.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public InstantType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Subscription.end"); + else if (Configuration.doAutoCreate()) + this.end = new InstantType(); + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (Todo.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public Subscription setEndElement(InstantType value) { + this.end = value; + return this; + } + + /** + * @return Todo. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value Todo. + */ + public Subscription setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new InstantType(); + this.end.setValue(value); + } + return this; + } + + /** + * @return {@link #tag} (Todo.) + */ + public List getTag() { + if (this.tag == null) + this.tag = new ArrayList(); + return this.tag; + } + + public boolean hasTag() { + if (this.tag == null) + return false; + for (SubscriptionTagComponent item : this.tag) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #tag} (Todo.) + */ + // syntactic sugar + public SubscriptionTagComponent addTag() { //3 + SubscriptionTagComponent t = new SubscriptionTagComponent(); + if (this.tag == null) + this.tag = new ArrayList(); + this.tag.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("criteria", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, criteria)); + childrenList.add(new Property("contact", "ContactPoint", "Todo.", 0, java.lang.Integer.MAX_VALUE, contact)); + childrenList.add(new Property("reason", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, reason)); + childrenList.add(new Property("status", "code", "Todo.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("error", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, error)); + childrenList.add(new Property("channel", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, channel)); + childrenList.add(new Property("end", "instant", "Todo.", 0, java.lang.Integer.MAX_VALUE, end)); + childrenList.add(new Property("tag", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, tag)); + } + + public Subscription copy() { + Subscription dst = new Subscription(); + copyValues(dst); + dst.criteria = criteria == null ? null : criteria.copy(); + if (contact != null) { + dst.contact = new ArrayList(); + for (ContactPoint i : contact) + dst.contact.add(i.copy()); + }; + dst.reason = reason == null ? null : reason.copy(); + dst.status = status == null ? null : status.copy(); + dst.error = error == null ? null : error.copy(); + dst.channel = channel == null ? null : channel.copy(); + dst.end = end == null ? null : end.copy(); + if (tag != null) { + dst.tag = new ArrayList(); + for (SubscriptionTagComponent i : tag) + dst.tag.add(i.copy()); + }; + return dst; + } + + protected Subscription typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (criteria == null || criteria.isEmpty()) && (contact == null || contact.isEmpty()) + && (reason == null || reason.isEmpty()) && (status == null || status.isEmpty()) && (error == null || error.isEmpty()) + && (channel == null || channel.isEmpty()) && (end == null || end.isEmpty()) && (tag == null || tag.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Subscription; + } + + @SearchParamDefinition(name="criteria", path="Subscription.criteria", description="Rule for server push criteria", type="string" ) + public static final String SP_CRITERIA = "criteria"; + @SearchParamDefinition(name="status", path="Subscription.status", description="requested | active | error | off", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="tag", path="Subscription.tag.term", description="The term that identifies the tag", type="string" ) + public static final String SP_TAG = "tag"; + @SearchParamDefinition(name="payload", path="Subscription.channel.payload", description="Mimetype to send, or blank for no payload", type="string" ) + public static final String SP_PAYLOAD = "payload"; + @SearchParamDefinition(name="type", path="Subscription.channel.type", description="rest-hook | websocket | email | sms | message", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="contact", path="Subscription.contact", description="Contact details for source (e.g. troubleshooting)", type="token" ) + public static final String SP_CONTACT = "contact"; + @SearchParamDefinition(name="url", path="Subscription.channel.url", description="Where the channel points to", type="string" ) + public static final String SP_URL = "url"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java index 7ec2f3d80e5..d996f8f9b56 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java @@ -20,535 +20,535 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A homogeneous material with a definite composition. - */ -@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") -public class Substance extends DomainResource { - - @Block() - public static class SubstanceInstanceComponent extends BackboneElement { - /** - * Identifier associated with the package/container (usually a label affixed directly). - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) - protected Identifier identifier; - - /** - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - @Child(name="expiry", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." ) - protected DateTimeType expiry; - - /** - * The amount of the substance. - */ - @Child(name="quantity", type={Quantity.class}, order=3, min=0, max=1) - @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) - protected Quantity quantity; - - private static final long serialVersionUID = -1474380480L; - - public SubstanceInstanceComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) - */ - public SubstanceInstanceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public DateTimeType getExpiryElement() { - if (this.expiry == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); - else if (Configuration.doAutoCreate()) - this.expiry = new DateTimeType(); - return this.expiry; - } - - public boolean hasExpiryElement() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - public boolean hasExpiry() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - /** - * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { - this.expiry = value; - return this; - } - - /** - * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - public Date getExpiry() { - return this.expiry == null ? null : this.expiry.getValue(); - } - - /** - * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - public SubstanceInstanceComponent setExpiry(Date value) { - if (value == null) - this.expiry = null; - else { - if (this.expiry == null) - this.expiry = new DateTimeType(); - this.expiry.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The amount of the substance.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the substance.) - */ - public SubstanceInstanceComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); - childrenList.add(new Property("quantity", "Quantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); - } - - public SubstanceInstanceComponent copy() { - SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.expiry = expiry == null ? null : expiry.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (expiry == null || expiry.isEmpty()) - && (quantity == null || quantity.isEmpty()); - } - - } - - @Block() - public static class SubstanceIngredientComponent extends BackboneElement { - /** - * The amount of the ingredient in the substance - a concentration ratio. - */ - @Child(name="quantity", type={Ratio.class}, order=1, min=0, max=1) - @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) - protected Ratio quantity; - - /** - * Another substance that is a component of this substance. - */ - @Child(name="substance", type={Substance.class}, order=2, min=1, max=1) - @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) - protected Reference substance; - - /** - * The actual object that is the target of the reference (Another substance that is a component of this substance.) - */ - protected Substance substanceTarget; - - private static final long serialVersionUID = -1783242034L; - - public SubstanceIngredientComponent() { - super(); - } - - public SubstanceIngredientComponent(Reference substance) { - super(); - this.substance = substance; - } - - /** - * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) - */ - public Ratio getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Ratio(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) - */ - public SubstanceIngredientComponent setQuantity(Ratio value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #substance} (Another substance that is a component of this substance.) - */ - public Reference getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new Reference(); - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Another substance that is a component of this substance.) - */ - public SubstanceIngredientComponent setSubstance(Reference value) { - this.substance = value; - return this; - } - - /** - * @return {@link #substance} 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. (Another substance that is a component of this substance.) - */ - public Substance getSubstanceTarget() { - if (this.substanceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substanceTarget = new Substance(); - return this.substanceTarget; - } - - /** - * @param value {@link #substance} 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. (Another substance that is a component of this substance.) - */ - public SubstanceIngredientComponent setSubstanceTarget(Substance value) { - this.substanceTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("substance", "Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); - } - - public SubstanceIngredientComponent copy() { - SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); - copyValues(dst); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.substance = substance == null ? null : substance.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (quantity == null || quantity.isEmpty()) && (substance == null || substance.isEmpty()) - ; - } - - } - - /** - * A code (or set of codes) that identify this substance. - */ - @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) - @Description(shortDefinition="What kind of substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) - protected CodeableConcept type; - - /** - * A description of the substance - its appearance, handling requirements, and other usage notes. - */ - @Child(name="description", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) - protected StringType description; - - /** - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. - */ - @Child(name="instance", type={}, order=1, min=0, max=1) - @Description(shortDefinition="If this describes a specific package/container of the substance", formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance." ) - protected SubstanceInstanceComponent instance; - - /** - * A substance can be composed of other substances. - */ - @Child(name="ingredient", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) - protected List ingredient; - - private static final long serialVersionUID = 1881086620L; - - public Substance() { - super(); - } - - public Substance(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code (or set of codes) that identify this substance.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code (or set of codes) that identify this substance.) - */ - public Substance setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). 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 Substance.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} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Substance setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the substance - its appearance, handling requirements, and other usage notes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the substance - its appearance, handling requirements, and other usage notes. - */ - public Substance setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) - */ - public SubstanceInstanceComponent getInstance() { - if (this.instance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.instance"); - else if (Configuration.doAutoCreate()) - this.instance = new SubstanceInstanceComponent(); - return this.instance; - } - - public boolean hasInstance() { - return this.instance != null && !this.instance.isEmpty(); - } - - /** - * @param value {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) - */ - public Substance setInstance(SubstanceInstanceComponent value) { - this.instance = value; - return this; - } - - /** - * @return {@link #ingredient} (A substance can be composed of other substances.) - */ - public List getIngredient() { - if (this.ingredient == null) - this.ingredient = new ArrayList(); - return this.ingredient; - } - - public boolean hasIngredient() { - if (this.ingredient == null) - return false; - for (SubstanceIngredientComponent item : this.ingredient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ingredient} (A substance can be composed of other substances.) - */ - // syntactic sugar - public SubstanceIngredientComponent addIngredient() { //3 - SubstanceIngredientComponent t = new SubstanceIngredientComponent(); - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); - childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); - } - - public Substance copy() { - Substance dst = new Substance(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - dst.instance = instance == null ? null : instance.copy(); - if (ingredient != null) { - dst.ingredient = new ArrayList(); - for (SubstanceIngredientComponent i : ingredient) - dst.ingredient.add(i.copy()); - }; - return dst; - } - - protected Substance typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) - && (instance == null || instance.isEmpty()) && (ingredient == null || ingredient.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Substance; - } - - @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference" ) - public static final String SP_SUBSTANCE = "substance"; - @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="number" ) - public static final String SP_QUANTITY = "quantity"; - @SearchParamDefinition(name="type", path="Substance.type", description="The type of the substance", type="token" ) - public static final String SP_TYPE = "type"; - @SearchParamDefinition(name="identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="When no longer valid to use", type="date" ) - public static final String SP_EXPIRY = "expiry"; - -} - + +/* + 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; +/** + * A homogeneous material with a definite composition. + */ +@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") +public class Substance extends DomainResource { + + @Block() + public static class SubstanceInstanceComponent extends BackboneElement { + /** + * Identifier associated with the package/container (usually a label affixed directly). + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) + protected Identifier identifier; + + /** + * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + @Child(name="expiry", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." ) + protected DateTimeType expiry; + + /** + * The amount of the substance. + */ + @Child(name="quantity", type={Quantity.class}, order=3, min=0, max=1) + @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) + protected Quantity quantity; + + private static final long serialVersionUID = -1474380480L; + + public SubstanceInstanceComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) + */ + public SubstanceInstanceComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public DateTimeType getExpiryElement() { + if (this.expiry == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); + else if (Configuration.doAutoCreate()) + this.expiry = new DateTimeType(); + return this.expiry; + } + + public boolean hasExpiryElement() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + public boolean hasExpiry() { + return this.expiry != null && !this.expiry.isEmpty(); + } + + /** + * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value + */ + public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { + this.expiry = value; + return this; + } + + /** + * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + public Date getExpiry() { + return this.expiry == null ? null : this.expiry.getValue(); + } + + /** + * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + */ + public SubstanceInstanceComponent setExpiry(Date value) { + if (value == null) + this.expiry = null; + else { + if (this.expiry == null) + this.expiry = new DateTimeType(); + this.expiry.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The amount of the substance.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the substance.) + */ + public SubstanceInstanceComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); + childrenList.add(new Property("quantity", "Quantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); + } + + public SubstanceInstanceComponent copy() { + SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.expiry = expiry == null ? null : expiry.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (expiry == null || expiry.isEmpty()) + && (quantity == null || quantity.isEmpty()); + } + + } + + @Block() + public static class SubstanceIngredientComponent extends BackboneElement { + /** + * The amount of the ingredient in the substance - a concentration ratio. + */ + @Child(name="quantity", type={Ratio.class}, order=1, min=0, max=1) + @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) + protected Ratio quantity; + + /** + * Another substance that is a component of this substance. + */ + @Child(name="substance", type={Substance.class}, order=2, min=1, max=1) + @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) + protected Reference substance; + + /** + * The actual object that is the target of the reference (Another substance that is a component of this substance.) + */ + protected Substance substanceTarget; + + private static final long serialVersionUID = -1783242034L; + + public SubstanceIngredientComponent() { + super(); + } + + public SubstanceIngredientComponent(Reference substance) { + super(); + this.substance = substance; + } + + /** + * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) + */ + public Ratio getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Ratio(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) + */ + public SubstanceIngredientComponent setQuantity(Ratio value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #substance} (Another substance that is a component of this substance.) + */ + public Reference getSubstance() { + if (this.substance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substance = new Reference(); + return this.substance; + } + + public boolean hasSubstance() { + return this.substance != null && !this.substance.isEmpty(); + } + + /** + * @param value {@link #substance} (Another substance that is a component of this substance.) + */ + public SubstanceIngredientComponent setSubstance(Reference value) { + this.substance = value; + return this; + } + + /** + * @return {@link #substance} 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. (Another substance that is a component of this substance.) + */ + public Substance getSubstanceTarget() { + if (this.substanceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); + else if (Configuration.doAutoCreate()) + this.substanceTarget = new Substance(); + return this.substanceTarget; + } + + /** + * @param value {@link #substance} 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. (Another substance that is a component of this substance.) + */ + public SubstanceIngredientComponent setSubstanceTarget(Substance value) { + this.substanceTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("substance", "Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); + } + + public SubstanceIngredientComponent copy() { + SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); + copyValues(dst); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.substance = substance == null ? null : substance.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (quantity == null || quantity.isEmpty()) && (substance == null || substance.isEmpty()) + ; + } + + } + + /** + * A code (or set of codes) that identify this substance. + */ + @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) + @Description(shortDefinition="What kind of substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) + protected CodeableConcept type; + + /** + * A description of the substance - its appearance, handling requirements, and other usage notes. + */ + @Child(name="description", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) + protected StringType description; + + /** + * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. + */ + @Child(name="instance", type={}, order=1, min=0, max=1) + @Description(shortDefinition="If this describes a specific package/container of the substance", formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance." ) + protected SubstanceInstanceComponent instance; + + /** + * A substance can be composed of other substances. + */ + @Child(name="ingredient", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) + protected List ingredient; + + private static final long serialVersionUID = 1881086620L; + + public Substance() { + super(); + } + + public Substance(CodeableConcept type) { + super(); + this.type = type; + } + + /** + * @return {@link #type} (A code (or set of codes) that identify this substance.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Substance.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (A code (or set of codes) that identify this substance.) + */ + public Substance setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). 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 Substance.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} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Substance setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A description of the substance - its appearance, handling requirements, and other usage notes. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A description of the substance - its appearance, handling requirements, and other usage notes. + */ + public Substance setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) + */ + public SubstanceInstanceComponent getInstance() { + if (this.instance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Substance.instance"); + else if (Configuration.doAutoCreate()) + this.instance = new SubstanceInstanceComponent(); + return this.instance; + } + + public boolean hasInstance() { + return this.instance != null && !this.instance.isEmpty(); + } + + /** + * @param value {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) + */ + public Substance setInstance(SubstanceInstanceComponent value) { + this.instance = value; + return this; + } + + /** + * @return {@link #ingredient} (A substance can be composed of other substances.) + */ + public List getIngredient() { + if (this.ingredient == null) + this.ingredient = new ArrayList(); + return this.ingredient; + } + + public boolean hasIngredient() { + if (this.ingredient == null) + return false; + for (SubstanceIngredientComponent item : this.ingredient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ingredient} (A substance can be composed of other substances.) + */ + // syntactic sugar + public SubstanceIngredientComponent addIngredient() { //3 + SubstanceIngredientComponent t = new SubstanceIngredientComponent(); + if (this.ingredient == null) + this.ingredient = new ArrayList(); + this.ingredient.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); + childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); + } + + public Substance copy() { + Substance dst = new Substance(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.description = description == null ? null : description.copy(); + dst.instance = instance == null ? null : instance.copy(); + if (ingredient != null) { + dst.ingredient = new ArrayList(); + for (SubstanceIngredientComponent i : ingredient) + dst.ingredient.add(i.copy()); + }; + return dst; + } + + protected Substance typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) + && (instance == null || instance.isEmpty()) && (ingredient == null || ingredient.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Substance; + } + + @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference" ) + public static final String SP_SUBSTANCE = "substance"; + @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="number" ) + public static final String SP_QUANTITY = "quantity"; + @SearchParamDefinition(name="type", path="Substance.type", description="The type of the substance", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="When no longer valid to use", type="date" ) + public static final String SP_EXPIRY = "expiry"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java index ebd826258ff..17409860c60 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java @@ -20,1072 +20,1072 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A supply - a request for something, and provision of what is supplied. - */ -@ResourceDef(name="Supply", profile="http://hl7.org/fhir/Profile/Supply") -public class Supply extends DomainResource { - - public enum ValuesetSupplyStatus implements FhirEnum { - /** - * Supply has been requested, but not dispensed. - */ - REQUESTED, - /** - * Supply is part of a pharmacy order and has been dispensed. - */ - DISPENSED, - /** - * Supply has been received by the requestor. - */ - RECEIVED, - /** - * The supply will not be completed because the supplier was unable or unwilling to supply the item. - */ - FAILED, - /** - * The orderer of the supply cancelled the request. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - - public static final ValuesetSupplyStatusEnumFactory ENUM_FACTORY = new ValuesetSupplyStatusEnumFactory(); - - public static ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("dispensed".equals(codeString)) - return DISPENSED; - if ("received".equals(codeString)) - return RECEIVED; - if ("failed".equals(codeString)) - return FAILED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case DISPENSED: return "dispensed"; - case RECEIVED: return "received"; - case FAILED: return "failed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return ""; - case DISPENSED: return ""; - case RECEIVED: return ""; - case FAILED: return ""; - case CANCELLED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "Supply has been requested, but not dispensed."; - case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; - case RECEIVED: return "Supply has been received by the requestor."; - case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; - case CANCELLED: return "The orderer of the supply cancelled the request."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case DISPENSED: return "Dispensed"; - case RECEIVED: return "Received"; - case FAILED: return "Failed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class ValuesetSupplyStatusEnumFactory implements EnumFactory { - public ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return ValuesetSupplyStatus.REQUESTED; - if ("dispensed".equals(codeString)) - return ValuesetSupplyStatus.DISPENSED; - if ("received".equals(codeString)) - return ValuesetSupplyStatus.RECEIVED; - if ("failed".equals(codeString)) - return ValuesetSupplyStatus.FAILED; - if ("cancelled".equals(codeString)) - return ValuesetSupplyStatus.CANCELLED; - throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); - } - public String toCode(ValuesetSupplyStatus code) throws IllegalArgumentException { - if (code == ValuesetSupplyStatus.REQUESTED) - return "requested"; - if (code == ValuesetSupplyStatus.DISPENSED) - return "dispensed"; - if (code == ValuesetSupplyStatus.RECEIVED) - return "received"; - if (code == ValuesetSupplyStatus.FAILED) - return "failed"; - if (code == ValuesetSupplyStatus.CANCELLED) - return "cancelled"; - return "?"; - } - } - - public enum ValuesetSupplyDispenseStatus implements FhirEnum { - /** - * Supply has been requested, but not dispensed. - */ - INPROGRESS, - /** - * Supply is part of a pharmacy order and has been dispensed. - */ - DISPENSED, - /** - * Dispensing was not completed. - */ - ABANDONED, - /** - * added to help the parsers - */ - NULL; - - public static final ValuesetSupplyDispenseStatusEnumFactory ENUM_FACTORY = new ValuesetSupplyDispenseStatusEnumFactory(); - - public static ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in progress".equals(codeString)) - return INPROGRESS; - if ("dispensed".equals(codeString)) - return DISPENSED; - if ("abandoned".equals(codeString)) - return ABANDONED; - throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case INPROGRESS: return "in progress"; - case DISPENSED: return "dispensed"; - case ABANDONED: return "abandoned"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return ""; - case DISPENSED: return ""; - case ABANDONED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "Supply has been requested, but not dispensed."; - case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; - case ABANDONED: return "Dispensing was not completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case DISPENSED: return "Dispensed"; - case ABANDONED: return "Abandoned"; - default: return "?"; - } - } - } - - public static class ValuesetSupplyDispenseStatusEnumFactory implements EnumFactory { - public ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in progress".equals(codeString)) - return ValuesetSupplyDispenseStatus.INPROGRESS; - if ("dispensed".equals(codeString)) - return ValuesetSupplyDispenseStatus.DISPENSED; - if ("abandoned".equals(codeString)) - return ValuesetSupplyDispenseStatus.ABANDONED; - throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); - } - public String toCode(ValuesetSupplyDispenseStatus code) throws IllegalArgumentException { - if (code == ValuesetSupplyDispenseStatus.INPROGRESS) - return "in progress"; - if (code == ValuesetSupplyDispenseStatus.DISPENSED) - return "dispensed"; - if (code == ValuesetSupplyDispenseStatus.ABANDONED) - return "abandoned"; - return "?"; - } - } - - @Block() - public static class SupplyDispenseComponent extends BackboneElement { - /** - * Identifier assigned by the dispensing facility when the dispense occurs. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the dispense occurs." ) - protected Identifier identifier; - - /** - * A code specifying the state of the dispense event. - */ - @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="in progress | dispensed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) - protected Enumeration status; - - /** - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) - protected CodeableConcept type; - - /** - * The amount of supply that has been dispensed. Includes unit of measure. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) - protected Quantity quantity; - - /** - * Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. - */ - @Child(name="suppliedItem", type={Medication.class, Substance.class, Device.class}, order=5, min=0, max=1) - @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) - protected Reference suppliedItem; - - /** - * The actual object that is the target of the reference (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - protected Resource suppliedItemTarget; - - /** - * The individual responsible for dispensing the medication, supplier or device. - */ - @Child(name="supplier", type={Practitioner.class}, order=6, min=0, max=1) - @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) - protected Reference supplier; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) - */ - protected Practitioner supplierTarget; - - /** - * The time the dispense event occurred. - */ - @Child(name="whenPrepared", type={Period.class}, order=7, min=0, max=1) - @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) - protected Period whenPrepared; - - /** - * The time the dispensed item was sent or handed to the patient (or agent). - */ - @Child(name="whenHandedOver", type={Period.class}, order=8, min=0, max=1) - @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) - protected Period whenHandedOver; - - /** - * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. - */ - @Child(name="destination", type={Location.class}, order=9, min=0, max=1) - @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the Supply. - */ - @Child(name="receiver", type={Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) - */ - protected List receiverTarget; - - - private static final long serialVersionUID = 1089359939L; - - public SupplyDispenseComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility when the dispense occurs.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the dispense occurs.) - */ - public SupplyDispenseComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SupplyDispenseComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the dispense event. - */ - public ValuesetSupplyDispenseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the dispense event. - */ - public SupplyDispenseComponent setStatus(ValuesetSupplyDispenseStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(ValuesetSupplyDispenseStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public SupplyDispenseComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public SupplyDispenseComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Reference getSuppliedItem() { - if (this.suppliedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.suppliedItem"); - else if (Configuration.doAutoCreate()) - this.suppliedItem = new Reference(); - return this.suppliedItem; - } - - public boolean hasSuppliedItem() { - return this.suppliedItem != null && !this.suppliedItem.isEmpty(); - } - - /** - * @param value {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDispenseComponent setSuppliedItem(Reference value) { - this.suppliedItem = value; - return this; - } - - /** - * @return {@link #suppliedItem} 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 medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Resource getSuppliedItemTarget() { - return this.suppliedItemTarget; - } - - /** - * @param value {@link #suppliedItem} 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 medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDispenseComponent setSuppliedItemTarget(Resource value) { - this.suppliedItemTarget = value; - return this; - } - - /** - * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public Reference getSupplier() { - if (this.supplier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); - else if (Configuration.doAutoCreate()) - this.supplier = new Reference(); - return this.supplier; - } - - public boolean hasSupplier() { - return this.supplier != null && !this.supplier.isEmpty(); - } - - /** - * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDispenseComponent setSupplier(Reference value) { - this.supplier = value; - return this; - } - - /** - * @return {@link #supplier} 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 individual responsible for dispensing the medication, supplier or device.) - */ - public Practitioner getSupplierTarget() { - if (this.supplierTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); - else if (Configuration.doAutoCreate()) - this.supplierTarget = new Practitioner(); - return this.supplierTarget; - } - - /** - * @param value {@link #supplier} 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 individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDispenseComponent setSupplierTarget(Practitioner value) { - this.supplierTarget = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time the dispense event occurred.) - */ - public Period getWhenPrepared() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new Period(); - return this.whenPrepared; - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time the dispense event occurred.) - */ - public SupplyDispenseComponent setWhenPrepared(Period value) { - this.whenPrepared = value; - return this; - } - - /** - * @return {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).) - */ - public Period getWhenHandedOver() { - if (this.whenHandedOver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.whenHandedOver"); - else if (Configuration.doAutoCreate()) - this.whenHandedOver = new Period(); - return this.whenHandedOver; - } - - public boolean hasWhenHandedOver() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - /** - * @param value {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).) - */ - public SupplyDispenseComponent setWhenHandedOver(Period value) { - this.whenHandedOver = value; - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDispenseComponent setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} 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. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); - return this.destinationTarget; - } - - /** - * @param value {@link #destination} 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. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDispenseComponent setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - /** - * @return {@link #receiver} (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 person who picked up the Supply.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - // syntactic sugar - /** - * @return {@link #receiver} (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 person who picked up the Supply.) - */ - public Practitioner addReceiverTarget() { - Practitioner r = new Practitioner(); - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - this.receiverTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the dispense occurs.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); - childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); - childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("whenHandedOver", "Period", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); - } - - public SupplyDispenseComponent copy() { - SupplyDispenseComponent dst = new SupplyDispenseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); - dst.supplier = supplier == null ? null : supplier.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (suppliedItem == null || suppliedItem.isEmpty()) - && (supplier == null || supplier.isEmpty()) && (whenPrepared == null || whenPrepared.isEmpty()) - && (whenHandedOver == null || whenHandedOver.isEmpty()) && (destination == null || destination.isEmpty()) - && (receiver == null || receiver.isEmpty()); - } - - } - - /** - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. - */ - @Child(name="kind", type={CodeableConcept.class}, order=-1, min=0, max=1) - @Description(shortDefinition="The kind of supply (central, non-stock, etc)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) - protected CodeableConcept kind; - - /** - * Unique identifier for this supply request. - */ - @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=1) - @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) - protected Identifier identifier; - - /** - * Status of the supply request. - */ - @Child(name="status", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="requested | dispensed | received | failed | cancelled", formalDefinition="Status of the supply request." ) - protected Enumeration status; - - /** - * The item that is requested to be supplied. - */ - @Child(name="orderedItem", type={Medication.class, Substance.class, Device.class}, order=2, min=0, max=1) - @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) - protected Reference orderedItem; - - /** - * The actual object that is the target of the reference (The item that is requested to be supplied.) - */ - protected Resource orderedItemTarget; - - /** - * A link to a resource representing the person whom the ordered item is for. - */ - @Child(name="patient", type={Patient.class}, order=3, min=0, max=1) - @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) - */ - protected Patient patientTarget; - - /** - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - */ - @Child(name="dispense", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supply details", formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed." ) - protected List dispense; - - private static final long serialVersionUID = 1122115505L; - - public Supply() { - super(); - } - - /** - * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public CodeableConcept getKind() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new CodeableConcept(); - return this.kind; - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public Supply setKind(CodeableConcept value) { - this.kind = value; - return this; - } - - /** - * @return {@link #identifier} (Unique identifier for this supply request.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this supply request.) - */ - public Supply setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Supply setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Status of the supply request. - */ - public ValuesetSupplyStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Status of the supply request. - */ - public Supply setStatus(ValuesetSupplyStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(ValuesetSupplyStatus.ENUM_FACTORY); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #orderedItem} (The item that is requested to be supplied.) - */ - public Reference getOrderedItem() { - if (this.orderedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.orderedItem"); - else if (Configuration.doAutoCreate()) - this.orderedItem = new Reference(); - return this.orderedItem; - } - - public boolean hasOrderedItem() { - return this.orderedItem != null && !this.orderedItem.isEmpty(); - } - - /** - * @param value {@link #orderedItem} (The item that is requested to be supplied.) - */ - public Supply setOrderedItem(Reference value) { - this.orderedItem = value; - return this; - } - - /** - * @return {@link #orderedItem} 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 item that is requested to be supplied.) - */ - public Resource getOrderedItemTarget() { - return this.orderedItemTarget; - } - - /** - * @param value {@link #orderedItem} 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 item that is requested to be supplied.) - */ - public Supply setOrderedItemTarget(Resource value) { - this.orderedItemTarget = value; - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.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} (A link to a resource representing the person whom the ordered item is for.) - */ - public Supply 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. (A link to a resource representing the person whom the ordered item is for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Supply.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. (A link to a resource representing the person whom the ordered item is for.) - */ - public Supply setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) - */ - public List getDispense() { - if (this.dispense == null) - this.dispense = new ArrayList(); - return this.dispense; - } - - public boolean hasDispense() { - if (this.dispense == null) - return false; - for (SupplyDispenseComponent item : this.dispense) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) - */ - // syntactic sugar - public SupplyDispenseComponent addDispense() { //3 - SupplyDispenseComponent t = new SupplyDispenseComponent(); - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("dispense", "", "Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.", 0, java.lang.Integer.MAX_VALUE, dispense)); - } - - public Supply copy() { - Supply dst = new Supply(); - copyValues(dst); - dst.kind = kind == null ? null : kind.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); - dst.patient = patient == null ? null : patient.copy(); - if (dispense != null) { - dst.dispense = new ArrayList(); - for (SupplyDispenseComponent i : dispense) - dst.dispense.add(i.copy()); - }; - return dst; - } - - protected Supply typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (kind == null || kind.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (status == null || status.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) - && (patient == null || patient.isEmpty()) && (dispense == null || dispense.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Supply; - } - - @SearchParamDefinition(name="patient", path="Supply.patient", description="Patient for whom the item is supplied", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="status", path="Supply.status", description="requested | dispensed | received | failed | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="dispenseid", path="Supply.dispense.identifier", description="External identifier", type="token" ) - public static final String SP_DISPENSEID = "dispenseid"; - @SearchParamDefinition(name="identifier", path="Supply.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="supplier", path="Supply.dispense.supplier", description="Dispenser", type="reference" ) - public static final String SP_SUPPLIER = "supplier"; - @SearchParamDefinition(name="kind", path="Supply.kind", description="The kind of supply (central, non-stock, etc)", type="token" ) - public static final String SP_KIND = "kind"; - @SearchParamDefinition(name="dispensestatus", path="Supply.dispense.status", description="in progress | dispensed | abandoned", type="token" ) - public static final String SP_DISPENSESTATUS = "dispensestatus"; - -} - + +/* + 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; +/** + * A supply - a request for something, and provision of what is supplied. + */ +@ResourceDef(name="Supply", profile="http://hl7.org/fhir/Profile/Supply") +public class Supply extends DomainResource { + + public enum ValuesetSupplyStatus implements FhirEnum { + /** + * Supply has been requested, but not dispensed. + */ + REQUESTED, + /** + * Supply is part of a pharmacy order and has been dispensed. + */ + DISPENSED, + /** + * Supply has been received by the requestor. + */ + RECEIVED, + /** + * The supply will not be completed because the supplier was unable or unwilling to supply the item. + */ + FAILED, + /** + * The orderer of the supply cancelled the request. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + public static final ValuesetSupplyStatusEnumFactory ENUM_FACTORY = new ValuesetSupplyStatusEnumFactory(); + + public static ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return REQUESTED; + if ("dispensed".equals(codeString)) + return DISPENSED; + if ("received".equals(codeString)) + return RECEIVED; + if ("failed".equals(codeString)) + return FAILED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case REQUESTED: return "requested"; + case DISPENSED: return "dispensed"; + case RECEIVED: return "received"; + case FAILED: return "failed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case REQUESTED: return ""; + case DISPENSED: return ""; + case RECEIVED: return ""; + case FAILED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case REQUESTED: return "Supply has been requested, but not dispensed."; + case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; + case RECEIVED: return "Supply has been received by the requestor."; + case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; + case CANCELLED: return "The orderer of the supply cancelled the request."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case REQUESTED: return "Requested"; + case DISPENSED: return "Dispensed"; + case RECEIVED: return "Received"; + case FAILED: return "Failed"; + case CANCELLED: return "Cancelled"; + default: return "?"; + } + } + } + + public static class ValuesetSupplyStatusEnumFactory implements EnumFactory { + public ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("requested".equals(codeString)) + return ValuesetSupplyStatus.REQUESTED; + if ("dispensed".equals(codeString)) + return ValuesetSupplyStatus.DISPENSED; + if ("received".equals(codeString)) + return ValuesetSupplyStatus.RECEIVED; + if ("failed".equals(codeString)) + return ValuesetSupplyStatus.FAILED; + if ("cancelled".equals(codeString)) + return ValuesetSupplyStatus.CANCELLED; + throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); + } + public String toCode(ValuesetSupplyStatus code) throws IllegalArgumentException { + if (code == ValuesetSupplyStatus.REQUESTED) + return "requested"; + if (code == ValuesetSupplyStatus.DISPENSED) + return "dispensed"; + if (code == ValuesetSupplyStatus.RECEIVED) + return "received"; + if (code == ValuesetSupplyStatus.FAILED) + return "failed"; + if (code == ValuesetSupplyStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum ValuesetSupplyDispenseStatus implements FhirEnum { + /** + * Supply has been requested, but not dispensed. + */ + INPROGRESS, + /** + * Supply is part of a pharmacy order and has been dispensed. + */ + DISPENSED, + /** + * Dispensing was not completed. + */ + ABANDONED, + /** + * added to help the parsers + */ + NULL; + + public static final ValuesetSupplyDispenseStatusEnumFactory ENUM_FACTORY = new ValuesetSupplyDispenseStatusEnumFactory(); + + public static ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("dispensed".equals(codeString)) + return DISPENSED; + if ("abandoned".equals(codeString)) + return ABANDONED; + throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case DISPENSED: return "dispensed"; + case ABANDONED: return "abandoned"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case DISPENSED: return ""; + case ABANDONED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "Supply has been requested, but not dispensed."; + case DISPENSED: return "Supply is part of a pharmacy order and has been dispensed."; + case ABANDONED: return "Dispensing was not completed."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "In Progress"; + case DISPENSED: return "Dispensed"; + case ABANDONED: return "Abandoned"; + default: return "?"; + } + } + } + + public static class ValuesetSupplyDispenseStatusEnumFactory implements EnumFactory { + public ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return ValuesetSupplyDispenseStatus.INPROGRESS; + if ("dispensed".equals(codeString)) + return ValuesetSupplyDispenseStatus.DISPENSED; + if ("abandoned".equals(codeString)) + return ValuesetSupplyDispenseStatus.ABANDONED; + throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); + } + public String toCode(ValuesetSupplyDispenseStatus code) throws IllegalArgumentException { + if (code == ValuesetSupplyDispenseStatus.INPROGRESS) + return "in progress"; + if (code == ValuesetSupplyDispenseStatus.DISPENSED) + return "dispensed"; + if (code == ValuesetSupplyDispenseStatus.ABANDONED) + return "abandoned"; + return "?"; + } + } + + @Block() + public static class SupplyDispenseComponent extends BackboneElement { + /** + * Identifier assigned by the dispensing facility when the dispense occurs. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the dispense occurs." ) + protected Identifier identifier; + + /** + * A code specifying the state of the dispense event. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="in progress | dispensed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) + protected Enumeration status; + + /** + * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + */ + @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) + @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) + protected CodeableConcept type; + + /** + * The amount of supply that has been dispensed. Includes unit of measure. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) + protected Quantity quantity; + + /** + * Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. + */ + @Child(name="suppliedItem", type={Medication.class, Substance.class, Device.class}, order=5, min=0, max=1) + @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) + protected Reference suppliedItem; + + /** + * The actual object that is the target of the reference (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + protected Resource suppliedItemTarget; + + /** + * The individual responsible for dispensing the medication, supplier or device. + */ + @Child(name="supplier", type={Practitioner.class}, order=6, min=0, max=1) + @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) + protected Reference supplier; + + /** + * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) + */ + protected Practitioner supplierTarget; + + /** + * The time the dispense event occurred. + */ + @Child(name="whenPrepared", type={Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) + protected Period whenPrepared; + + /** + * The time the dispensed item was sent or handed to the patient (or agent). + */ + @Child(name="whenHandedOver", type={Period.class}, order=8, min=0, max=1) + @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) + protected Period whenHandedOver; + + /** + * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. + */ + @Child(name="destination", type={Location.class}, order=9, min=0, max=1) + @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." ) + protected Reference destination; + + /** + * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + protected Location destinationTarget; + + /** + * Identifies the person who picked up the Supply. + */ + @Child(name="receiver", type={Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) + protected List receiver; + /** + * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) + */ + protected List receiverTarget; + + + private static final long serialVersionUID = 1089359939L; + + public SupplyDispenseComponent() { + super(); + } + + /** + * @return {@link #identifier} (Identifier assigned by the dispensing facility when the dispense occurs.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the dispense occurs.) + */ + public SupplyDispenseComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public SupplyDispenseComponent setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return A code specifying the state of the dispense event. + */ + public ValuesetSupplyDispenseStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value A code specifying the state of the dispense event. + */ + public SupplyDispenseComponent setStatus(ValuesetSupplyDispenseStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(ValuesetSupplyDispenseStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) + */ + public SupplyDispenseComponent setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) + */ + public SupplyDispenseComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Reference getSuppliedItem() { + if (this.suppliedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.suppliedItem"); + else if (Configuration.doAutoCreate()) + this.suppliedItem = new Reference(); + return this.suppliedItem; + } + + public boolean hasSuppliedItem() { + return this.suppliedItem != null && !this.suppliedItem.isEmpty(); + } + + /** + * @param value {@link #suppliedItem} (Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDispenseComponent setSuppliedItem(Reference value) { + this.suppliedItem = value; + return this; + } + + /** + * @return {@link #suppliedItem} 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 medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public Resource getSuppliedItemTarget() { + return this.suppliedItemTarget; + } + + /** + * @param value {@link #suppliedItem} 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 medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) + */ + public SupplyDispenseComponent setSuppliedItemTarget(Resource value) { + this.suppliedItemTarget = value; + return this; + } + + /** + * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public Reference getSupplier() { + if (this.supplier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); + else if (Configuration.doAutoCreate()) + this.supplier = new Reference(); + return this.supplier; + } + + public boolean hasSupplier() { + return this.supplier != null && !this.supplier.isEmpty(); + } + + /** + * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDispenseComponent setSupplier(Reference value) { + this.supplier = value; + return this; + } + + /** + * @return {@link #supplier} 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 individual responsible for dispensing the medication, supplier or device.) + */ + public Practitioner getSupplierTarget() { + if (this.supplierTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.supplier"); + else if (Configuration.doAutoCreate()) + this.supplierTarget = new Practitioner(); + return this.supplierTarget; + } + + /** + * @param value {@link #supplier} 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 individual responsible for dispensing the medication, supplier or device.) + */ + public SupplyDispenseComponent setSupplierTarget(Practitioner value) { + this.supplierTarget = value; + return this; + } + + /** + * @return {@link #whenPrepared} (The time the dispense event occurred.) + */ + public Period getWhenPrepared() { + if (this.whenPrepared == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.whenPrepared"); + else if (Configuration.doAutoCreate()) + this.whenPrepared = new Period(); + return this.whenPrepared; + } + + public boolean hasWhenPrepared() { + return this.whenPrepared != null && !this.whenPrepared.isEmpty(); + } + + /** + * @param value {@link #whenPrepared} (The time the dispense event occurred.) + */ + public SupplyDispenseComponent setWhenPrepared(Period value) { + this.whenPrepared = value; + return this; + } + + /** + * @return {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).) + */ + public Period getWhenHandedOver() { + if (this.whenHandedOver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.whenHandedOver"); + else if (Configuration.doAutoCreate()) + this.whenHandedOver = new Period(); + return this.whenHandedOver; + } + + public boolean hasWhenHandedOver() { + return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); + } + + /** + * @param value {@link #whenHandedOver} (The time the dispensed item was sent or handed to the patient (or agent).) + */ + public SupplyDispenseComponent setWhenHandedOver(Period value) { + this.whenHandedOver = value; + return this; + } + + /** + * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Reference getDestination() { + if (this.destination == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destination = new Reference(); + return this.destination; + } + + public boolean hasDestination() { + return this.destination != null && !this.destination.isEmpty(); + } + + /** + * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDispenseComponent setDestination(Reference value) { + this.destination = value; + return this; + } + + /** + * @return {@link #destination} 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. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public Location getDestinationTarget() { + if (this.destinationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupplyDispenseComponent.destination"); + else if (Configuration.doAutoCreate()) + this.destinationTarget = new Location(); + return this.destinationTarget; + } + + /** + * @param value {@link #destination} 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. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) + */ + public SupplyDispenseComponent setDestinationTarget(Location value) { + this.destinationTarget = value; + return this; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + public List getReceiver() { + if (this.receiver == null) + this.receiver = new ArrayList(); + return this.receiver; + } + + public boolean hasReceiver() { + if (this.receiver == null) + return false; + for (Reference item : this.receiver) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #receiver} (Identifies the person who picked up the Supply.) + */ + // syntactic sugar + public Reference addReceiver() { //3 + Reference t = new Reference(); + if (this.receiver == null) + this.receiver = new ArrayList(); + this.receiver.add(t); + return t; + } + + /** + * @return {@link #receiver} (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 person who picked up the Supply.) + */ + public List getReceiverTarget() { + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + return this.receiverTarget; + } + + // syntactic sugar + /** + * @return {@link #receiver} (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 person who picked up the Supply.) + */ + public Practitioner addReceiverTarget() { + Practitioner r = new Practitioner(); + if (this.receiverTarget == null) + this.receiverTarget = new ArrayList(); + this.receiverTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the dispense occurs.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); + childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); + childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); + childrenList.add(new Property("whenHandedOver", "Period", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); + childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); + childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); + } + + public SupplyDispenseComponent copy() { + SupplyDispenseComponent dst = new SupplyDispenseComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.type = type == null ? null : type.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); + dst.supplier = supplier == null ? null : supplier.copy(); + dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); + dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); + dst.destination = destination == null ? null : destination.copy(); + if (receiver != null) { + dst.receiver = new ArrayList(); + for (Reference i : receiver) + dst.receiver.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) + && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (suppliedItem == null || suppliedItem.isEmpty()) + && (supplier == null || supplier.isEmpty()) && (whenPrepared == null || whenPrepared.isEmpty()) + && (whenHandedOver == null || whenHandedOver.isEmpty()) && (destination == null || destination.isEmpty()) + && (receiver == null || receiver.isEmpty()); + } + + } + + /** + * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. + */ + @Child(name="kind", type={CodeableConcept.class}, order=-1, min=0, max=1) + @Description(shortDefinition="The kind of supply (central, non-stock, etc)", formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process." ) + protected CodeableConcept kind; + + /** + * Unique identifier for this supply request. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=0, max=1) + @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) + protected Identifier identifier; + + /** + * Status of the supply request. + */ + @Child(name="status", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="requested | dispensed | received | failed | cancelled", formalDefinition="Status of the supply request." ) + protected Enumeration status; + + /** + * The item that is requested to be supplied. + */ + @Child(name="orderedItem", type={Medication.class, Substance.class, Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) + protected Reference orderedItem; + + /** + * The actual object that is the target of the reference (The item that is requested to be supplied.) + */ + protected Resource orderedItemTarget; + + /** + * A link to a resource representing the person whom the ordered item is for. + */ + @Child(name="patient", type={Patient.class}, order=3, min=0, max=1) + @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) + */ + protected Patient patientTarget; + + /** + * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. + */ + @Child(name="dispense", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supply details", formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed." ) + protected List dispense; + + private static final long serialVersionUID = 1122115505L; + + public Supply() { + super(); + } + + /** + * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public CodeableConcept getKind() { + if (this.kind == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.kind"); + else if (Configuration.doAutoCreate()) + this.kind = new CodeableConcept(); + return this.kind; + } + + public boolean hasKind() { + return this.kind != null && !this.kind.isEmpty(); + } + + /** + * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) + */ + public Supply setKind(CodeableConcept value) { + this.kind = value; + return this; + } + + /** + * @return {@link #identifier} (Unique identifier for this supply request.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Unique identifier for this supply request.) + */ + public Supply setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Supply setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Status of the supply request. + */ + public ValuesetSupplyStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Status of the supply request. + */ + public Supply setStatus(ValuesetSupplyStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(ValuesetSupplyStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #orderedItem} (The item that is requested to be supplied.) + */ + public Reference getOrderedItem() { + if (this.orderedItem == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.orderedItem"); + else if (Configuration.doAutoCreate()) + this.orderedItem = new Reference(); + return this.orderedItem; + } + + public boolean hasOrderedItem() { + return this.orderedItem != null && !this.orderedItem.isEmpty(); + } + + /** + * @param value {@link #orderedItem} (The item that is requested to be supplied.) + */ + public Supply setOrderedItem(Reference value) { + this.orderedItem = value; + return this; + } + + /** + * @return {@link #orderedItem} 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 item that is requested to be supplied.) + */ + public Resource getOrderedItemTarget() { + return this.orderedItemTarget; + } + + /** + * @param value {@link #orderedItem} 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 item that is requested to be supplied.) + */ + public Supply setOrderedItemTarget(Resource value) { + this.orderedItemTarget = value; + return this; + } + + /** + * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.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} (A link to a resource representing the person whom the ordered item is for.) + */ + public Supply 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. (A link to a resource representing the person whom the ordered item is for.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Supply.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. (A link to a resource representing the person whom the ordered item is for.) + */ + public Supply setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) + */ + public List getDispense() { + if (this.dispense == null) + this.dispense = new ArrayList(); + return this.dispense; + } + + public boolean hasDispense() { + if (this.dispense == null) + return false; + for (SupplyDispenseComponent item : this.dispense) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #dispense} (Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.) + */ + // syntactic sugar + public SupplyDispenseComponent addDispense() { //3 + SupplyDispenseComponent t = new SupplyDispenseComponent(); + if (this.dispense == null) + this.dispense = new ArrayList(); + this.dispense.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); + childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); + childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("dispense", "", "Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed.", 0, java.lang.Integer.MAX_VALUE, dispense)); + } + + public Supply copy() { + Supply dst = new Supply(); + copyValues(dst); + dst.kind = kind == null ? null : kind.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.status = status == null ? null : status.copy(); + dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); + dst.patient = patient == null ? null : patient.copy(); + if (dispense != null) { + dst.dispense = new ArrayList(); + for (SupplyDispenseComponent i : dispense) + dst.dispense.add(i.copy()); + }; + return dst; + } + + protected Supply typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (kind == null || kind.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (status == null || status.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) + && (patient == null || patient.isEmpty()) && (dispense == null || dispense.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Supply; + } + + @SearchParamDefinition(name="patient", path="Supply.patient", description="Patient for whom the item is supplied", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="Supply.status", description="requested | dispensed | received | failed | cancelled", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="dispenseid", path="Supply.dispense.identifier", description="External identifier", type="token" ) + public static final String SP_DISPENSEID = "dispenseid"; + @SearchParamDefinition(name="identifier", path="Supply.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="supplier", path="Supply.dispense.supplier", description="Dispenser", type="reference" ) + public static final String SP_SUPPLIER = "supplier"; + @SearchParamDefinition(name="kind", path="Supply.kind", description="The kind of supply (central, non-stock, etc)", type="token" ) + public static final String SP_KIND = "kind"; + @SearchParamDefinition(name="dispensestatus", path="Supply.dispense.status", description="in progress | dispensed | abandoned", type="token" ) + public static final String SP_DISPENSESTATUS = "dispensestatus"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java index 255d1dbdcda..49fb097fa19 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java @@ -20,882 +20,882 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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.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; -/** - * This resource provides the supporting information for a process, for example clinical or financial information related to a claim or pre-authorization. - */ -@ResourceDef(name="SupportingDocumentation", profile="http://hl7.org/fhir/Profile/SupportingDocumentation") -public class SupportingDocumentation extends DomainResource { - - @Block() - public static class SupportingDocumentationDetailComponent extends BackboneElement { - /** - * A link Id for the response to reference. - */ - @Child(name="linkId", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="LinkId", formalDefinition="A link Id for the response to reference." ) - protected IntegerType linkId; - - /** - * The attached content. - */ - @Child(name="content", type={Attachment.class}, order=2, min=1, max=1) - @Description(shortDefinition="Content", formalDefinition="The attached content." ) - protected Type content; - - /** - * The date and optionally time when the material was created. - */ - @Child(name="dateTime", type={DateTimeType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Creation date and time", formalDefinition="The date and optionally time when the material was created." ) - protected DateTimeType dateTime; - - private static final long serialVersionUID = -132176946L; - - public SupportingDocumentationDetailComponent() { - super(); - } - - public SupportingDocumentationDetailComponent(IntegerType linkId, Type content) { - super(); - this.linkId = linkId; - this.content = content; - } - - /** - * @return {@link #linkId} (A link Id for the response to reference.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public IntegerType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentationDetailComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new IntegerType(); - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (A link Id for the response to reference.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public SupportingDocumentationDetailComponent setLinkIdElement(IntegerType value) { - this.linkId = value; - return this; - } - - /** - * @return A link Id for the response to reference. - */ - public int getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value A link Id for the response to reference. - */ - public SupportingDocumentationDetailComponent setLinkId(int value) { - if (this.linkId == null) - this.linkId = new IntegerType(); - this.linkId.setValue(value); - return this; - } - - /** - * @return {@link #content} (The attached content.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (The attached content.) - */ - 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; - } - - /** - * @return {@link #content} (The attached content.) - */ - 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; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The attached content.) - */ - public SupportingDocumentationDetailComponent setContent(Type value) { - this.content = value; - return this; - } - - /** - * @return {@link #dateTime} (The date and optionally time when the material was created.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentationDetailComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date and optionally time when the material was created.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public SupportingDocumentationDetailComponent setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date and optionally time when the material was created. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date and optionally time when the material was created. - */ - public SupportingDocumentationDetailComponent setDateTime(Date value) { - if (value == null) - this.dateTime = null; - else { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "integer", "A link Id for the response to reference.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("content[x]", "Reference(Any)|Attachment", "The attached content.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("dateTime", "dateTime", "The date and optionally time when the material was created.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - } - - public SupportingDocumentationDetailComponent copy() { - SupportingDocumentationDetailComponent dst = new SupportingDocumentationDetailComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.content = content == null ? null : content.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (content == null || content.isEmpty()) - && (dateTime == null || dateTime.isEmpty()); - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @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 DateTimeType created; - - /** - * The Insurer, organization or Provider who is target of the submission. - */ - @Child(name="target", type={Organization.class, Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer or Provider", formalDefinition="The Insurer, organization or Provider who is target of the submission." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer, organization or Provider who is target of the submission.) - */ - protected Resource targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Original request identifer. - */ - @Child(name="request", type={}, order=6, min=0, max=1) - @Description(shortDefinition="Request reference", formalDefinition="Original request identifer." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request identifer.) - */ - protected Resource requestTarget; - - /** - * Original response identifer. - */ - @Child(name="response", type={}, order=7, min=0, max=1) - @Description(shortDefinition="Response reference", formalDefinition="Original response identifer." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Original response identifer.) - */ - protected Resource responseTarget; - - /** - * Person who created the submission. - */ - @Child(name="author", type={Practitioner.class}, order=8, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the submission." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Person who created the submission.) - */ - protected Practitioner authorTarget; - - /** - * The patient who is directly or indirectly the subject of the supporting information. - */ - @Child(name="subject", type={Patient.class}, order=9, min=0, max=1) - @Description(shortDefinition="Patient", formalDefinition="The patient who is directly or indirectly the subject of the supporting information." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who is directly or indirectly the subject of the supporting information.) - */ - protected Patient subjectTarget; - - /** - * Supporting Files. - */ - @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Supporting Files", formalDefinition="Supporting Files." ) - protected List detail; - - private static final long serialVersionUID = -1353519836L; - - public SupportingDocumentation() { - super(); - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @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 SupportingDocumentation setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public SupportingDocumentation setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 SupportingDocumentation setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public SupportingDocumentation setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer, organization or Provider who is target of the submission.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer, organization or Provider who is target of the submission.) - */ - public SupportingDocumentation setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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 Insurer, organization or Provider who is target of the submission.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @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, organization or Provider who is target of the submission.) - */ - public SupportingDocumentation setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public SupportingDocumentation setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 SupportingDocumentation setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public SupportingDocumentation setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 SupportingDocumentation setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #request} (Original request identifer.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request identifer.) - */ - public SupportingDocumentation setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @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 identifer.) - */ - public Resource getRequestTarget() { - 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 identifer.) - */ - public SupportingDocumentation setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Original response identifer.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Original response identifer.) - */ - public SupportingDocumentation setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} 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 response identifer.) - */ - public Resource getResponseTarget() { - return this.responseTarget; - } - - /** - * @param value {@link #response} 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 response identifer.) - */ - public SupportingDocumentation setResponseTarget(Resource value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #author} (Person who created the submission.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Person who created the submission.) - */ - public SupportingDocumentation setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the submission.) - */ - public Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the submission.) - */ - public SupportingDocumentation setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #subject} (The patient who is directly or indirectly the subject of the supporting information.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.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 directly or indirectly the subject of the supporting information.) - */ - public SupportingDocumentation 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 directly or indirectly the subject of the supporting information.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.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 directly or indirectly the subject of the supporting information.) - */ - public SupportingDocumentation setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #detail} (Supporting Files.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (SupportingDocumentationDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Supporting Files.) - */ - // syntactic sugar - public SupportingDocumentationDetailComponent addDetail() { //3 - SupportingDocumentationDetailComponent t = new SupportingDocumentationDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List 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("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("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization|Practitioner)", "The Insurer, organization or Provider who is target of the submission.", 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)); - childrenList.add(new Property("request", "Reference(Any)", "Original request identifer.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(Any)", "Original response identifer.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("author", "Reference(Practitioner)", "Person who created the submission.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is directly or indirectly the subject of the supporting information.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("detail", "", "Supporting Files.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public SupportingDocumentation copy() { - SupportingDocumentation dst = new SupportingDocumentation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.author = author == null ? null : author.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (SupportingDocumentationDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - protected SupportingDocumentation typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (author == null || author.isEmpty()) - && (subject == null || subject.isEmpty()) && (detail == null || detail.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SupportingDocumentation; - } - - @SearchParamDefinition(name="author", path="SupportingDocumentation.author", description="The person who generated this resource", type="reference" ) - public static final String SP_AUTHOR = "author"; - @SearchParamDefinition(name="patient", path="SupportingDocumentation.subject", description="The patient to whom the documents refer", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="SupportingDocumentation.subject", description="The patient to whom the documents refer", type="reference" ) - public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="identifier", path="SupportingDocumentation.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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.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; +/** + * This resource provides the supporting information for a process, for example clinical or financial information related to a claim or pre-authorization. + */ +@ResourceDef(name="SupportingDocumentation", profile="http://hl7.org/fhir/Profile/SupportingDocumentation") +public class SupportingDocumentation extends DomainResource { + + @Block() + public static class SupportingDocumentationDetailComponent extends BackboneElement { + /** + * A link Id for the response to reference. + */ + @Child(name="linkId", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="LinkId", formalDefinition="A link Id for the response to reference." ) + protected IntegerType linkId; + + /** + * The attached content. + */ + @Child(name="content", type={Attachment.class}, order=2, min=1, max=1) + @Description(shortDefinition="Content", formalDefinition="The attached content." ) + protected Type content; + + /** + * The date and optionally time when the material was created. + */ + @Child(name="dateTime", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Creation date and time", formalDefinition="The date and optionally time when the material was created." ) + protected DateTimeType dateTime; + + private static final long serialVersionUID = -132176946L; + + public SupportingDocumentationDetailComponent() { + super(); + } + + public SupportingDocumentationDetailComponent(IntegerType linkId, Type content) { + super(); + this.linkId = linkId; + this.content = content; + } + + /** + * @return {@link #linkId} (A link Id for the response to reference.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public IntegerType getLinkIdElement() { + if (this.linkId == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentationDetailComponent.linkId"); + else if (Configuration.doAutoCreate()) + this.linkId = new IntegerType(); + return this.linkId; + } + + public boolean hasLinkIdElement() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + public boolean hasLinkId() { + return this.linkId != null && !this.linkId.isEmpty(); + } + + /** + * @param value {@link #linkId} (A link Id for the response to reference.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value + */ + public SupportingDocumentationDetailComponent setLinkIdElement(IntegerType value) { + this.linkId = value; + return this; + } + + /** + * @return A link Id for the response to reference. + */ + public int getLinkId() { + return this.linkId == null ? null : this.linkId.getValue(); + } + + /** + * @param value A link Id for the response to reference. + */ + public SupportingDocumentationDetailComponent setLinkId(int value) { + if (this.linkId == null) + this.linkId = new IntegerType(); + this.linkId.setValue(value); + return this; + } + + /** + * @return {@link #content} (The attached content.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (The attached content.) + */ + 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; + } + + /** + * @return {@link #content} (The attached content.) + */ + 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; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (The attached content.) + */ + public SupportingDocumentationDetailComponent setContent(Type value) { + this.content = value; + return this; + } + + /** + * @return {@link #dateTime} (The date and optionally time when the material was created.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public DateTimeType getDateTimeElement() { + if (this.dateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentationDetailComponent.dateTime"); + else if (Configuration.doAutoCreate()) + this.dateTime = new DateTimeType(); + return this.dateTime; + } + + public boolean hasDateTimeElement() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + public boolean hasDateTime() { + return this.dateTime != null && !this.dateTime.isEmpty(); + } + + /** + * @param value {@link #dateTime} (The date and optionally time when the material was created.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value + */ + public SupportingDocumentationDetailComponent setDateTimeElement(DateTimeType value) { + this.dateTime = value; + return this; + } + + /** + * @return The date and optionally time when the material was created. + */ + public Date getDateTime() { + return this.dateTime == null ? null : this.dateTime.getValue(); + } + + /** + * @param value The date and optionally time when the material was created. + */ + public SupportingDocumentationDetailComponent setDateTime(Date value) { + if (value == null) + this.dateTime = null; + else { + if (this.dateTime == null) + this.dateTime = new DateTimeType(); + this.dateTime.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("linkId", "integer", "A link Id for the response to reference.", 0, java.lang.Integer.MAX_VALUE, linkId)); + childrenList.add(new Property("content[x]", "Reference(Any)|Attachment", "The attached content.", 0, java.lang.Integer.MAX_VALUE, content)); + childrenList.add(new Property("dateTime", "dateTime", "The date and optionally time when the material was created.", 0, java.lang.Integer.MAX_VALUE, dateTime)); + } + + public SupportingDocumentationDetailComponent copy() { + SupportingDocumentationDetailComponent dst = new SupportingDocumentationDetailComponent(); + copyValues(dst); + dst.linkId = linkId == null ? null : linkId.copy(); + dst.content = content == null ? null : content.copy(); + dst.dateTime = dateTime == null ? null : dateTime.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (content == null || content.isEmpty()) + && (dateTime == null || dateTime.isEmpty()); + } + + } + + /** + * The Response Business Identifier. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=1, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) + protected List identifier; + + /** + * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) + protected Coding ruleset; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + /** + * The date when this resource was created. + */ + @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 DateTimeType created; + + /** + * The Insurer, organization or Provider who is target of the submission. + */ + @Child(name="target", type={Organization.class, Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer or Provider", formalDefinition="The Insurer, organization or Provider who is target of the submission." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (The Insurer, organization or Provider who is target of the submission.) + */ + protected Resource targetTarget; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the services rendered to the patient. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) + */ + protected Organization organizationTarget; + + /** + * Original request identifer. + */ + @Child(name="request", type={}, order=6, min=0, max=1) + @Description(shortDefinition="Request reference", formalDefinition="Original request identifer." ) + protected Reference request; + + /** + * The actual object that is the target of the reference (Original request identifer.) + */ + protected Resource requestTarget; + + /** + * Original response identifer. + */ + @Child(name="response", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Response reference", formalDefinition="Original response identifer." ) + protected Reference response; + + /** + * The actual object that is the target of the reference (Original response identifer.) + */ + protected Resource responseTarget; + + /** + * Person who created the submission. + */ + @Child(name="author", type={Practitioner.class}, order=8, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the submission." ) + protected Reference author; + + /** + * The actual object that is the target of the reference (Person who created the submission.) + */ + protected Practitioner authorTarget; + + /** + * The patient who is directly or indirectly the subject of the supporting information. + */ + @Child(name="subject", type={Patient.class}, order=9, min=0, max=1) + @Description(shortDefinition="Patient", formalDefinition="The patient who is directly or indirectly the subject of the supporting information." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who is directly or indirectly the subject of the supporting information.) + */ + protected Patient subjectTarget; + + /** + * Supporting Files. + */ + @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Supporting Files", formalDefinition="Supporting Files." ) + protected List detail; + + private static final long serialVersionUID = -1353519836L; + + public SupportingDocumentation() { + super(); + } + + /** + * @return {@link #identifier} (The Response Business Identifier.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The Response Business Identifier.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @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 SupportingDocumentation setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public SupportingDocumentation setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 SupportingDocumentation setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when this resource was created. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when this resource was created. + */ + public SupportingDocumentation setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (The Insurer, organization or Provider who is target of the submission.) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (The Insurer, organization or Provider who is target of the submission.) + */ + public SupportingDocumentation setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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 Insurer, organization or Provider who is target of the submission.) + */ + public Resource getTargetTarget() { + return this.targetTarget; + } + + /** + * @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, organization or Provider who is target of the submission.) + */ + public SupportingDocumentation setTargetTarget(Resource value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public SupportingDocumentation setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 SupportingDocumentation setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) + */ + public SupportingDocumentation setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the services rendered to the patient.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 SupportingDocumentation setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #request} (Original request identifer.) + */ + public Reference getRequest() { + if (this.request == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.request"); + else if (Configuration.doAutoCreate()) + this.request = new Reference(); + return this.request; + } + + public boolean hasRequest() { + return this.request != null && !this.request.isEmpty(); + } + + /** + * @param value {@link #request} (Original request identifer.) + */ + public SupportingDocumentation setRequest(Reference value) { + this.request = value; + return this; + } + + /** + * @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 identifer.) + */ + public Resource getRequestTarget() { + 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 identifer.) + */ + public SupportingDocumentation setRequestTarget(Resource value) { + this.requestTarget = value; + return this; + } + + /** + * @return {@link #response} (Original response identifer.) + */ + public Reference getResponse() { + if (this.response == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.response"); + else if (Configuration.doAutoCreate()) + this.response = new Reference(); + return this.response; + } + + public boolean hasResponse() { + return this.response != null && !this.response.isEmpty(); + } + + /** + * @param value {@link #response} (Original response identifer.) + */ + public SupportingDocumentation setResponse(Reference value) { + this.response = value; + return this; + } + + /** + * @return {@link #response} 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 response identifer.) + */ + public Resource getResponseTarget() { + return this.responseTarget; + } + + /** + * @param value {@link #response} 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 response identifer.) + */ + public SupportingDocumentation setResponseTarget(Resource value) { + this.responseTarget = value; + return this; + } + + /** + * @return {@link #author} (Person who created the submission.) + */ + public Reference getAuthor() { + if (this.author == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.author"); + else if (Configuration.doAutoCreate()) + this.author = new Reference(); + return this.author; + } + + public boolean hasAuthor() { + return this.author != null && !this.author.isEmpty(); + } + + /** + * @param value {@link #author} (Person who created the submission.) + */ + public SupportingDocumentation setAuthor(Reference value) { + this.author = value; + return this; + } + + /** + * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the submission.) + */ + public Practitioner getAuthorTarget() { + if (this.authorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.author"); + else if (Configuration.doAutoCreate()) + this.authorTarget = new Practitioner(); + return this.authorTarget; + } + + /** + * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the submission.) + */ + public SupportingDocumentation setAuthorTarget(Practitioner value) { + this.authorTarget = value; + return this; + } + + /** + * @return {@link #subject} (The patient who is directly or indirectly the subject of the supporting information.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.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 directly or indirectly the subject of the supporting information.) + */ + public SupportingDocumentation 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 directly or indirectly the subject of the supporting information.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SupportingDocumentation.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 directly or indirectly the subject of the supporting information.) + */ + public SupportingDocumentation setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + /** + * @return {@link #detail} (Supporting Files.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (SupportingDocumentationDetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Supporting Files.) + */ + // syntactic sugar + public SupportingDocumentationDetailComponent addDetail() { //3 + SupportingDocumentationDetailComponent t = new SupportingDocumentationDetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List 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("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("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization|Practitioner)", "The Insurer, organization or Provider who is target of the submission.", 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)); + childrenList.add(new Property("request", "Reference(Any)", "Original request identifer.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("response", "Reference(Any)", "Original response identifer.", 0, java.lang.Integer.MAX_VALUE, response)); + childrenList.add(new Property("author", "Reference(Practitioner)", "Person who created the submission.", 0, java.lang.Integer.MAX_VALUE, author)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is directly or indirectly the subject of the supporting information.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("detail", "", "Supporting Files.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public SupportingDocumentation copy() { + SupportingDocumentation dst = new SupportingDocumentation(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.request = request == null ? null : request.copy(); + dst.response = response == null ? null : response.copy(); + dst.author = author == null ? null : author.copy(); + dst.subject = subject == null ? null : subject.copy(); + if (detail != null) { + dst.detail = new ArrayList(); + for (SupportingDocumentationDetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + protected SupportingDocumentation typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (author == null || author.isEmpty()) + && (subject == null || subject.isEmpty()) && (detail == null || detail.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.SupportingDocumentation; + } + + @SearchParamDefinition(name="author", path="SupportingDocumentation.author", description="The person who generated this resource", type="reference" ) + public static final String SP_AUTHOR = "author"; + @SearchParamDefinition(name="patient", path="SupportingDocumentation.subject", description="The patient to whom the documents refer", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="subject", path="SupportingDocumentation.subject", description="The patient to whom the documents refer", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="identifier", path="SupportingDocumentation.identifier", description="The business identifier of the Eligibility", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TimeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TimeType.java index 7c1e81067c2..33b748129a1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TimeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TimeType.java @@ -1,32 +1,32 @@ -/* -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. - -*/ - +/* +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. + +*/ + package org.hl7.fhir.instance.model; /* @@ -49,42 +49,42 @@ package org.hl7.fhir.instance.model; * #L% */ - -/** - * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally milliseconds), with NO date and NO timezone information attached. It is - * expressed as a string in the form HH:mm:ss[.SSSS] - */ -public class TimeType extends PrimitiveType { - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public TimeType() { - // nothing - } - - /** - * Constructor - */ - public TimeType(String theValue) { - setValue(theValue); - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public TimeType copy() { - return new TimeType(getValue()); - } - -} + +/** + * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally milliseconds), with NO date and NO timezone information attached. It is + * expressed as a string in the form HH:mm:ss[.SSSS] + */ +public class TimeType extends PrimitiveType { + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public TimeType() { + // nothing + } + + /** + * Constructor + */ + public TimeType(String theValue) { + setValue(theValue); + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public TimeType copy() { + return new TimeType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java index e0f0d8cfb49..dd5400f7d01 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java @@ -20,857 +20,857 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; -/** - * Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur. - */ -@DatatypeDef(name="Timing") -public class Timing extends Type implements ICompositeType{ - - public enum EventTiming implements FhirEnum { - /** - * event occurs [duration] before the hour of sleep (or trying to). - */ - HS, - /** - * event occurs [duration] after waking. - */ - WAKE, - /** - * event occurs [duration] before a meal (from the Latin ante cibus). - */ - AC, - /** - * event occurs [duration] before breakfast (from the Latin ante cibus matutinus). - */ - ACM, - /** - * event occurs [duration] before lunch (from the Latin ante cibus diurnus). - */ - ACD, - /** - * event occurs [duration] before dinner (from the Latin ante cibus vespertinus). - */ - ACV, - /** - * event occurs [duration] after a meal (from the Latin post cibus). - */ - PC, - /** - * event occurs [duration] after breakfast (from the Latin post cibus matutinus). - */ - PCM, - /** - * event occurs [duration] after lunch (from the Latin post cibus diurnus). - */ - PCD, - /** - * event occurs [duration] after dinner (from the Latin post cibus vespertinus). - */ - PCV, - /** - * added to help the parsers - */ - NULL; - - public static final EventTimingEnumFactory ENUM_FACTORY = new EventTimingEnumFactory(); - - public static EventTiming fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return HS; - if ("WAKE".equals(codeString)) - return WAKE; - if ("AC".equals(codeString)) - return AC; - if ("ACM".equals(codeString)) - return ACM; - if ("ACD".equals(codeString)) - return ACD; - if ("ACV".equals(codeString)) - return ACV; - if ("PC".equals(codeString)) - return PC; - if ("PCM".equals(codeString)) - return PCM; - if ("PCD".equals(codeString)) - return PCD; - if ("PCV".equals(codeString)) - return PCV; - throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case HS: return "HS"; - case WAKE: return "WAKE"; - case AC: return "AC"; - case ACM: return "ACM"; - case ACD: return "ACD"; - case ACV: return "ACV"; - case PC: return "PC"; - case PCM: return "PCM"; - case PCD: return "PCD"; - case PCV: return "PCV"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HS: return "http://hl7.org/fhir/v3/TimingEvent"; - case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; - case AC: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; - case PC: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HS: return "event occurs [duration] before the hour of sleep (or trying to)."; - case WAKE: return "event occurs [duration] after waking."; - case AC: return "event occurs [duration] before a meal (from the Latin ante cibus)."; - case ACM: return "event occurs [duration] before breakfast (from the Latin ante cibus matutinus)."; - case ACD: return "event occurs [duration] before lunch (from the Latin ante cibus diurnus)."; - case ACV: return "event occurs [duration] before dinner (from the Latin ante cibus vespertinus)."; - case PC: return "event occurs [duration] after a meal (from the Latin post cibus)."; - case PCM: return "event occurs [duration] after breakfast (from the Latin post cibus matutinus)."; - case PCD: return "event occurs [duration] after lunch (from the Latin post cibus diurnus)."; - case PCV: return "event occurs [duration] after dinner (from the Latin post cibus vespertinus)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HS: return "HS"; - case WAKE: return "WAKE"; - case AC: return "AC"; - case ACM: return "ACM"; - case ACD: return "ACD"; - case ACV: return "ACV"; - case PC: return "PC"; - case PCM: return "PCM"; - case PCD: return "PCD"; - case PCV: return "PCV"; - default: return "?"; - } - } - } - - public static class EventTimingEnumFactory implements EnumFactory { - public EventTiming fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return EventTiming.HS; - if ("WAKE".equals(codeString)) - return EventTiming.WAKE; - if ("AC".equals(codeString)) - return EventTiming.AC; - if ("ACM".equals(codeString)) - return EventTiming.ACM; - if ("ACD".equals(codeString)) - return EventTiming.ACD; - if ("ACV".equals(codeString)) - return EventTiming.ACV; - if ("PC".equals(codeString)) - return EventTiming.PC; - if ("PCM".equals(codeString)) - return EventTiming.PCM; - if ("PCD".equals(codeString)) - return EventTiming.PCD; - if ("PCV".equals(codeString)) - return EventTiming.PCV; - throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode(EventTiming code) throws IllegalArgumentException { - if (code == EventTiming.HS) - return "HS"; - if (code == EventTiming.WAKE) - return "WAKE"; - if (code == EventTiming.AC) - return "AC"; - if (code == EventTiming.ACM) - return "ACM"; - if (code == EventTiming.ACD) - return "ACD"; - if (code == EventTiming.ACV) - return "ACV"; - if (code == EventTiming.PC) - return "PC"; - if (code == EventTiming.PCM) - return "PCM"; - if (code == EventTiming.PCD) - return "PCD"; - if (code == EventTiming.PCV) - return "PCV"; - return "?"; - } - } - - public enum UnitsOfTime implements FhirEnum { - /** - * second. - */ - S, - /** - * minute. - */ - MIN, - /** - * hour. - */ - H, - /** - * day. - */ - D, - /** - * week. - */ - WK, - /** - * month. - */ - MO, - /** - * year. - */ - A, - /** - * added to help the parsers - */ - NULL; - - public static final UnitsOfTimeEnumFactory ENUM_FACTORY = new UnitsOfTimeEnumFactory(); - - public static UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return S; - if ("min".equals(codeString)) - return MIN; - if ("h".equals(codeString)) - return H; - if ("d".equals(codeString)) - return D; - if ("wk".equals(codeString)) - return WK; - if ("mo".equals(codeString)) - return MO; - if ("a".equals(codeString)) - return A; - throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case S: return "s"; - case MIN: return "min"; - case H: return "h"; - case D: return "d"; - case WK: return "wk"; - case MO: return "mo"; - case A: return "a"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case S: return "http://unitsofmeasure.org"; - case MIN: return "http://unitsofmeasure.org"; - case H: return "http://unitsofmeasure.org"; - case D: return "http://unitsofmeasure.org"; - case WK: return "http://unitsofmeasure.org"; - case MO: return "http://unitsofmeasure.org"; - case A: return "http://unitsofmeasure.org"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case S: return "second."; - case MIN: return "minute."; - case H: return "hour."; - case D: return "day."; - case WK: return "week."; - case MO: return "month."; - case A: return "year."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case S: return "s"; - case MIN: return "min"; - case H: return "h"; - case D: return "d"; - case WK: return "wk"; - case MO: return "mo"; - case A: return "a"; - default: return "?"; - } - } - } - - public static class UnitsOfTimeEnumFactory implements EnumFactory { - public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return UnitsOfTime.S; - if ("min".equals(codeString)) - return UnitsOfTime.MIN; - if ("h".equals(codeString)) - return UnitsOfTime.H; - if ("d".equals(codeString)) - return UnitsOfTime.D; - if ("wk".equals(codeString)) - return UnitsOfTime.WK; - if ("mo".equals(codeString)) - return UnitsOfTime.MO; - if ("a".equals(codeString)) - return UnitsOfTime.A; - throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode(UnitsOfTime code) throws IllegalArgumentException { - if (code == UnitsOfTime.S) - return "s"; - if (code == UnitsOfTime.MIN) - return "min"; - if (code == UnitsOfTime.H) - return "h"; - if (code == UnitsOfTime.D) - return "d"; - if (code == UnitsOfTime.WK) - return "wk"; - if (code == UnitsOfTime.MO) - return "mo"; - if (code == UnitsOfTime.A) - return "a"; - return "?"; - } - } - - public static class TimingRepeatComponent extends Element { - /** - * Indicates how often the event should occur. - */ - @Child(name="frequency", type={IntegerType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Event occurs frequency times per duration", formalDefinition="Indicates how often the event should occur." ) - protected IntegerType frequency; - - /** - * Identifies the occurrence of daily life that determines timing. - */ - @Child(name="when", type={CodeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events", formalDefinition="Identifies the occurrence of daily life that determines timing." ) - protected Enumeration when; - - /** - * How long each repetition should last. - */ - @Child(name="duration", type={DecimalType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Repeating or event-related duration", formalDefinition="How long each repetition should last." ) - protected DecimalType duration; - - /** - * The units of time for the duration. - */ - @Child(name="units", type={CodeType.class}, order=4, min=1, max=1) - @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration." ) - protected Enumeration units; - - /** - * A total count of the desired number of repetitions. - */ - @Child(name="count", type={IntegerType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) - protected IntegerType count; - - /** - * When to stop repeating the timing schedule. - */ - @Child(name="end", type={DateTimeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="When to stop repeats", formalDefinition="When to stop repeating the timing schedule." ) - protected DateTimeType end; - - private static final long serialVersionUID = -615844988L; - - public TimingRepeatComponent() { - super(); - } - - public TimingRepeatComponent(DecimalType duration, Enumeration units) { - super(); - this.duration = duration; - this.units = units; - } - - /** - * @return {@link #frequency} (Indicates how often the event should occur.). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value - */ - public IntegerType getFrequencyElement() { - if (this.frequency == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); - else if (Configuration.doAutoCreate()) - this.frequency = new IntegerType(); - return this.frequency; - } - - public boolean hasFrequencyElement() { - return this.frequency != null && !this.frequency.isEmpty(); - } - - public boolean hasFrequency() { - return this.frequency != null && !this.frequency.isEmpty(); - } - - /** - * @param value {@link #frequency} (Indicates how often the event should occur.). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value - */ - public TimingRepeatComponent setFrequencyElement(IntegerType value) { - this.frequency = value; - return this; - } - - /** - * @return Indicates how often the event should occur. - */ - public int getFrequency() { - return this.frequency == null ? null : this.frequency.getValue(); - } - - /** - * @param value Indicates how often the event should occur. - */ - public TimingRepeatComponent setFrequency(int value) { - if (value == -1) - this.frequency = null; - else { - if (this.frequency == null) - this.frequency = new IntegerType(); - this.frequency.setValue(value); - } - return this; - } - - /** - * @return {@link #when} (Identifies the occurrence of daily life that determines timing.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public Enumeration getWhenElement() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.when"); - else if (Configuration.doAutoCreate()) - this.when = new Enumeration(); - return this.when; - } - - public boolean hasWhenElement() { - return this.when != null && !this.when.isEmpty(); - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (Identifies the occurrence of daily life that determines timing.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public TimingRepeatComponent setWhenElement(Enumeration value) { - this.when = value; - return this; - } - - /** - * @return Identifies the occurrence of daily life that determines timing. - */ - public EventTiming getWhen() { - return this.when == null ? null : this.when.getValue(); - } - - /** - * @param value Identifies the occurrence of daily life that determines timing. - */ - public TimingRepeatComponent setWhen(EventTiming value) { - if (value == null) - this.when = null; - else { - if (this.when == null) - this.when = new Enumeration(EventTiming.ENUM_FACTORY); - this.when.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (How long each repetition should last.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public DecimalType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new DecimalType(); - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (How long each repetition should last.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public TimingRepeatComponent setDurationElement(DecimalType value) { - this.duration = value; - return this; - } - - /** - * @return How long each repetition should last. - */ - public BigDecimal getDuration() { - return this.duration == null ? null : this.duration.getValue(); - } - - /** - * @param value How long each repetition should last. - */ - public TimingRepeatComponent setDuration(BigDecimal value) { - if (this.duration == null) - this.duration = new DecimalType(); - this.duration.setValue(value); - return this; - } - - /** - * @return {@link #units} (The units of time for the duration.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value - */ - public Enumeration getUnitsElement() { - if (this.units == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.units"); - else if (Configuration.doAutoCreate()) - this.units = new Enumeration(); - return this.units; - } - - public boolean hasUnitsElement() { - return this.units != null && !this.units.isEmpty(); - } - - public boolean hasUnits() { - return this.units != null && !this.units.isEmpty(); - } - - /** - * @param value {@link #units} (The units of time for the duration.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value - */ - public TimingRepeatComponent setUnitsElement(Enumeration value) { - this.units = value; - return this; - } - - /** - * @return The units of time for the duration. - */ - public UnitsOfTime getUnits() { - return this.units == null ? null : this.units.getValue(); - } - - /** - * @param value The units of time for the duration. - */ - public TimingRepeatComponent setUnits(UnitsOfTime value) { - if (this.units == null) - this.units = new Enumeration(UnitsOfTime.ENUM_FACTORY); - this.units.setValue(value); - return this; - } - - /** - * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public IntegerType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.count"); - else if (Configuration.doAutoCreate()) - this.count = new IntegerType(); - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public TimingRepeatComponent setCountElement(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return A total count of the desired number of repetitions. - */ - public int getCount() { - return this.count == null ? null : this.count.getValue(); - } - - /** - * @param value A total count of the desired number of repetitions. - */ - public TimingRepeatComponent setCount(int value) { - if (value == -1) - this.count = null; - else { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (When to stop repeating the timing schedule.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public DateTimeType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.end"); - else if (Configuration.doAutoCreate()) - this.end = new DateTimeType(); - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (When to stop repeating the timing schedule.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public TimingRepeatComponent setEndElement(DateTimeType value) { - this.end = value; - return this; - } - - /** - * @return When to stop repeating the timing schedule. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value When to stop repeating the timing schedule. - */ - public TimingRepeatComponent setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new DateTimeType(); - this.end.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("frequency", "integer", "Indicates how often the event should occur.", 0, java.lang.Integer.MAX_VALUE, frequency)); - childrenList.add(new Property("when", "code", "Identifies the occurrence of daily life that determines timing.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("duration", "decimal", "How long each repetition should last.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("units", "code", "The units of time for the duration.", 0, java.lang.Integer.MAX_VALUE, units)); - childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("end", "dateTime", "When to stop repeating the timing schedule.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - public TimingRepeatComponent copy() { - TimingRepeatComponent dst = new TimingRepeatComponent(); - copyValues(dst); - dst.frequency = frequency == null ? null : frequency.copy(); - dst.when = when == null ? null : when.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.units = units == null ? null : units.copy(); - dst.count = count == null ? null : count.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (frequency == null || frequency.isEmpty()) && (when == null || when.isEmpty()) - && (duration == null || duration.isEmpty()) && (units == null || units.isEmpty()) && (count == null || count.isEmpty()) - && (end == null || end.isEmpty()); - } - - } - - /** - * Identifies specific time periods when the event should occur. - */ - @Child(name="event", type={Period.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific time periods when the event should occur." ) - protected List event; - - /** - * Identifies a repeating pattern to the intended time periods. - */ - @Child(name="repeat", type={}, order=0, min=0, max=1) - @Description(shortDefinition="Only if there is none or one event", formalDefinition="Identifies a repeating pattern to the intended time periods." ) - protected TimingRepeatComponent repeat; - - private static final long serialVersionUID = -621040330L; - - public Timing() { - super(); - } - - /** - * @return {@link #event} (Identifies specific time periods when the event should occur.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (Period item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (Identifies specific time periods when the event should occur.) - */ - // syntactic sugar - public Period addEvent() { //3 - Period t = new Period(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - /** - * @return {@link #repeat} (Identifies a repeating pattern to the intended time periods.) - */ - public TimingRepeatComponent getRepeat() { - if (this.repeat == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Timing.repeat"); - else if (Configuration.doAutoCreate()) - this.repeat = new TimingRepeatComponent(); - return this.repeat; - } - - public boolean hasRepeat() { - return this.repeat != null && !this.repeat.isEmpty(); - } - - /** - * @param value {@link #repeat} (Identifies a repeating pattern to the intended time periods.) - */ - public Timing setRepeat(TimingRepeatComponent value) { - this.repeat = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "Period", "Identifies specific time periods when the event should occur.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("repeat", "", "Identifies a repeating pattern to the intended time periods.", 0, java.lang.Integer.MAX_VALUE, repeat)); - } - - public Timing copy() { - Timing dst = new Timing(); - copyValues(dst); - if (event != null) { - dst.event = new ArrayList(); - for (Period i : event) - dst.event.add(i.copy()); - }; - dst.repeat = repeat == null ? null : repeat.copy(); - return dst; - } - - protected Timing typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) - ; - } - - -} - + +/* + 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 java.math.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; +/** + * Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur. + */ +@DatatypeDef(name="Timing") +public class Timing extends Type implements ICompositeType{ + + public enum EventTiming implements FhirEnum { + /** + * event occurs [duration] before the hour of sleep (or trying to). + */ + HS, + /** + * event occurs [duration] after waking. + */ + WAKE, + /** + * event occurs [duration] before a meal (from the Latin ante cibus). + */ + AC, + /** + * event occurs [duration] before breakfast (from the Latin ante cibus matutinus). + */ + ACM, + /** + * event occurs [duration] before lunch (from the Latin ante cibus diurnus). + */ + ACD, + /** + * event occurs [duration] before dinner (from the Latin ante cibus vespertinus). + */ + ACV, + /** + * event occurs [duration] after a meal (from the Latin post cibus). + */ + PC, + /** + * event occurs [duration] after breakfast (from the Latin post cibus matutinus). + */ + PCM, + /** + * event occurs [duration] after lunch (from the Latin post cibus diurnus). + */ + PCD, + /** + * event occurs [duration] after dinner (from the Latin post cibus vespertinus). + */ + PCV, + /** + * added to help the parsers + */ + NULL; + + public static final EventTimingEnumFactory ENUM_FACTORY = new EventTimingEnumFactory(); + + public static EventTiming fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("HS".equals(codeString)) + return HS; + if ("WAKE".equals(codeString)) + return WAKE; + if ("AC".equals(codeString)) + return AC; + if ("ACM".equals(codeString)) + return ACM; + if ("ACD".equals(codeString)) + return ACD; + if ("ACV".equals(codeString)) + return ACV; + if ("PC".equals(codeString)) + return PC; + if ("PCM".equals(codeString)) + return PCM; + if ("PCD".equals(codeString)) + return PCD; + if ("PCV".equals(codeString)) + return PCV; + throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case HS: return "HS"; + case WAKE: return "WAKE"; + case AC: return "AC"; + case ACM: return "ACM"; + case ACD: return "ACD"; + case ACV: return "ACV"; + case PC: return "PC"; + case PCM: return "PCM"; + case PCD: return "PCD"; + case PCV: return "PCV"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case HS: return "http://hl7.org/fhir/v3/TimingEvent"; + case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; + case AC: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; + case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; + case PC: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; + case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case HS: return "event occurs [duration] before the hour of sleep (or trying to)."; + case WAKE: return "event occurs [duration] after waking."; + case AC: return "event occurs [duration] before a meal (from the Latin ante cibus)."; + case ACM: return "event occurs [duration] before breakfast (from the Latin ante cibus matutinus)."; + case ACD: return "event occurs [duration] before lunch (from the Latin ante cibus diurnus)."; + case ACV: return "event occurs [duration] before dinner (from the Latin ante cibus vespertinus)."; + case PC: return "event occurs [duration] after a meal (from the Latin post cibus)."; + case PCM: return "event occurs [duration] after breakfast (from the Latin post cibus matutinus)."; + case PCD: return "event occurs [duration] after lunch (from the Latin post cibus diurnus)."; + case PCV: return "event occurs [duration] after dinner (from the Latin post cibus vespertinus)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case HS: return "HS"; + case WAKE: return "WAKE"; + case AC: return "AC"; + case ACM: return "ACM"; + case ACD: return "ACD"; + case ACV: return "ACV"; + case PC: return "PC"; + case PCM: return "PCM"; + case PCD: return "PCD"; + case PCV: return "PCV"; + default: return "?"; + } + } + } + + public static class EventTimingEnumFactory implements EnumFactory { + public EventTiming fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("HS".equals(codeString)) + return EventTiming.HS; + if ("WAKE".equals(codeString)) + return EventTiming.WAKE; + if ("AC".equals(codeString)) + return EventTiming.AC; + if ("ACM".equals(codeString)) + return EventTiming.ACM; + if ("ACD".equals(codeString)) + return EventTiming.ACD; + if ("ACV".equals(codeString)) + return EventTiming.ACV; + if ("PC".equals(codeString)) + return EventTiming.PC; + if ("PCM".equals(codeString)) + return EventTiming.PCM; + if ("PCD".equals(codeString)) + return EventTiming.PCD; + if ("PCV".equals(codeString)) + return EventTiming.PCV; + throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); + } + public String toCode(EventTiming code) throws IllegalArgumentException { + if (code == EventTiming.HS) + return "HS"; + if (code == EventTiming.WAKE) + return "WAKE"; + if (code == EventTiming.AC) + return "AC"; + if (code == EventTiming.ACM) + return "ACM"; + if (code == EventTiming.ACD) + return "ACD"; + if (code == EventTiming.ACV) + return "ACV"; + if (code == EventTiming.PC) + return "PC"; + if (code == EventTiming.PCM) + return "PCM"; + if (code == EventTiming.PCD) + return "PCD"; + if (code == EventTiming.PCV) + return "PCV"; + return "?"; + } + } + + public enum UnitsOfTime implements FhirEnum { + /** + * second. + */ + S, + /** + * minute. + */ + MIN, + /** + * hour. + */ + H, + /** + * day. + */ + D, + /** + * week. + */ + WK, + /** + * month. + */ + MO, + /** + * year. + */ + A, + /** + * added to help the parsers + */ + NULL; + + public static final UnitsOfTimeEnumFactory ENUM_FACTORY = new UnitsOfTimeEnumFactory(); + + public static UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("s".equals(codeString)) + return S; + if ("min".equals(codeString)) + return MIN; + if ("h".equals(codeString)) + return H; + if ("d".equals(codeString)) + return D; + if ("wk".equals(codeString)) + return WK; + if ("mo".equals(codeString)) + return MO; + if ("a".equals(codeString)) + return A; + throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case S: return "s"; + case MIN: return "min"; + case H: return "h"; + case D: return "d"; + case WK: return "wk"; + case MO: return "mo"; + case A: return "a"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case S: return "http://unitsofmeasure.org"; + case MIN: return "http://unitsofmeasure.org"; + case H: return "http://unitsofmeasure.org"; + case D: return "http://unitsofmeasure.org"; + case WK: return "http://unitsofmeasure.org"; + case MO: return "http://unitsofmeasure.org"; + case A: return "http://unitsofmeasure.org"; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case S: return "second."; + case MIN: return "minute."; + case H: return "hour."; + case D: return "day."; + case WK: return "week."; + case MO: return "month."; + case A: return "year."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case S: return "s"; + case MIN: return "min"; + case H: return "h"; + case D: return "d"; + case WK: return "wk"; + case MO: return "mo"; + case A: return "a"; + default: return "?"; + } + } + } + + public static class UnitsOfTimeEnumFactory implements EnumFactory { + public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("s".equals(codeString)) + return UnitsOfTime.S; + if ("min".equals(codeString)) + return UnitsOfTime.MIN; + if ("h".equals(codeString)) + return UnitsOfTime.H; + if ("d".equals(codeString)) + return UnitsOfTime.D; + if ("wk".equals(codeString)) + return UnitsOfTime.WK; + if ("mo".equals(codeString)) + return UnitsOfTime.MO; + if ("a".equals(codeString)) + return UnitsOfTime.A; + throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); + } + public String toCode(UnitsOfTime code) throws IllegalArgumentException { + if (code == UnitsOfTime.S) + return "s"; + if (code == UnitsOfTime.MIN) + return "min"; + if (code == UnitsOfTime.H) + return "h"; + if (code == UnitsOfTime.D) + return "d"; + if (code == UnitsOfTime.WK) + return "wk"; + if (code == UnitsOfTime.MO) + return "mo"; + if (code == UnitsOfTime.A) + return "a"; + return "?"; + } + } + + public static class TimingRepeatComponent extends Element { + /** + * Indicates how often the event should occur. + */ + @Child(name="frequency", type={IntegerType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Event occurs frequency times per duration", formalDefinition="Indicates how often the event should occur." ) + protected IntegerType frequency; + + /** + * Identifies the occurrence of daily life that determines timing. + */ + @Child(name="when", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events", formalDefinition="Identifies the occurrence of daily life that determines timing." ) + protected Enumeration when; + + /** + * How long each repetition should last. + */ + @Child(name="duration", type={DecimalType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Repeating or event-related duration", formalDefinition="How long each repetition should last." ) + protected DecimalType duration; + + /** + * The units of time for the duration. + */ + @Child(name="units", type={CodeType.class}, order=4, min=1, max=1) + @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration." ) + protected Enumeration units; + + /** + * A total count of the desired number of repetitions. + */ + @Child(name="count", type={IntegerType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) + protected IntegerType count; + + /** + * When to stop repeating the timing schedule. + */ + @Child(name="end", type={DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="When to stop repeats", formalDefinition="When to stop repeating the timing schedule." ) + protected DateTimeType end; + + private static final long serialVersionUID = -615844988L; + + public TimingRepeatComponent() { + super(); + } + + public TimingRepeatComponent(DecimalType duration, Enumeration units) { + super(); + this.duration = duration; + this.units = units; + } + + /** + * @return {@link #frequency} (Indicates how often the event should occur.). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value + */ + public IntegerType getFrequencyElement() { + if (this.frequency == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); + else if (Configuration.doAutoCreate()) + this.frequency = new IntegerType(); + return this.frequency; + } + + public boolean hasFrequencyElement() { + return this.frequency != null && !this.frequency.isEmpty(); + } + + public boolean hasFrequency() { + return this.frequency != null && !this.frequency.isEmpty(); + } + + /** + * @param value {@link #frequency} (Indicates how often the event should occur.). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value + */ + public TimingRepeatComponent setFrequencyElement(IntegerType value) { + this.frequency = value; + return this; + } + + /** + * @return Indicates how often the event should occur. + */ + public int getFrequency() { + return this.frequency == null ? null : this.frequency.getValue(); + } + + /** + * @param value Indicates how often the event should occur. + */ + public TimingRepeatComponent setFrequency(int value) { + if (value == -1) + this.frequency = null; + else { + if (this.frequency == null) + this.frequency = new IntegerType(); + this.frequency.setValue(value); + } + return this; + } + + /** + * @return {@link #when} (Identifies the occurrence of daily life that determines timing.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public Enumeration getWhenElement() { + if (this.when == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.when"); + else if (Configuration.doAutoCreate()) + this.when = new Enumeration(); + return this.when; + } + + public boolean hasWhenElement() { + return this.when != null && !this.when.isEmpty(); + } + + public boolean hasWhen() { + return this.when != null && !this.when.isEmpty(); + } + + /** + * @param value {@link #when} (Identifies the occurrence of daily life that determines timing.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value + */ + public TimingRepeatComponent setWhenElement(Enumeration value) { + this.when = value; + return this; + } + + /** + * @return Identifies the occurrence of daily life that determines timing. + */ + public EventTiming getWhen() { + return this.when == null ? null : this.when.getValue(); + } + + /** + * @param value Identifies the occurrence of daily life that determines timing. + */ + public TimingRepeatComponent setWhen(EventTiming value) { + if (value == null) + this.when = null; + else { + if (this.when == null) + this.when = new Enumeration(EventTiming.ENUM_FACTORY); + this.when.setValue(value); + } + return this; + } + + /** + * @return {@link #duration} (How long each repetition should last.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public DecimalType getDurationElement() { + if (this.duration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); + else if (Configuration.doAutoCreate()) + this.duration = new DecimalType(); + return this.duration; + } + + public boolean hasDurationElement() { + return this.duration != null && !this.duration.isEmpty(); + } + + public boolean hasDuration() { + return this.duration != null && !this.duration.isEmpty(); + } + + /** + * @param value {@link #duration} (How long each repetition should last.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value + */ + public TimingRepeatComponent setDurationElement(DecimalType value) { + this.duration = value; + return this; + } + + /** + * @return How long each repetition should last. + */ + public BigDecimal getDuration() { + return this.duration == null ? null : this.duration.getValue(); + } + + /** + * @param value How long each repetition should last. + */ + public TimingRepeatComponent setDuration(BigDecimal value) { + if (this.duration == null) + this.duration = new DecimalType(); + this.duration.setValue(value); + return this; + } + + /** + * @return {@link #units} (The units of time for the duration.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value + */ + public Enumeration getUnitsElement() { + if (this.units == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.units"); + else if (Configuration.doAutoCreate()) + this.units = new Enumeration(); + return this.units; + } + + public boolean hasUnitsElement() { + return this.units != null && !this.units.isEmpty(); + } + + public boolean hasUnits() { + return this.units != null && !this.units.isEmpty(); + } + + /** + * @param value {@link #units} (The units of time for the duration.). This is the underlying object with id, value and extensions. The accessor "getUnits" gives direct access to the value + */ + public TimingRepeatComponent setUnitsElement(Enumeration value) { + this.units = value; + return this; + } + + /** + * @return The units of time for the duration. + */ + public UnitsOfTime getUnits() { + return this.units == null ? null : this.units.getValue(); + } + + /** + * @param value The units of time for the duration. + */ + public TimingRepeatComponent setUnits(UnitsOfTime value) { + if (this.units == null) + this.units = new Enumeration(UnitsOfTime.ENUM_FACTORY); + this.units.setValue(value); + return this; + } + + /** + * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public IntegerType getCountElement() { + if (this.count == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.count"); + else if (Configuration.doAutoCreate()) + this.count = new IntegerType(); + return this.count; + } + + public boolean hasCountElement() { + return this.count != null && !this.count.isEmpty(); + } + + public boolean hasCount() { + return this.count != null && !this.count.isEmpty(); + } + + /** + * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value + */ + public TimingRepeatComponent setCountElement(IntegerType value) { + this.count = value; + return this; + } + + /** + * @return A total count of the desired number of repetitions. + */ + public int getCount() { + return this.count == null ? null : this.count.getValue(); + } + + /** + * @param value A total count of the desired number of repetitions. + */ + public TimingRepeatComponent setCount(int value) { + if (value == -1) + this.count = null; + else { + if (this.count == null) + this.count = new IntegerType(); + this.count.setValue(value); + } + return this; + } + + /** + * @return {@link #end} (When to stop repeating the timing schedule.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public DateTimeType getEndElement() { + if (this.end == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create TimingRepeatComponent.end"); + else if (Configuration.doAutoCreate()) + this.end = new DateTimeType(); + return this.end; + } + + public boolean hasEndElement() { + return this.end != null && !this.end.isEmpty(); + } + + public boolean hasEnd() { + return this.end != null && !this.end.isEmpty(); + } + + /** + * @param value {@link #end} (When to stop repeating the timing schedule.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value + */ + public TimingRepeatComponent setEndElement(DateTimeType value) { + this.end = value; + return this; + } + + /** + * @return When to stop repeating the timing schedule. + */ + public Date getEnd() { + return this.end == null ? null : this.end.getValue(); + } + + /** + * @param value When to stop repeating the timing schedule. + */ + public TimingRepeatComponent setEnd(Date value) { + if (value == null) + this.end = null; + else { + if (this.end == null) + this.end = new DateTimeType(); + this.end.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("frequency", "integer", "Indicates how often the event should occur.", 0, java.lang.Integer.MAX_VALUE, frequency)); + childrenList.add(new Property("when", "code", "Identifies the occurrence of daily life that determines timing.", 0, java.lang.Integer.MAX_VALUE, when)); + childrenList.add(new Property("duration", "decimal", "How long each repetition should last.", 0, java.lang.Integer.MAX_VALUE, duration)); + childrenList.add(new Property("units", "code", "The units of time for the duration.", 0, java.lang.Integer.MAX_VALUE, units)); + childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); + childrenList.add(new Property("end", "dateTime", "When to stop repeating the timing schedule.", 0, java.lang.Integer.MAX_VALUE, end)); + } + + public TimingRepeatComponent copy() { + TimingRepeatComponent dst = new TimingRepeatComponent(); + copyValues(dst); + dst.frequency = frequency == null ? null : frequency.copy(); + dst.when = when == null ? null : when.copy(); + dst.duration = duration == null ? null : duration.copy(); + dst.units = units == null ? null : units.copy(); + dst.count = count == null ? null : count.copy(); + dst.end = end == null ? null : end.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (frequency == null || frequency.isEmpty()) && (when == null || when.isEmpty()) + && (duration == null || duration.isEmpty()) && (units == null || units.isEmpty()) && (count == null || count.isEmpty()) + && (end == null || end.isEmpty()); + } + + } + + /** + * Identifies specific time periods when the event should occur. + */ + @Child(name="event", type={Period.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific time periods when the event should occur." ) + protected List event; + + /** + * Identifies a repeating pattern to the intended time periods. + */ + @Child(name="repeat", type={}, order=0, min=0, max=1) + @Description(shortDefinition="Only if there is none or one event", formalDefinition="Identifies a repeating pattern to the intended time periods." ) + protected TimingRepeatComponent repeat; + + private static final long serialVersionUID = -621040330L; + + public Timing() { + super(); + } + + /** + * @return {@link #event} (Identifies specific time periods when the event should occur.) + */ + public List getEvent() { + if (this.event == null) + this.event = new ArrayList(); + return this.event; + } + + public boolean hasEvent() { + if (this.event == null) + return false; + for (Period item : this.event) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #event} (Identifies specific time periods when the event should occur.) + */ + // syntactic sugar + public Period addEvent() { //3 + Period t = new Period(); + if (this.event == null) + this.event = new ArrayList(); + this.event.add(t); + return t; + } + + /** + * @return {@link #repeat} (Identifies a repeating pattern to the intended time periods.) + */ + public TimingRepeatComponent getRepeat() { + if (this.repeat == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Timing.repeat"); + else if (Configuration.doAutoCreate()) + this.repeat = new TimingRepeatComponent(); + return this.repeat; + } + + public boolean hasRepeat() { + return this.repeat != null && !this.repeat.isEmpty(); + } + + /** + * @param value {@link #repeat} (Identifies a repeating pattern to the intended time periods.) + */ + public Timing setRepeat(TimingRepeatComponent value) { + this.repeat = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("event", "Period", "Identifies specific time periods when the event should occur.", 0, java.lang.Integer.MAX_VALUE, event)); + childrenList.add(new Property("repeat", "", "Identifies a repeating pattern to the intended time periods.", 0, java.lang.Integer.MAX_VALUE, repeat)); + } + + public Timing copy() { + Timing dst = new Timing(); + copyValues(dst); + if (event != null) { + dst.event = new ArrayList(); + for (Period i : event) + dst.event.add(i.copy()); + }; + dst.repeat = repeat == null ? null : repeat.copy(); + return dst; + } + + protected Timing typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) + ; + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java index ad25f9db0b4..0d893f221fd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java @@ -1,31 +1,31 @@ -/* -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. - - */ +/* +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. + + */ package org.hl7.fhir.instance.model; /* @@ -48,17 +48,17 @@ package org.hl7.fhir.instance.model; * #L% */ - -/** - * An element that is a type. Used when the element type in FHIR is a choice of more than one data type - */ -public abstract class Type extends Element { - - private static final long serialVersionUID = 4623040030733049991L; - - public Type copy() { - return typedCopy(); - } - - protected abstract Type typedCopy(); -} + +/** + * An element that is a type. Used when the element type in FHIR is a choice of more than one data type + */ +public abstract class Type extends Element { + + private static final long serialVersionUID = 4623040030733049991L; + + public Type copy() { + return typedCopy(); + } + + protected abstract Type typedCopy(); +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java index faf493e4c5b..5917e32a3ef 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.instance.model; /* @@ -48,130 +48,130 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.net.URI; -import java.net.URISyntaxException; - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.instance.model.annotations.DatatypeDef; - -/** - * Primitive type "uri" in FHIR: any valid URI. Sometimes constrained to be only an absolute URI, and sometimes constrained to be a literal reference - */ -@DatatypeDef(name = "uri") -public class UriType extends PrimitiveType { - - private static final long serialVersionUID = 1L; - - /** - * Constructor - */ - public UriType() { - // nothing - } - - /** - * Constructor - */ - public UriType(String theValue) { - setValueAsString(theValue); - } - - /** - * Constructor - */ - public UriType(URI theValue) { - setValue(theValue.toString()); - } - - @Override - public UriType copy() { - return new UriType(getValue()); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - - UriType other = (UriType) obj; - if (getValue() == null && other.getValue() == null) { - return true; - } - if (getValue() == null || other.getValue() == null) { - return false; - } - - String normalize = normalize(getValue()); - String normalize2 = normalize(other.getValue()); - return normalize.equals(normalize2); - } - - /** - * Compares the given string to the string representation of this URI. In many cases it is preferable to use this - * instead of the standard {@link #equals(Object)} method, since that method returns false unless it is - * passed an instance of {@link UriType} - */ - public boolean equals(String theString) { - return StringUtils.equals(getValueAsString(), theString); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - - String normalize = normalize(getValue()); - result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); - - return result; - } - - private String normalize(String theValue) { - if (theValue == null) { - return null; - } - try { - URI retVal = new URI(getValue()).normalize(); - String urlString = retVal.toString(); - if (urlString.endsWith("/") && urlString.length() > 1) { - retVal = new URI(urlString.substring(0, urlString.length() - 1)); - } - return retVal.toASCIIString(); - } catch (URISyntaxException e) { - // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); - return theValue; - } - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - /** - * Creates a new OidType instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string - * in the value of the newly created OidType, per the FHIR specification). - * - * @param theOid - * The OID to use (null is acceptable and will result in a UriDt instance with a - * null value) - * @return A new UriDt instance - */ - public static OidType fromOid(String theOid) { - if (theOid == null) { - return new OidType(); - } - return new OidType("urn:oid:" + theOid); - } - -} + +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + +/** + * Primitive type "uri" in FHIR: any valid URI. Sometimes constrained to be only an absolute URI, and sometimes constrained to be a literal reference + */ +@DatatypeDef(name = "uri") +public class UriType extends PrimitiveType { + + private static final long serialVersionUID = 1L; + + /** + * Constructor + */ + public UriType() { + // nothing + } + + /** + * Constructor + */ + public UriType(String theValue) { + setValueAsString(theValue); + } + + /** + * Constructor + */ + public UriType(URI theValue) { + setValue(theValue.toString()); + } + + @Override + public UriType copy() { + return new UriType(getValue()); + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + + UriType other = (UriType) obj; + if (getValue() == null && other.getValue() == null) { + return true; + } + if (getValue() == null || other.getValue() == null) { + return false; + } + + String normalize = normalize(getValue()); + String normalize2 = normalize(other.getValue()); + return normalize.equals(normalize2); + } + + /** + * Compares the given string to the string representation of this URI. In many cases it is preferable to use this + * instead of the standard {@link #equals(Object)} method, since that method returns false unless it is + * passed an instance of {@link UriType} + */ + public boolean equals(String theString) { + return StringUtils.equals(getValueAsString(), theString); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + + String normalize = normalize(getValue()); + result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); + + return result; + } + + private String normalize(String theValue) { + if (theValue == null) { + return null; + } + try { + URI retVal = new URI(getValue()).normalize(); + String urlString = retVal.toString(); + if (urlString.endsWith("/") && urlString.length() > 1) { + retVal = new URI(urlString.substring(0, urlString.length() - 1)); + } + return retVal.toASCIIString(); + } catch (URISyntaxException e) { + // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); + return theValue; + } + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + /** + * Creates a new OidType instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string + * in the value of the newly created OidType, per the FHIR specification). + * + * @param theOid + * The OID to use (null is acceptable and will result in a UriDt instance with a + * null value) + * @return A new UriDt instance + */ + public static OidType fromOid(String theOid) { + if (theOid == null) { + return new OidType(); + } + return new OidType("urn:oid:" + theOid); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java index adbdbe8f4ac..fe83b5dd4b0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.instance.model; /* @@ -48,40 +48,40 @@ package org.hl7.fhir.instance.model; * #L% */ - -import java.net.URI; - -public class UuidType extends UriType { - - private static final long serialVersionUID = 2L; - - /** - * Constructor - */ - public UuidType() { - super(); - } - - /** - * Constructor - */ - public UuidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public UuidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public UuidType copy() { - return new UuidType(getValue()); - } - -} + +import java.net.URI; + +public class UuidType extends UriType { + + private static final long serialVersionUID = 2L; + + /** + * Constructor + */ + public UuidType() { + super(); + } + + /** + * Constructor + */ + public UuidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public UuidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public UuidType copy() { + return new UuidType(getValue()); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java index 92918b47d76..06a9125262d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java @@ -20,3295 +20,3295 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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; -/** - * A value set specifies a set of codes drawn from one or more code systems. - */ -@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") -public class ValueSet extends DomainResource { - - public enum ValuesetStatus implements FhirEnum { - /** - * This valueset is still under development. - */ - DRAFT, - /** - * This valueset is ready for normal use. - */ - ACTIVE, - /** - * This valueset has been withdrawn or superceded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - - 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)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return ""; - case ACTIVE: return ""; - case RETIRED: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This valueset is still under development."; - case ACTIVE: return "This valueset is ready for normal use."; - case RETIRED: return "This valueset has been withdrawn or superceded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case ACTIVE: return "Active"; - case RETIRED: return "Retired"; - default: return "?"; - } - } - } - - public static class ValuesetStatusEnumFactory implements EnumFactory { - public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ValuesetStatus.DRAFT; - if ("active".equals(codeString)) - return ValuesetStatus.ACTIVE; - if ("retired".equals(codeString)) - return ValuesetStatus.RETIRED; - throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); - } - public String toCode(ValuesetStatus code) throws IllegalArgumentException { - if (code == ValuesetStatus.DRAFT) - return "draft"; - if (code == ValuesetStatus.ACTIVE) - return "active"; - if (code == ValuesetStatus.RETIRED) - return "retired"; - return "?"; - } - } - - public enum FilterOperator implements FhirEnum { - /** - * The specified property of the code equals the provided value. - */ - EQUAL, - /** - * The specified property of the code has an is-a relationship with the provided value. - */ - ISA, - /** - * The specified property of the code does not have an is-a relationship with the provided value. - */ - ISNOTA, - /** - * The specified property of the code matches the regex specified in the provided value. - */ - REGEX, - /** - * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). - */ - IN, - /** - * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). - */ - NOTIN, - /** - * added to help the parsers - */ - NULL; - - public static final FilterOperatorEnumFactory ENUM_FACTORY = new FilterOperatorEnumFactory(); - - public static FilterOperator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return EQUAL; - if ("is-a".equals(codeString)) - return ISA; - if ("is-not-a".equals(codeString)) - return ISNOTA; - if ("regex".equals(codeString)) - return REGEX; - if ("in".equals(codeString)) - return IN; - if ("not in".equals(codeString)) - return NOTIN; - throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case EQUAL: return "="; - case ISA: return "is-a"; - case ISNOTA: return "is-not-a"; - case REGEX: return "regex"; - case IN: return "in"; - case NOTIN: return "not in"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUAL: return ""; - case ISA: return ""; - case ISNOTA: return ""; - case REGEX: return ""; - case IN: return ""; - case NOTIN: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EQUAL: return "The specified property of the code equals the provided value."; - case ISA: return "The specified property of the code has an is-a relationship with the provided value."; - case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; - case REGEX: return "The specified property of the code matches the regex specified in the provided value."; - case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; - case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUAL: return "="; - case ISA: return "is-a"; - case ISNOTA: return "is-not-a"; - case REGEX: return "regex"; - case IN: return "in"; - case NOTIN: return "not in"; - default: return "?"; - } - } - } - - public static class FilterOperatorEnumFactory implements EnumFactory { - public FilterOperator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return FilterOperator.EQUAL; - if ("is-a".equals(codeString)) - return FilterOperator.ISA; - if ("is-not-a".equals(codeString)) - return FilterOperator.ISNOTA; - if ("regex".equals(codeString)) - return FilterOperator.REGEX; - if ("in".equals(codeString)) - return FilterOperator.IN; - if ("not in".equals(codeString)) - return FilterOperator.NOTIN; - throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); - } - public String toCode(FilterOperator code) throws IllegalArgumentException { - if (code == FilterOperator.EQUAL) - return "="; - if (code == FilterOperator.ISA) - return "is-a"; - if (code == FilterOperator.ISNOTA) - return "is-not-a"; - if (code == FilterOperator.REGEX) - return "regex"; - if (code == FilterOperator.IN) - return "in"; - if (code == FilterOperator.NOTIN) - return "not in"; - return "?"; - } - } - - @Block() - public static class ValueSetDefineComponent extends BackboneElement { - /** - * URI to identify the code system. - */ - @Child(name="system", type={UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="URI to identify the code system", formalDefinition="URI to identify the code system." ) - protected UriType system; - - /** - * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. - */ - @Child(name="version", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Version of this system", formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked." ) - protected StringType version; - - /** - * If code comparison is case sensitive when codes within this system are compared to each other. - */ - @Child(name="caseSensitive", type={BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." ) - protected BooleanType caseSensitive; - - /** - * Concepts in the code system. - */ - @Child(name="concept", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts in the code system." ) - protected List concept; - - private static final long serialVersionUID = -1109401192L; - - public ValueSetDefineComponent() { - super(); - } - - public ValueSetDefineComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (URI to identify the code system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetDefineComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (URI to identify the code system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ValueSetDefineComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return URI to identify the code system. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value URI to identify the code system. - */ - public ValueSetDefineComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetDefineComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSetDefineComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. - */ - public ValueSetDefineComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value - */ - public BooleanType getCaseSensitiveElement() { - if (this.caseSensitive == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetDefineComponent.caseSensitive"); - else if (Configuration.doAutoCreate()) - this.caseSensitive = new BooleanType(); - return this.caseSensitive; - } - - public boolean hasCaseSensitiveElement() { - return this.caseSensitive != null && !this.caseSensitive.isEmpty(); - } - - public boolean hasCaseSensitive() { - return this.caseSensitive != null && !this.caseSensitive.isEmpty(); - } - - /** - * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value - */ - public ValueSetDefineComponent setCaseSensitiveElement(BooleanType value) { - this.caseSensitive = value; - return this; - } - - /** - * @return If code comparison is case sensitive when codes within this system are compared to each other. - */ - public boolean getCaseSensitive() { - return this.caseSensitive == null ? false : this.caseSensitive.getValue(); - } - - /** - * @param value If code comparison is case sensitive when codes within this system are compared to each other. - */ - public ValueSetDefineComponent setCaseSensitive(boolean value) { - if (value == false) - this.caseSensitive = null; - else { - if (this.caseSensitive == null) - this.caseSensitive = new BooleanType(); - this.caseSensitive.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Concepts in the code system.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptDefinitionComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Concepts in the code system.) - */ - // syntactic sugar - public ConceptDefinitionComponent addConcept() { //3 - ConceptDefinitionComponent t = new ConceptDefinitionComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "URI to identify the code system.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive)); - childrenList.add(new Property("concept", "", "Concepts in the code system.", 0, java.lang.Integer.MAX_VALUE, concept)); - } - - public ValueSetDefineComponent copy() { - ValueSetDefineComponent dst = new ValueSetDefineComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptDefinitionComponent i : concept) - dst.concept.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (caseSensitive == null || caseSensitive.isEmpty()) && (concept == null || concept.isEmpty()) - ; - } - - } - - @Block() - public static class ConceptDefinitionComponent extends BackboneElement { - /** - * Code that identifies concept. - */ - @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code that identifies concept", formalDefinition="Code that identifies concept." ) - protected CodeType code; - - /** - * If this code is not for use as a real concept. - */ - @Child(name="abstract_", type={BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If this code is not for use as a real concept", formalDefinition="If this code is not for use as a real concept." ) - protected BooleanType abstract_; - - /** - * Text to Display to the user. - */ - @Child(name="display", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Text to Display to the user", formalDefinition="Text to Display to the user." ) - protected StringType display; - - /** - * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - @Child(name="definition", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Formal Definition", formalDefinition="The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept." ) - protected StringType definition; - - /** - * Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc. - */ - @Child(name="designation", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc." ) - protected List designation; - - /** - * Child Concepts (is-a / contains). - */ - @Child(name="concept", type={ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Child Concepts (is-a / contains)", formalDefinition="Child Concepts (is-a / contains)." ) - protected List concept; - - private static final long serialVersionUID = -318560292L; - - public ConceptDefinitionComponent() { - super(); - } - - public ConceptDefinitionComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptDefinitionComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Code that identifies concept. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Code that identifies concept. - */ - public ConceptDefinitionComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public ConceptDefinitionComponent setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return If this code is not for use as a real concept. - */ - public boolean getAbstract() { - return this.abstract_ == null ? false : this.abstract_.getValue(); - } - - /** - * @param value If this code is not for use as a real concept. - */ - public ConceptDefinitionComponent setAbstract(boolean value) { - if (value == false) - this.abstract_ = null; - else { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ConceptDefinitionComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Text to Display to the user. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Text to Display to the user. - */ - public ConceptDefinitionComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public StringType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new StringType(); - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ConceptDefinitionComponent setDefinitionElement(StringType value) { - this.definition = value; - return this; - } - - /** - * @return The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - public ConceptDefinitionComponent setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new StringType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (ConceptDefinitionDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - // syntactic sugar - public ConceptDefinitionDesignationComponent addDesignation() { //3 - ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - /** - * @return {@link #concept} (Child Concepts (is-a / contains).) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptDefinitionComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Child Concepts (is-a / contains).) - */ - // syntactic sugar - public ConceptDefinitionComponent addConcept() { //3 - ConceptDefinitionComponent t = new ConceptDefinitionComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Code that identifies concept.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("abstract", "boolean", "If this code is not for use as a real concept.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("display", "string", "Text to Display to the user.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("definition", "string", "The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); - childrenList.add(new Property("concept", "@ValueSet.define.concept", "Child Concepts (is-a / contains).", 0, java.lang.Integer.MAX_VALUE, concept)); - } - - public ConceptDefinitionComponent copy() { - ConceptDefinitionComponent dst = new ConceptDefinitionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.display = display == null ? null : display.copy(); - dst.definition = definition == null ? null : definition.copy(); - if (designation != null) { - dst.designation = new ArrayList(); - for (ConceptDefinitionDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptDefinitionComponent i : concept) - dst.concept.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) - && (display == null || display.isEmpty()) && (definition == null || definition.isEmpty()) - && (designation == null || designation.isEmpty()) && (concept == null || concept.isEmpty()) - ; - } - - } - - @Block() - public static class ConceptDefinitionDesignationComponent extends BackboneElement { - /** - * The language this designation is defined for. - */ - @Child(name="language", type={CodeType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Language of the designation", formalDefinition="The language this designation is defined for." ) - protected CodeType language; - - /** - * A code that details how this designation would be used. - */ - @Child(name="use", type={Coding.class}, order=2, min=0, max=1) - @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) - protected Coding use; - - /** - * The text value for this designation. - */ - @Child(name="value", type={StringType.class}, order=3, min=1, max=1) - @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) - protected StringType value; - - private static final long serialVersionUID = 1515662414L; - - public ConceptDefinitionDesignationComponent() { - super(); - } - - public ConceptDefinitionDesignationComponent(StringType value) { - super(); - this.value = value; - } - - /** - * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The language this designation is defined for. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The language this designation is defined for. - */ - public ConceptDefinitionDesignationComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (A code that details how this designation would be used.) - */ - public Coding getUse() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Coding(); - return this.use; - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (A code that details how this designation would be used.) - */ - public ConceptDefinitionDesignationComponent setUse(Coding value) { - this.use = value; - return this; - } - - /** - * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptDefinitionDesignationComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The text value for this designation. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The text value for this designation. - */ - public ConceptDefinitionDesignationComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ConceptDefinitionDesignationComponent copy() { - ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.use = use == null ? null : use.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ValueSetComposeComponent extends BackboneElement { - /** - * Includes the contents of the referenced value set as a part of the contents of this value set. - */ - @Child(name="import_", type={UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set." ) - protected List import_; - - /** - * Include one or more codes from a code system. - */ - @Child(name="include", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." ) - protected List include; - - /** - * Exclude one or more codes from the value set. - */ - @Child(name="exclude", type={ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." ) - protected List exclude; - - private static final long serialVersionUID = -703166694L; - - public ValueSetComposeComponent() { - super(); - } - - /** - * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) - */ - public List getImport() { - if (this.import_ == null) - this.import_ = new ArrayList(); - return this.import_; - } - - public boolean hasImport() { - if (this.import_ == null) - return false; - for (UriType item : this.import_) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) - */ - // syntactic sugar - public UriType addImportElement() {//2 - UriType t = new UriType(); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return t; - } - - /** - * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) - */ - public ValueSetComposeComponent addImport(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return this; - } - - /** - * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) - */ - public boolean hasImport(String value) { - if (this.import_ == null) - return false; - for (UriType v : this.import_) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #include} (Include one or more codes from a code system.) - */ - public List getInclude() { - if (this.include == null) - this.include = new ArrayList(); - return this.include; - } - - public boolean hasInclude() { - if (this.include == null) - return false; - for (ConceptSetComponent item : this.include) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #include} (Include one or more codes from a code system.) - */ - // syntactic sugar - public ConceptSetComponent addInclude() { //3 - ConceptSetComponent t = new ConceptSetComponent(); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return t; - } - - /** - * @return {@link #exclude} (Exclude one or more codes from the value set.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (ConceptSetComponent item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Exclude one or more codes from the value set.) - */ - // syntactic sugar - public ConceptSetComponent addExclude() { //3 - ConceptSetComponent t = new ConceptSetComponent(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set.", 0, java.lang.Integer.MAX_VALUE, import_)); - childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - public ValueSetComposeComponent copy() { - ValueSetComposeComponent dst = new ValueSetComposeComponent(); - copyValues(dst); - if (import_ != null) { - dst.import_ = new ArrayList(); - for (UriType i : import_) - dst.import_.add(i.copy()); - }; - if (include != null) { - dst.include = new ArrayList(); - for (ConceptSetComponent i : include) - dst.include.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (ConceptSetComponent i : exclude) - dst.exclude.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty()) - && (exclude == null || exclude.isEmpty()); - } - - } - - @Block() - public static class ConceptSetComponent extends BackboneElement { - /** - * The code system from which the selected codes come from. - */ - @Child(name="system", type={UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="The system the codes come from", formalDefinition="The code system from which the selected codes come from." ) - protected UriType system; - - /** - * The version of the code system that the codes are selected from. - */ - @Child(name="version", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." ) - protected StringType version; - - /** - * Specifies a concept to be included or excluded. - */ - @Child(name="concept", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." ) - protected List concept; - - /** - * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. - */ - @Child(name="filter", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." ) - protected List filter; - - private static final long serialVersionUID = -196054471L; - - public ConceptSetComponent() { - super(); - } - - public ConceptSetComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (The code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ConceptSetComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The code system from which the selected codes come from. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The code system from which the selected codes come from. - */ - public ConceptSetComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConceptSetComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system that the codes are selected from. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system that the codes are selected from. - */ - public ConceptSetComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Specifies a concept to be included or excluded.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptReferenceComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Specifies a concept to be included or excluded.) - */ - // syntactic sugar - public ConceptReferenceComponent addConcept() { //3 - ConceptReferenceComponent t = new ConceptReferenceComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - /** - * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) - */ - public List getFilter() { - if (this.filter == null) - this.filter = new ArrayList(); - return this.filter; - } - - public boolean hasFilter() { - if (this.filter == null) - return false; - for (ConceptSetFilterComponent item : this.filter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) - */ - // syntactic sugar - public ConceptSetFilterComponent addFilter() { //3 - ConceptSetFilterComponent t = new ConceptSetFilterComponent(); - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "The code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter)); - } - - public ConceptSetComponent copy() { - ConceptSetComponent dst = new ConceptSetComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptReferenceComponent i : concept) - dst.concept.add(i.copy()); - }; - if (filter != null) { - dst.filter = new ArrayList(); - for (ConceptSetFilterComponent i : filter) - dst.filter.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty()); - } - - } - - @Block() - public static class ConceptReferenceComponent extends BackboneElement { - /** - * Specifies a code for the concept to be included or excluded. - */ - @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." ) - protected CodeType code; - - /** - * The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - @Child(name="display", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Test to display for this code for this value set", formalDefinition="The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system." ) - protected StringType display; - - /** - * Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc. - */ - @Child(name="designation", type={ConceptDefinitionDesignationComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc." ) - protected List designation; - - private static final long serialVersionUID = -1513912691L; - - public ConceptReferenceComponent() { - super(); - } - - public ConceptReferenceComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptReferenceComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Specifies a code for the concept to be included or excluded. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Specifies a code for the concept to be included or excluded. - */ - public ConceptReferenceComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ConceptReferenceComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - public ConceptReferenceComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (ConceptDefinitionDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) - */ - // syntactic sugar - public ConceptDefinitionDesignationComponent addDesignation() { //3 - ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("designation", "@ValueSet.define.concept.designation", "Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); - } - - public ConceptReferenceComponent copy() { - ConceptReferenceComponent dst = new ConceptReferenceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - if (designation != null) { - dst.designation = new ArrayList(); - for (ConceptDefinitionDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (designation == null || designation.isEmpty()); - } - - } - - @Block() - public static class ConceptSetFilterComponent extends BackboneElement { - /** - * A code that identifies a property defined in the code system. - */ - @Child(name="property", type={CodeType.class}, order=1, min=1, max=1) - @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." ) - protected CodeType property; - - /** - * The kind of operation to perform as a part of the filter criteria. - */ - @Child(name="op", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="= | is-a | is-not-a | regex | in | not in", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) - protected Enumeration op; - - /** - * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. - */ - @Child(name="value", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="Code from the system, or regex criteria", formalDefinition="The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value." ) - protected CodeType value; - - private static final long serialVersionUID = 1985515000L; - - public ConceptSetFilterComponent() { - super(); - } - - public ConceptSetFilterComponent(CodeType property, Enumeration op, CodeType value) { - super(); - this.property = property; - this.op = op; - this.value = value; - } - - /** - * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value - */ - public CodeType getPropertyElement() { - if (this.property == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.property"); - else if (Configuration.doAutoCreate()) - this.property = new CodeType(); - return this.property; - } - - public boolean hasPropertyElement() { - return this.property != null && !this.property.isEmpty(); - } - - public boolean hasProperty() { - return this.property != null && !this.property.isEmpty(); - } - - /** - * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value - */ - public ConceptSetFilterComponent setPropertyElement(CodeType value) { - this.property = value; - return this; - } - - /** - * @return A code that identifies a property defined in the code system. - */ - public String getProperty() { - return this.property == null ? null : this.property.getValue(); - } - - /** - * @param value A code that identifies a property defined in the code system. - */ - public ConceptSetFilterComponent setProperty(String value) { - if (this.property == null) - this.property = new CodeType(); - this.property.setValue(value); - return this; - } - - /** - * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value - */ - public Enumeration getOpElement() { - if (this.op == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.op"); - else if (Configuration.doAutoCreate()) - this.op = new Enumeration(); - return this.op; - } - - public boolean hasOpElement() { - return this.op != null && !this.op.isEmpty(); - } - - public boolean hasOp() { - return this.op != null && !this.op.isEmpty(); - } - - /** - * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value - */ - public ConceptSetFilterComponent setOpElement(Enumeration value) { - this.op = value; - return this; - } - - /** - * @return The kind of operation to perform as a part of the filter criteria. - */ - public FilterOperator getOp() { - return this.op == null ? null : this.op.getValue(); - } - - /** - * @param value The kind of operation to perform as a part of the filter criteria. - */ - public ConceptSetFilterComponent setOp(FilterOperator value) { - if (this.op == null) - this.op = new Enumeration(FilterOperator.ENUM_FACTORY); - this.op.setValue(value); - return this; - } - - /** - * @return {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public CodeType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new CodeType(); - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptSetFilterComponent setValueElement(CodeType value) { - this.value = value; - return this; - } - - /** - * @return The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. - */ - public ConceptSetFilterComponent setValue(String value) { - if (this.value == null) - this.value = new CodeType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property)); - childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op)); - childrenList.add(new Property("value", "code", "The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - public ConceptSetFilterComponent copy() { - ConceptSetFilterComponent dst = new ConceptSetFilterComponent(); - copyValues(dst); - dst.property = property == null ? null : property.copy(); - dst.op = op == null ? null : op.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty()) - && (value == null || value.isEmpty()); - } - - } - - @Block() - public static class ValueSetExpansionComponent extends BackboneElement { - /** - * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) - @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." ) - protected Identifier identifier; - - /** - * The time at which the expansion was produced by the expanding system. - */ - @Child(name="timestamp", type={DateTimeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Time valueset expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." ) - protected DateTimeType timestamp; - - /** - * The codes that are contained in the value set expansion. - */ - @Child(name="contains", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." ) - protected List contains; - - private static final long serialVersionUID = -1193480660L; - - public ValueSetExpansionComponent() { - super(); - } - - public ValueSetExpansionComponent(DateTimeType timestamp) { - super(); - this.timestamp = timestamp; - } - - /** - * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.) - */ - public ValueSetExpansionComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public DateTimeType getTimestampElement() { - if (this.timestamp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp"); - else if (Configuration.doAutoCreate()) - this.timestamp = new DateTimeType(); - return this.timestamp; - } - - public boolean hasTimestampElement() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - public boolean hasTimestamp() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - /** - * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { - this.timestamp = value; - return this; - } - - /** - * @return The time at which the expansion was produced by the expanding system. - */ - public Date getTimestamp() { - return this.timestamp == null ? null : this.timestamp.getValue(); - } - - /** - * @param value The time at which the expansion was produced by the expanding system. - */ - public ValueSetExpansionComponent setTimestamp(Date value) { - if (this.timestamp == null) - this.timestamp = new DateTimeType(); - this.timestamp.setValue(value); - return this; - } - - /** - * @return {@link #contains} (The codes that are contained in the value set expansion.) - */ - public List getContains() { - if (this.contains == null) - this.contains = new ArrayList(); - return this.contains; - } - - public boolean hasContains() { - if (this.contains == null) - return false; - for (ValueSetExpansionContainsComponent item : this.contains) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contains} (The codes that are contained in the value set expansion.) - */ - // syntactic sugar - public ValueSetExpansionContainsComponent addContains() { //3 - ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp)); - childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains)); - } - - public ValueSetExpansionComponent copy() { - ValueSetExpansionComponent dst = new ValueSetExpansionComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.timestamp = timestamp == null ? null : timestamp.copy(); - if (contains != null) { - dst.contains = new ArrayList(); - for (ValueSetExpansionContainsComponent i : contains) - dst.contains.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) - && (contains == null || contains.isEmpty()); - } - - } - - @Block() - public static class ValueSetExpansionContainsComponent extends BackboneElement { - /** - * The system in which the code for this item in the expansion is defined. - */ - @Child(name="system", type={UriType.class}, order=1, min=0, max=1) - @Description(shortDefinition="System value for the code", formalDefinition="The system in which the code for this item in the expansion is defined." ) - protected UriType system; - - /** - * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - @Child(name="abstract_", type={BooleanType.class}, order=2, min=0, max=1) - @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) - protected BooleanType abstract_; - - /** - * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - @Child(name="version", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Version in which this code / display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) - protected StringType version; - - /** - * Code - if blank, this is not a choosable code. - */ - @Child(name="code", type={CodeType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Code - if blank, this is not a choosable code", formalDefinition="Code - if blank, this is not a choosable code." ) - protected CodeType code; - - /** - * User display for the concept. - */ - @Child(name="display", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="User display for the concept", formalDefinition="User display for the concept." ) - protected StringType display; - - /** - * Codes contained in this concept. - */ - @Child(name="contains", type={ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Codes contained in this concept", formalDefinition="Codes contained in this concept." ) - protected List contains; - - private static final long serialVersionUID = -2038349483L; - - public ValueSetExpansionContainsComponent() { - super(); - } - - /** - * @return {@link #system} (The system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The system in which the code for this item in the expansion is defined. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The system in which the code for this item in the expansion is defined. - */ - public ValueSetExpansionContainsComponent setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - public boolean getAbstract() { - return this.abstract_ == null ? false : this.abstract_.getValue(); - } - - /** - * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - public ValueSetExpansionContainsComponent setAbstract(boolean value) { - if (value == false) - this.abstract_ = null; - else { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - public ValueSetExpansionContainsComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Code - if blank, this is not a choosable code. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Code - if blank, this is not a choosable code. - */ - public ValueSetExpansionContainsComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return User display for the concept. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value User display for the concept. - */ - public ValueSetExpansionContainsComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #contains} (Codes contained in this concept.) - */ - public List getContains() { - if (this.contains == null) - this.contains = new ArrayList(); - return this.contains; - } - - public boolean hasContains() { - if (this.contains == null) - return false; - for (ValueSetExpansionContainsComponent item : this.contains) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contains} (Codes contained in this concept.) - */ - // syntactic sugar - public ValueSetExpansionContainsComponent addContains() { //3 - ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "The system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "Code - if blank, this is not a choosable code.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "User display for the concept.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Codes contained in this concept.", 0, java.lang.Integer.MAX_VALUE, contains)); - } - - public ValueSetExpansionContainsComponent copy() { - ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - if (contains != null) { - dst.contains = new ArrayList(); - for (ValueSetExpansionContainsComponent i : contains) - dst.contains.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) - && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (contains == null || contains.isEmpty()); - } - - } - - /** - * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - @Child(name="identifier", type={UriType.class}, order=-1, min=0, max=1) - @Description(shortDefinition="Globally unique logical id for value set", formalDefinition="The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) - protected UriType identifier; - - /** - * The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name="version", type={StringType.class}, order=0, min=0, max=1) - @Description(shortDefinition="Logical id for this version of the value set", formalDefinition="The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name describing the value set. - */ - @Child(name="name", type={StringType.class}, order=1, min=0, max=1) - @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." ) - protected StringType name; - - /** - * This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set. - */ - @Child(name="purpose", type={StringType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Textual description of the intended scope and use", formalDefinition="This should describe 'the semantic space' to be included in the value set. This can also describe the approach taken to build the value set." ) - protected StringType purpose; - - /** - * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - @Child(name="immutable", type={BooleanType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Indicates whether or not any change to the content logical definition may occur", formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change." ) - protected BooleanType immutable; - - /** - * The name of the individual or organization that published the value set. - */ - @Child(name="publisher", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the value set." ) - protected StringType publisher; - - /** - * Contacts of the publisher to assist a user in finding and communicating with the publisher. - */ - @Child(name="telecom", type={ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contacts of the publisher to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set. - */ - @Child(name="description", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set." ) - protected StringType description; - - /** - * A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set. - */ - @Child(name="copyright", type={StringType.class}, order=7, min=0, max=1) - @Description(shortDefinition="Publishing restrictions for the value set", formalDefinition="A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set." ) - protected StringType copyright; - - /** - * The status of the value set. - */ - @Child(name="status", type={CodeType.class}, order=8, min=1, max=1) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." ) - protected Enumeration status; - - /** - * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name="experimental", type={BooleanType.class}, order=9, min=0, max=1) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * Whether this is intended to be used with an extensible binding or not. - */ - @Child(name="extensible", type={BooleanType.class}, order=10, min=0, max=1) - @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." ) - protected BooleanType extensible; - - /** - * The date that the value set status was last changed. - */ - @Child(name="date", type={DateTimeType.class}, order=11, min=0, max=1) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed." ) - protected DateTimeType date; - - /** - * If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. - */ - @Child(name="stableDate", type={DateType.class}, order=12, min=0, max=1) - @Description(shortDefinition="Fixed date for the version of all referenced code systems and value sets", formalDefinition="If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date." ) - protected DateType stableDate; - - /** - * When value set defines its own codes. - */ - @Child(name="define", type={}, order=13, min=0, max=1) - @Description(shortDefinition="When value set defines its own codes", formalDefinition="When value set defines its own codes." ) - protected ValueSetDefineComponent define; - - /** - * When value set includes codes from elsewhere. - */ - @Child(name="compose", type={}, order=14, min=0, max=1) - @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="When value set includes codes from elsewhere." ) - protected ValueSetComposeComponent compose; - - /** - * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. - */ - @Child(name="expansion", type={}, order=15, min=0, max=1) - @Description(shortDefinition="Used when the value set is 'expanded'", formalDefinition="A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed." ) - protected ValueSetExpansionComponent expansion; - - private static final long serialVersionUID = -1119903575L; - - public ValueSet() { - super(); - } - - public ValueSet(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public UriType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new UriType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ValueSet setIdentifierElement(UriType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). - */ - public ValueSet setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new UriType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSet setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public ValueSet setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); - 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} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSet setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the value set. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the value set. - */ - public ValueSet setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #purpose} (This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value - */ - public StringType getPurposeElement() { - if (this.purpose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.purpose"); - else if (Configuration.doAutoCreate()) - this.purpose = new StringType(); - return this.purpose; - } - - public boolean hasPurposeElement() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - public boolean hasPurpose() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - /** - * @param value {@link #purpose} (This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value - */ - public ValueSet setPurposeElement(StringType value) { - this.purpose = value; - return this; - } - - /** - * @return This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set. - */ - public String getPurpose() { - return this.purpose == null ? null : this.purpose.getValue(); - } - - /** - * @param value This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set. - */ - public ValueSet setPurpose(String value) { - if (Utilities.noString(value)) - this.purpose = null; - else { - if (this.purpose == null) - this.purpose = new StringType(); - this.purpose.setValue(value); - } - return this; - } - - /** - * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value - */ - public BooleanType getImmutableElement() { - if (this.immutable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.immutable"); - else if (Configuration.doAutoCreate()) - this.immutable = new BooleanType(); - return this.immutable; - } - - public boolean hasImmutableElement() { - return this.immutable != null && !this.immutable.isEmpty(); - } - - public boolean hasImmutable() { - return this.immutable != null && !this.immutable.isEmpty(); - } - - /** - * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value - */ - public ValueSet setImmutableElement(BooleanType value) { - this.immutable = value; - return this; - } - - /** - * @return If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - public boolean getImmutable() { - return this.immutable == null ? false : this.immutable.getValue(); - } - - /** - * @param value If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - public ValueSet setImmutable(boolean value) { - if (value == false) - this.immutable = null; - else { - if (this.immutable == null) - this.immutable = new BooleanType(); - this.immutable.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ValueSet setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the value set. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the value set. - */ - public ValueSet setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set.). 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 ValueSet.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} (A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ValueSet setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set. - */ - public ValueSet setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ValueSet setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set. - */ - public ValueSet setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(); - 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 value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ValueSet setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the value set. - */ - public ValuesetStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the value set. - */ - public ValueSet setStatus(ValuesetStatus value) { - if (this.status == null) - this.status = new Enumeration(ValuesetStatus.ENUM_FACTORY); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ValueSet setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null ? false : this.experimental.getValue(); - } - - /** - * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ValueSet setExperimental(boolean value) { - if (value == false) - this.experimental = null; - else { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - } - return this; - } - - /** - * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value - */ - public BooleanType getExtensibleElement() { - if (this.extensible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.extensible"); - else if (Configuration.doAutoCreate()) - this.extensible = new BooleanType(); - return this.extensible; - } - - public boolean hasExtensibleElement() { - return this.extensible != null && !this.extensible.isEmpty(); - } - - public boolean hasExtensible() { - return this.extensible != null && !this.extensible.isEmpty(); - } - - /** - * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value - */ - public ValueSet setExtensibleElement(BooleanType value) { - this.extensible = value; - return this; - } - - /** - * @return Whether this is intended to be used with an extensible binding or not. - */ - public boolean getExtensible() { - return this.extensible == null ? false : this.extensible.getValue(); - } - - /** - * @param value Whether this is intended to be used with an extensible binding or not. - */ - public ValueSet setExtensible(boolean value) { - if (value == false) - this.extensible = null; - else { - if (this.extensible == null) - this.extensible = new BooleanType(); - this.extensible.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ValueSet setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the value set status was last changed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the value set status was last changed. - */ - public ValueSet setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #stableDate} (If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.). This is the underlying object with id, value and extensions. The accessor "getStableDate" gives direct access to the value - */ - public DateType getStableDateElement() { - if (this.stableDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.stableDate"); - else if (Configuration.doAutoCreate()) - this.stableDate = new DateType(); - return this.stableDate; - } - - public boolean hasStableDateElement() { - return this.stableDate != null && !this.stableDate.isEmpty(); - } - - public boolean hasStableDate() { - return this.stableDate != null && !this.stableDate.isEmpty(); - } - - /** - * @param value {@link #stableDate} (If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.). This is the underlying object with id, value and extensions. The accessor "getStableDate" gives direct access to the value - */ - public ValueSet setStableDateElement(DateType value) { - this.stableDate = value; - return this; - } - - /** - * @return If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. - */ - public Date getStableDate() { - return this.stableDate == null ? null : this.stableDate.getValue(); - } - - /** - * @param value If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. - */ - public ValueSet setStableDate(Date value) { - if (value == null) - this.stableDate = null; - else { - if (this.stableDate == null) - this.stableDate = new DateType(); - this.stableDate.setValue(value); - } - return this; - } - - /** - * @return {@link #define} (When value set defines its own codes.) - */ - public ValueSetDefineComponent getDefine() { - if (this.define == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.define"); - else if (Configuration.doAutoCreate()) - this.define = new ValueSetDefineComponent(); - return this.define; - } - - public boolean hasDefine() { - return this.define != null && !this.define.isEmpty(); - } - - /** - * @param value {@link #define} (When value set defines its own codes.) - */ - public ValueSet setDefine(ValueSetDefineComponent value) { - this.define = value; - return this; - } - - /** - * @return {@link #compose} (When value set includes codes from elsewhere.) - */ - public ValueSetComposeComponent getCompose() { - if (this.compose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.compose"); - else if (Configuration.doAutoCreate()) - this.compose = new ValueSetComposeComponent(); - return this.compose; - } - - public boolean hasCompose() { - return this.compose != null && !this.compose.isEmpty(); - } - - /** - * @param value {@link #compose} (When value set includes codes from elsewhere.) - */ - public ValueSet setCompose(ValueSetComposeComponent value) { - this.compose = value; - return this; - } - - /** - * @return {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) - */ - public ValueSetExpansionComponent getExpansion() { - if (this.expansion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.expansion"); - else if (Configuration.doAutoCreate()) - this.expansion = new ValueSetExpansionComponent(); - return this.expansion; - } - - public boolean hasExpansion() { - return this.expansion != null && !this.expansion.isEmpty(); - } - - /** - * @param value {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) - */ - public ValueSet setExpansion(ValueSetExpansionComponent value) { - this.expansion = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "uri", "The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("purpose", "string", "This should describe 'the semantic space' to be included in the value set. This can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, purpose)); - childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contacts of the publisher to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible)); - childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("stableDate", "date", "If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.", 0, java.lang.Integer.MAX_VALUE, stableDate)); - childrenList.add(new Property("define", "", "When value set defines its own codes.", 0, java.lang.Integer.MAX_VALUE, define)); - childrenList.add(new Property("compose", "", "When value set includes codes from elsewhere.", 0, java.lang.Integer.MAX_VALUE, compose)); - childrenList.add(new Property("expansion", "", "A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.", 0, java.lang.Integer.MAX_VALUE, expansion)); - } - - public ValueSet copy() { - ValueSet dst = new ValueSet(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.purpose = purpose == null ? null : purpose.copy(); - dst.immutable = immutable == null ? null : immutable.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.extensible = extensible == null ? null : extensible.copy(); - dst.date = date == null ? null : date.copy(); - dst.stableDate = stableDate == null ? null : stableDate.copy(); - dst.define = define == null ? null : define.copy(); - dst.compose = compose == null ? null : compose.copy(); - dst.expansion = expansion == null ? null : expansion.copy(); - return dst; - } - - protected ValueSet typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (purpose == null || purpose.isEmpty()) && (immutable == null || immutable.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (description == null || description.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (extensible == null || extensible.isEmpty()) && (date == null || date.isEmpty()) && (stableDate == null || stableDate.isEmpty()) - && (define == null || define.isEmpty()) && (compose == null || compose.isEmpty()) && (expansion == null || expansion.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ValueSet; - } - - @SearchParamDefinition(name="system", path="ValueSet.define.system", description="The system for any codes defined by this value set", type="token" ) - public static final String SP_SYSTEM = "system"; - @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" ) - public static final String SP_STATUS = "status"; - @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) - public static final String SP_DESCRIPTION = "description"; - @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) - public static final String SP_NAME = "name"; - @SearchParamDefinition(name="code", path="ValueSet.define.concept.code", description="A code defined in the value set", type="token" ) - public static final String SP_CODE = "code"; - @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" ) - public static final String SP_DATE = "date"; - @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier of the value set", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="token" ) - public static final String SP_REFERENCE = "reference"; - @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" ) - public static final String SP_VERSION = "version"; - -} - + +/* + 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; +/** + * A value set specifies a set of codes drawn from one or more code systems. + */ +@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") +public class ValueSet extends DomainResource { + + public enum ValuesetStatus implements FhirEnum { + /** + * This valueset is still under development. + */ + DRAFT, + /** + * This valueset is ready for normal use. + */ + ACTIVE, + /** + * This valueset has been withdrawn or superceded and should no longer be used. + */ + RETIRED, + /** + * added to help the parsers + */ + NULL; + + 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)) + return DRAFT; + if ("active".equals(codeString)) + return ACTIVE; + if ("retired".equals(codeString)) + return RETIRED; + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DRAFT: return "draft"; + case ACTIVE: return "active"; + case RETIRED: return "retired"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DRAFT: return ""; + case ACTIVE: return ""; + case RETIRED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DRAFT: return "This valueset is still under development."; + case ACTIVE: return "This valueset is ready for normal use."; + case RETIRED: return "This valueset has been withdrawn or superceded and should no longer be used."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DRAFT: return "Draft"; + case ACTIVE: return "Active"; + case RETIRED: return "Retired"; + default: return "?"; + } + } + } + + public static class ValuesetStatusEnumFactory implements EnumFactory { + public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("draft".equals(codeString)) + return ValuesetStatus.DRAFT; + if ("active".equals(codeString)) + return ValuesetStatus.ACTIVE; + if ("retired".equals(codeString)) + return ValuesetStatus.RETIRED; + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); + } + public String toCode(ValuesetStatus code) throws IllegalArgumentException { + if (code == ValuesetStatus.DRAFT) + return "draft"; + if (code == ValuesetStatus.ACTIVE) + return "active"; + if (code == ValuesetStatus.RETIRED) + return "retired"; + return "?"; + } + } + + public enum FilterOperator implements FhirEnum { + /** + * The specified property of the code equals the provided value. + */ + EQUAL, + /** + * The specified property of the code has an is-a relationship with the provided value. + */ + ISA, + /** + * The specified property of the code does not have an is-a relationship with the provided value. + */ + ISNOTA, + /** + * The specified property of the code matches the regex specified in the provided value. + */ + REGEX, + /** + * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). + */ + IN, + /** + * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). + */ + NOTIN, + /** + * added to help the parsers + */ + NULL; + + public static final FilterOperatorEnumFactory ENUM_FACTORY = new FilterOperatorEnumFactory(); + + public static FilterOperator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("=".equals(codeString)) + return EQUAL; + if ("is-a".equals(codeString)) + return ISA; + if ("is-not-a".equals(codeString)) + return ISNOTA; + if ("regex".equals(codeString)) + return REGEX; + if ("in".equals(codeString)) + return IN; + if ("not in".equals(codeString)) + return NOTIN; + throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case EQUAL: return "="; + case ISA: return "is-a"; + case ISNOTA: return "is-not-a"; + case REGEX: return "regex"; + case IN: return "in"; + case NOTIN: return "not in"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case EQUAL: return ""; + case ISA: return ""; + case ISNOTA: return ""; + case REGEX: return ""; + case IN: return ""; + case NOTIN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case EQUAL: return "The specified property of the code equals the provided value."; + case ISA: return "The specified property of the code has an is-a relationship with the provided value."; + case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; + case REGEX: return "The specified property of the code matches the regex specified in the provided value."; + case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; + case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case EQUAL: return "="; + case ISA: return "is-a"; + case ISNOTA: return "is-not-a"; + case REGEX: return "regex"; + case IN: return "in"; + case NOTIN: return "not in"; + default: return "?"; + } + } + } + + public static class FilterOperatorEnumFactory implements EnumFactory { + public FilterOperator fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("=".equals(codeString)) + return FilterOperator.EQUAL; + if ("is-a".equals(codeString)) + return FilterOperator.ISA; + if ("is-not-a".equals(codeString)) + return FilterOperator.ISNOTA; + if ("regex".equals(codeString)) + return FilterOperator.REGEX; + if ("in".equals(codeString)) + return FilterOperator.IN; + if ("not in".equals(codeString)) + return FilterOperator.NOTIN; + throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); + } + public String toCode(FilterOperator code) throws IllegalArgumentException { + if (code == FilterOperator.EQUAL) + return "="; + if (code == FilterOperator.ISA) + return "is-a"; + if (code == FilterOperator.ISNOTA) + return "is-not-a"; + if (code == FilterOperator.REGEX) + return "regex"; + if (code == FilterOperator.IN) + return "in"; + if (code == FilterOperator.NOTIN) + return "not in"; + return "?"; + } + } + + @Block() + public static class ValueSetDefineComponent extends BackboneElement { + /** + * URI to identify the code system. + */ + @Child(name="system", type={UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="URI to identify the code system", formalDefinition="URI to identify the code system." ) + protected UriType system; + + /** + * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + */ + @Child(name="version", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Version of this system", formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked." ) + protected StringType version; + + /** + * If code comparison is case sensitive when codes within this system are compared to each other. + */ + @Child(name="caseSensitive", type={BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." ) + protected BooleanType caseSensitive; + + /** + * Concepts in the code system. + */ + @Child(name="concept", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts in the code system." ) + protected List concept; + + private static final long serialVersionUID = -1109401192L; + + public ValueSetDefineComponent() { + super(); + } + + public ValueSetDefineComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (URI to identify the code system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetDefineComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (URI to identify the code system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ValueSetDefineComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return URI to identify the code system. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value URI to identify the code system. + */ + public ValueSetDefineComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetDefineComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSetDefineComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + */ + public ValueSetDefineComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value + */ + public BooleanType getCaseSensitiveElement() { + if (this.caseSensitive == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetDefineComponent.caseSensitive"); + else if (Configuration.doAutoCreate()) + this.caseSensitive = new BooleanType(); + return this.caseSensitive; + } + + public boolean hasCaseSensitiveElement() { + return this.caseSensitive != null && !this.caseSensitive.isEmpty(); + } + + public boolean hasCaseSensitive() { + return this.caseSensitive != null && !this.caseSensitive.isEmpty(); + } + + /** + * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value + */ + public ValueSetDefineComponent setCaseSensitiveElement(BooleanType value) { + this.caseSensitive = value; + return this; + } + + /** + * @return If code comparison is case sensitive when codes within this system are compared to each other. + */ + public boolean getCaseSensitive() { + return this.caseSensitive == null ? false : this.caseSensitive.getValue(); + } + + /** + * @param value If code comparison is case sensitive when codes within this system are compared to each other. + */ + public ValueSetDefineComponent setCaseSensitive(boolean value) { + if (value == false) + this.caseSensitive = null; + else { + if (this.caseSensitive == null) + this.caseSensitive = new BooleanType(); + this.caseSensitive.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Concepts in the code system.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptDefinitionComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Concepts in the code system.) + */ + // syntactic sugar + public ConceptDefinitionComponent addConcept() { //3 + ConceptDefinitionComponent t = new ConceptDefinitionComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "URI to identify the code system.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive)); + childrenList.add(new Property("concept", "", "Concepts in the code system.", 0, java.lang.Integer.MAX_VALUE, concept)); + } + + public ValueSetDefineComponent copy() { + ValueSetDefineComponent dst = new ValueSetDefineComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptDefinitionComponent i : concept) + dst.concept.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (caseSensitive == null || caseSensitive.isEmpty()) && (concept == null || concept.isEmpty()) + ; + } + + } + + @Block() + public static class ConceptDefinitionComponent extends BackboneElement { + /** + * Code that identifies concept. + */ + @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code that identifies concept", formalDefinition="Code that identifies concept." ) + protected CodeType code; + + /** + * If this code is not for use as a real concept. + */ + @Child(name="abstract_", type={BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If this code is not for use as a real concept", formalDefinition="If this code is not for use as a real concept." ) + protected BooleanType abstract_; + + /** + * Text to Display to the user. + */ + @Child(name="display", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Text to Display to the user", formalDefinition="Text to Display to the user." ) + protected StringType display; + + /** + * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + @Child(name="definition", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Formal Definition", formalDefinition="The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept." ) + protected StringType definition; + + /** + * Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc. + */ + @Child(name="designation", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc." ) + protected List designation; + + /** + * Child Concepts (is-a / contains). + */ + @Child(name="concept", type={ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Child Concepts (is-a / contains)", formalDefinition="Child Concepts (is-a / contains)." ) + protected List concept; + + private static final long serialVersionUID = -318560292L; + + public ConceptDefinitionComponent() { + super(); + } + + public ConceptDefinitionComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code that identifies concept.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptDefinitionComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Code that identifies concept. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code that identifies concept. + */ + public ConceptDefinitionComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public ConceptDefinitionComponent setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return If this code is not for use as a real concept. + */ + public boolean getAbstract() { + return this.abstract_ == null ? false : this.abstract_.getValue(); + } + + /** + * @param value If this code is not for use as a real concept. + */ + public ConceptDefinitionComponent setAbstract(boolean value) { + if (value == false) + this.abstract_ = null; + else { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (Text to Display to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ConceptDefinitionComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return Text to Display to the user. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Text to Display to the user. + */ + public ConceptDefinitionComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public StringType getDefinitionElement() { + if (this.definition == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition"); + else if (Configuration.doAutoCreate()) + this.definition = new StringType(); + return this.definition; + } + + public boolean hasDefinitionElement() { + return this.definition != null && !this.definition.isEmpty(); + } + + public boolean hasDefinition() { + return this.definition != null && !this.definition.isEmpty(); + } + + /** + * @param value {@link #definition} (The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value + */ + public ConceptDefinitionComponent setDefinitionElement(StringType value) { + this.definition = value; + return this; + } + + /** + * @return The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + public String getDefinition() { + return this.definition == null ? null : this.definition.getValue(); + } + + /** + * @param value The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + */ + public ConceptDefinitionComponent setDefinition(String value) { + if (Utilities.noString(value)) + this.definition = null; + else { + if (this.definition == null) + this.definition = new StringType(); + this.definition.setValue(value); + } + return this; + } + + /** + * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (ConceptDefinitionDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + // syntactic sugar + public ConceptDefinitionDesignationComponent addDesignation() { //3 + ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + /** + * @return {@link #concept} (Child Concepts (is-a / contains).) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptDefinitionComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Child Concepts (is-a / contains).) + */ + // syntactic sugar + public ConceptDefinitionComponent addConcept() { //3 + ConceptDefinitionComponent t = new ConceptDefinitionComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Code that identifies concept.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("abstract", "boolean", "If this code is not for use as a real concept.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("display", "string", "Text to Display to the user.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("definition", "string", "The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); + childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); + childrenList.add(new Property("concept", "@ValueSet.define.concept", "Child Concepts (is-a / contains).", 0, java.lang.Integer.MAX_VALUE, concept)); + } + + public ConceptDefinitionComponent copy() { + ConceptDefinitionComponent dst = new ConceptDefinitionComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.display = display == null ? null : display.copy(); + dst.definition = definition == null ? null : definition.copy(); + if (designation != null) { + dst.designation = new ArrayList(); + for (ConceptDefinitionDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptDefinitionComponent i : concept) + dst.concept.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) + && (display == null || display.isEmpty()) && (definition == null || definition.isEmpty()) + && (designation == null || designation.isEmpty()) && (concept == null || concept.isEmpty()) + ; + } + + } + + @Block() + public static class ConceptDefinitionDesignationComponent extends BackboneElement { + /** + * The language this designation is defined for. + */ + @Child(name="language", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Language of the designation", formalDefinition="The language this designation is defined for." ) + protected CodeType language; + + /** + * A code that details how this designation would be used. + */ + @Child(name="use", type={Coding.class}, order=2, min=0, max=1) + @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) + protected Coding use; + + /** + * The text value for this designation. + */ + @Child(name="value", type={StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) + protected StringType value; + + private static final long serialVersionUID = 1515662414L; + + public ConceptDefinitionDesignationComponent() { + super(); + } + + public ConceptDefinitionDesignationComponent(StringType value) { + super(); + this.value = value; + } + + /** + * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public CodeType getLanguageElement() { + if (this.language == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language"); + else if (Configuration.doAutoCreate()) + this.language = new CodeType(); + return this.language; + } + + public boolean hasLanguageElement() { + return this.language != null && !this.language.isEmpty(); + } + + public boolean hasLanguage() { + return this.language != null && !this.language.isEmpty(); + } + + /** + * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value + */ + public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { + this.language = value; + return this; + } + + /** + * @return The language this designation is defined for. + */ + public String getLanguage() { + return this.language == null ? null : this.language.getValue(); + } + + /** + * @param value The language this designation is defined for. + */ + public ConceptDefinitionDesignationComponent setLanguage(String value) { + if (Utilities.noString(value)) + this.language = null; + else { + if (this.language == null) + this.language = new CodeType(); + this.language.setValue(value); + } + return this; + } + + /** + * @return {@link #use} (A code that details how this designation would be used.) + */ + public Coding getUse() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use"); + else if (Configuration.doAutoCreate()) + this.use = new Coding(); + return this.use; + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (A code that details how this designation would be used.) + */ + public ConceptDefinitionDesignationComponent setUse(Coding value) { + this.use = value; + return this; + } + + /** + * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public StringType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new StringType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptDefinitionDesignationComponent setValueElement(StringType value) { + this.value = value; + return this; + } + + /** + * @return The text value for this designation. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The text value for this designation. + */ + public ConceptDefinitionDesignationComponent setValue(String value) { + if (this.value == null) + this.value = new StringType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); + childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ConceptDefinitionDesignationComponent copy() { + ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent(); + copyValues(dst); + dst.language = language == null ? null : language.copy(); + dst.use = use == null ? null : use.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ValueSetComposeComponent extends BackboneElement { + /** + * Includes the contents of the referenced value set as a part of the contents of this value set. + */ + @Child(name="import_", type={UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set." ) + protected List import_; + + /** + * Include one or more codes from a code system. + */ + @Child(name="include", type={}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." ) + protected List include; + + /** + * Exclude one or more codes from the value set. + */ + @Child(name="exclude", type={ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." ) + protected List exclude; + + private static final long serialVersionUID = -703166694L; + + public ValueSetComposeComponent() { + super(); + } + + /** + * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) + */ + public List getImport() { + if (this.import_ == null) + this.import_ = new ArrayList(); + return this.import_; + } + + public boolean hasImport() { + if (this.import_ == null) + return false; + for (UriType item : this.import_) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) + */ + // syntactic sugar + public UriType addImportElement() {//2 + UriType t = new UriType(); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return t; + } + + /** + * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) + */ + public ValueSetComposeComponent addImport(String value) { //1 + UriType t = new UriType(); + t.setValue(value); + if (this.import_ == null) + this.import_ = new ArrayList(); + this.import_.add(t); + return this; + } + + /** + * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set.) + */ + public boolean hasImport(String value) { + if (this.import_ == null) + return false; + for (UriType v : this.import_) + if (v.equals(value)) // uri + return true; + return false; + } + + /** + * @return {@link #include} (Include one or more codes from a code system.) + */ + public List getInclude() { + if (this.include == null) + this.include = new ArrayList(); + return this.include; + } + + public boolean hasInclude() { + if (this.include == null) + return false; + for (ConceptSetComponent item : this.include) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #include} (Include one or more codes from a code system.) + */ + // syntactic sugar + public ConceptSetComponent addInclude() { //3 + ConceptSetComponent t = new ConceptSetComponent(); + if (this.include == null) + this.include = new ArrayList(); + this.include.add(t); + return t; + } + + /** + * @return {@link #exclude} (Exclude one or more codes from the value set.) + */ + public List getExclude() { + if (this.exclude == null) + this.exclude = new ArrayList(); + return this.exclude; + } + + public boolean hasExclude() { + if (this.exclude == null) + return false; + for (ConceptSetComponent item : this.exclude) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exclude} (Exclude one or more codes from the value set.) + */ + // syntactic sugar + public ConceptSetComponent addExclude() { //3 + ConceptSetComponent t = new ConceptSetComponent(); + if (this.exclude == null) + this.exclude = new ArrayList(); + this.exclude.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set.", 0, java.lang.Integer.MAX_VALUE, import_)); + childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include)); + childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude)); + } + + public ValueSetComposeComponent copy() { + ValueSetComposeComponent dst = new ValueSetComposeComponent(); + copyValues(dst); + if (import_ != null) { + dst.import_ = new ArrayList(); + for (UriType i : import_) + dst.import_.add(i.copy()); + }; + if (include != null) { + dst.include = new ArrayList(); + for (ConceptSetComponent i : include) + dst.include.add(i.copy()); + }; + if (exclude != null) { + dst.exclude = new ArrayList(); + for (ConceptSetComponent i : exclude) + dst.exclude.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty()) + && (exclude == null || exclude.isEmpty()); + } + + } + + @Block() + public static class ConceptSetComponent extends BackboneElement { + /** + * The code system from which the selected codes come from. + */ + @Child(name="system", type={UriType.class}, order=1, min=1, max=1) + @Description(shortDefinition="The system the codes come from", formalDefinition="The code system from which the selected codes come from." ) + protected UriType system; + + /** + * The version of the code system that the codes are selected from. + */ + @Child(name="version", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." ) + protected StringType version; + + /** + * Specifies a concept to be included or excluded. + */ + @Child(name="concept", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." ) + protected List concept; + + /** + * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + */ + @Child(name="filter", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." ) + protected List filter; + + private static final long serialVersionUID = -196054471L; + + public ConceptSetComponent() { + super(); + } + + public ConceptSetComponent(UriType system) { + super(); + this.system = system; + } + + /** + * @return {@link #system} (The code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ConceptSetComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The code system from which the selected codes come from. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The code system from which the selected codes come from. + */ + public ConceptSetComponent setSystem(String value) { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + return this; + } + + /** + * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ConceptSetComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of the code system that the codes are selected from. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of the code system that the codes are selected from. + */ + public ConceptSetComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #concept} (Specifies a concept to be included or excluded.) + */ + public List getConcept() { + if (this.concept == null) + this.concept = new ArrayList(); + return this.concept; + } + + public boolean hasConcept() { + if (this.concept == null) + return false; + for (ConceptReferenceComponent item : this.concept) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concept} (Specifies a concept to be included or excluded.) + */ + // syntactic sugar + public ConceptReferenceComponent addConcept() { //3 + ConceptReferenceComponent t = new ConceptReferenceComponent(); + if (this.concept == null) + this.concept = new ArrayList(); + this.concept.add(t); + return t; + } + + /** + * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) + */ + public List getFilter() { + if (this.filter == null) + this.filter = new ArrayList(); + return this.filter; + } + + public boolean hasFilter() { + if (this.filter == null) + return false; + for (ConceptSetFilterComponent item : this.filter) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) + */ + // syntactic sugar + public ConceptSetFilterComponent addFilter() { //3 + ConceptSetFilterComponent t = new ConceptSetFilterComponent(); + if (this.filter == null) + this.filter = new ArrayList(); + this.filter.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "The code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter)); + } + + public ConceptSetComponent copy() { + ConceptSetComponent dst = new ConceptSetComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.version = version == null ? null : version.copy(); + if (concept != null) { + dst.concept = new ArrayList(); + for (ConceptReferenceComponent i : concept) + dst.concept.add(i.copy()); + }; + if (filter != null) { + dst.filter = new ArrayList(); + for (ConceptSetFilterComponent i : filter) + dst.filter.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) + && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty()); + } + + } + + @Block() + public static class ConceptReferenceComponent extends BackboneElement { + /** + * Specifies a code for the concept to be included or excluded. + */ + @Child(name="code", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." ) + protected CodeType code; + + /** + * The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + @Child(name="display", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Test to display for this code for this value set", formalDefinition="The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system." ) + protected StringType display; + + /** + * Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc. + */ + @Child(name="designation", type={ConceptDefinitionDesignationComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc." ) + protected List designation; + + private static final long serialVersionUID = -1513912691L; + + public ConceptReferenceComponent() { + super(); + } + + public ConceptReferenceComponent(CodeType code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ConceptReferenceComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Specifies a code for the concept to be included or excluded. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Specifies a code for the concept to be included or excluded. + */ + public ConceptReferenceComponent setCode(String value) { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + return this; + } + + /** + * @return {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptReferenceComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ConceptReferenceComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + */ + public ConceptReferenceComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + public List getDesignation() { + if (this.designation == null) + this.designation = new ArrayList(); + return this.designation; + } + + public boolean hasDesignation() { + if (this.designation == null) + return false; + for (ConceptDefinitionDesignationComponent item : this.designation) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.) + */ + // syntactic sugar + public ConceptDefinitionDesignationComponent addDesignation() { //3 + ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); + if (this.designation == null) + this.designation = new ArrayList(); + this.designation.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("designation", "@ValueSet.define.concept.designation", "Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); + } + + public ConceptReferenceComponent copy() { + ConceptReferenceComponent dst = new ConceptReferenceComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + if (designation != null) { + dst.designation = new ArrayList(); + for (ConceptDefinitionDesignationComponent i : designation) + dst.designation.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (designation == null || designation.isEmpty()); + } + + } + + @Block() + public static class ConceptSetFilterComponent extends BackboneElement { + /** + * A code that identifies a property defined in the code system. + */ + @Child(name="property", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." ) + protected CodeType property; + + /** + * The kind of operation to perform as a part of the filter criteria. + */ + @Child(name="op", type={CodeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="= | is-a | is-not-a | regex | in | not in", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) + protected Enumeration op; + + /** + * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + */ + @Child(name="value", type={CodeType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Code from the system, or regex criteria", formalDefinition="The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value." ) + protected CodeType value; + + private static final long serialVersionUID = 1985515000L; + + public ConceptSetFilterComponent() { + super(); + } + + public ConceptSetFilterComponent(CodeType property, Enumeration op, CodeType value) { + super(); + this.property = property; + this.op = op; + this.value = value; + } + + /** + * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value + */ + public CodeType getPropertyElement() { + if (this.property == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.property"); + else if (Configuration.doAutoCreate()) + this.property = new CodeType(); + return this.property; + } + + public boolean hasPropertyElement() { + return this.property != null && !this.property.isEmpty(); + } + + public boolean hasProperty() { + return this.property != null && !this.property.isEmpty(); + } + + /** + * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value + */ + public ConceptSetFilterComponent setPropertyElement(CodeType value) { + this.property = value; + return this; + } + + /** + * @return A code that identifies a property defined in the code system. + */ + public String getProperty() { + return this.property == null ? null : this.property.getValue(); + } + + /** + * @param value A code that identifies a property defined in the code system. + */ + public ConceptSetFilterComponent setProperty(String value) { + if (this.property == null) + this.property = new CodeType(); + this.property.setValue(value); + return this; + } + + /** + * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value + */ + public Enumeration getOpElement() { + if (this.op == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.op"); + else if (Configuration.doAutoCreate()) + this.op = new Enumeration(); + return this.op; + } + + public boolean hasOpElement() { + return this.op != null && !this.op.isEmpty(); + } + + public boolean hasOp() { + return this.op != null && !this.op.isEmpty(); + } + + /** + * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value + */ + public ConceptSetFilterComponent setOpElement(Enumeration value) { + this.op = value; + return this; + } + + /** + * @return The kind of operation to perform as a part of the filter criteria. + */ + public FilterOperator getOp() { + return this.op == null ? null : this.op.getValue(); + } + + /** + * @param value The kind of operation to perform as a part of the filter criteria. + */ + public ConceptSetFilterComponent setOp(FilterOperator value) { + if (this.op == null) + this.op = new Enumeration(FilterOperator.ENUM_FACTORY); + this.op.setValue(value); + return this; + } + + /** + * @return {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public CodeType getValueElement() { + if (this.value == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ConceptSetFilterComponent.value"); + else if (Configuration.doAutoCreate()) + this.value = new CodeType(); + return this.value; + } + + public boolean hasValueElement() { + return this.value != null && !this.value.isEmpty(); + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value + */ + public ConceptSetFilterComponent setValueElement(CodeType value) { + this.value = value; + return this; + } + + /** + * @return The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + */ + public String getValue() { + return this.value == null ? null : this.value.getValue(); + } + + /** + * @param value The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + */ + public ConceptSetFilterComponent setValue(String value) { + if (this.value == null) + this.value = new CodeType(); + this.value.setValue(value); + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property)); + childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op)); + childrenList.add(new Property("value", "code", "The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ConceptSetFilterComponent copy() { + ConceptSetFilterComponent dst = new ConceptSetFilterComponent(); + copyValues(dst); + dst.property = property == null ? null : property.copy(); + dst.op = op == null ? null : op.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty()) + && (value == null || value.isEmpty()); + } + + } + + @Block() + public static class ValueSetExpansionComponent extends BackboneElement { + /** + * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + */ + @Child(name="identifier", type={Identifier.class}, order=1, min=0, max=1) + @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." ) + protected Identifier identifier; + + /** + * The time at which the expansion was produced by the expanding system. + */ + @Child(name="timestamp", type={DateTimeType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Time valueset expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." ) + protected DateTimeType timestamp; + + /** + * The codes that are contained in the value set expansion. + */ + @Child(name="contains", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." ) + protected List contains; + + private static final long serialVersionUID = -1193480660L; + + public ValueSetExpansionComponent() { + super(); + } + + public ValueSetExpansionComponent(DateTimeType timestamp) { + super(); + this.timestamp = timestamp; + } + + /** + * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.) + */ + public ValueSetExpansionComponent setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public DateTimeType getTimestampElement() { + if (this.timestamp == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp"); + else if (Configuration.doAutoCreate()) + this.timestamp = new DateTimeType(); + return this.timestamp; + } + + public boolean hasTimestampElement() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + public boolean hasTimestamp() { + return this.timestamp != null && !this.timestamp.isEmpty(); + } + + /** + * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value + */ + public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { + this.timestamp = value; + return this; + } + + /** + * @return The time at which the expansion was produced by the expanding system. + */ + public Date getTimestamp() { + return this.timestamp == null ? null : this.timestamp.getValue(); + } + + /** + * @param value The time at which the expansion was produced by the expanding system. + */ + public ValueSetExpansionComponent setTimestamp(Date value) { + if (this.timestamp == null) + this.timestamp = new DateTimeType(); + this.timestamp.setValue(value); + return this; + } + + /** + * @return {@link #contains} (The codes that are contained in the value set expansion.) + */ + public List getContains() { + if (this.contains == null) + this.contains = new ArrayList(); + return this.contains; + } + + public boolean hasContains() { + if (this.contains == null) + return false; + for (ValueSetExpansionContainsComponent item : this.contains) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contains} (The codes that are contained in the value set expansion.) + */ + // syntactic sugar + public ValueSetExpansionContainsComponent addContains() { //3 + ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp)); + childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains)); + } + + public ValueSetExpansionComponent copy() { + ValueSetExpansionComponent dst = new ValueSetExpansionComponent(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.timestamp = timestamp == null ? null : timestamp.copy(); + if (contains != null) { + dst.contains = new ArrayList(); + for (ValueSetExpansionContainsComponent i : contains) + dst.contains.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) + && (contains == null || contains.isEmpty()); + } + + } + + @Block() + public static class ValueSetExpansionContainsComponent extends BackboneElement { + /** + * The system in which the code for this item in the expansion is defined. + */ + @Child(name="system", type={UriType.class}, order=1, min=0, max=1) + @Description(shortDefinition="System value for the code", formalDefinition="The system in which the code for this item in the expansion is defined." ) + protected UriType system; + + /** + * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + @Child(name="abstract_", type={BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) + protected BooleanType abstract_; + + /** + * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + @Child(name="version", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Version in which this code / display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) + protected StringType version; + + /** + * Code - if blank, this is not a choosable code. + */ + @Child(name="code", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Code - if blank, this is not a choosable code", formalDefinition="Code - if blank, this is not a choosable code." ) + protected CodeType code; + + /** + * User display for the concept. + */ + @Child(name="display", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="User display for the concept", formalDefinition="User display for the concept." ) + protected StringType display; + + /** + * Codes contained in this concept. + */ + @Child(name="contains", type={ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Codes contained in this concept", formalDefinition="Codes contained in this concept." ) + protected List contains; + + private static final long serialVersionUID = -2038349483L; + + public ValueSetExpansionContainsComponent() { + super(); + } + + /** + * @return {@link #system} (The system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public UriType getSystemElement() { + if (this.system == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system"); + else if (Configuration.doAutoCreate()) + this.system = new UriType(); + return this.system; + } + + public boolean hasSystemElement() { + return this.system != null && !this.system.isEmpty(); + } + + public boolean hasSystem() { + return this.system != null && !this.system.isEmpty(); + } + + /** + * @param value {@link #system} (The system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setSystemElement(UriType value) { + this.system = value; + return this; + } + + /** + * @return The system in which the code for this item in the expansion is defined. + */ + public String getSystem() { + return this.system == null ? null : this.system.getValue(); + } + + /** + * @param value The system in which the code for this item in the expansion is defined. + */ + public ValueSetExpansionContainsComponent setSystem(String value) { + if (Utilities.noString(value)) + this.system = null; + else { + if (this.system == null) + this.system = new UriType(); + this.system.setValue(value); + } + return this; + } + + /** + * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public BooleanType getAbstractElement() { + if (this.abstract_ == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_"); + else if (Configuration.doAutoCreate()) + this.abstract_ = new BooleanType(); + return this.abstract_; + } + + public boolean hasAbstractElement() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + public boolean hasAbstract() { + return this.abstract_ != null && !this.abstract_.isEmpty(); + } + + /** + * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { + this.abstract_ = value; + return this; + } + + /** + * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + public boolean getAbstract() { + return this.abstract_ == null ? false : this.abstract_.getValue(); + } + + /** + * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + */ + public ValueSetExpansionContainsComponent setAbstract(boolean value) { + if (value == false) + this.abstract_ = null; + else { + if (this.abstract_ == null) + this.abstract_ = new BooleanType(); + this.abstract_.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + */ + public ValueSetExpansionContainsComponent setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public CodeType getCodeElement() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeType(); + return this.code; + } + + public boolean hasCodeElement() { + return this.code != null && !this.code.isEmpty(); + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Code - if blank, this is not a choosable code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { + this.code = value; + return this; + } + + /** + * @return Code - if blank, this is not a choosable code. + */ + public String getCode() { + return this.code == null ? null : this.code.getValue(); + } + + /** + * @param value Code - if blank, this is not a choosable code. + */ + public ValueSetExpansionContainsComponent setCode(String value) { + if (Utilities.noString(value)) + this.code = null; + else { + if (this.code == null) + this.code = new CodeType(); + this.code.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public StringType getDisplayElement() { + if (this.display == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display"); + else if (Configuration.doAutoCreate()) + this.display = new StringType(); + return this.display; + } + + public boolean hasDisplayElement() { + return this.display != null && !this.display.isEmpty(); + } + + public boolean hasDisplay() { + return this.display != null && !this.display.isEmpty(); + } + + /** + * @param value {@link #display} (User display for the concept.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value + */ + public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { + this.display = value; + return this; + } + + /** + * @return User display for the concept. + */ + public String getDisplay() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value User display for the concept. + */ + public ValueSetExpansionContainsComponent setDisplay(String value) { + if (Utilities.noString(value)) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + /** + * @return {@link #contains} (Codes contained in this concept.) + */ + public List getContains() { + if (this.contains == null) + this.contains = new ArrayList(); + return this.contains; + } + + public boolean hasContains() { + if (this.contains == null) + return false; + for (ValueSetExpansionContainsComponent item : this.contains) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #contains} (Codes contained in this concept.) + */ + // syntactic sugar + public ValueSetExpansionContainsComponent addContains() { //3 + ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); + if (this.contains == null) + this.contains = new ArrayList(); + this.contains.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("system", "uri", "The system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); + childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); + childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("code", "code", "Code - if blank, this is not a choosable code.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("display", "string", "User display for the concept.", 0, java.lang.Integer.MAX_VALUE, display)); + childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Codes contained in this concept.", 0, java.lang.Integer.MAX_VALUE, contains)); + } + + public ValueSetExpansionContainsComponent copy() { + ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent(); + copyValues(dst); + dst.system = system == null ? null : system.copy(); + dst.abstract_ = abstract_ == null ? null : abstract_.copy(); + dst.version = version == null ? null : version.copy(); + dst.code = code == null ? null : code.copy(); + dst.display = display == null ? null : display.copy(); + if (contains != null) { + dst.contains = new ArrayList(); + for (ValueSetExpansionContainsComponent i : contains) + dst.contains.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) + && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) + && (contains == null || contains.isEmpty()); + } + + } + + /** + * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + @Child(name="identifier", type={UriType.class}, order=-1, min=0, max=1) + @Description(shortDefinition="Globally unique logical id for value set", formalDefinition="The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)." ) + protected UriType identifier; + + /** + * The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + @Child(name="version", type={StringType.class}, order=0, min=0, max=1) + @Description(shortDefinition="Logical id for this version of the value set", formalDefinition="The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) + protected StringType version; + + /** + * A free text natural language name describing the value set. + */ + @Child(name="name", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." ) + protected StringType name; + + /** + * This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set. + */ + @Child(name="purpose", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Textual description of the intended scope and use", formalDefinition="This should describe 'the semantic space' to be included in the value set. This can also describe the approach taken to build the value set." ) + protected StringType purpose; + + /** + * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + @Child(name="immutable", type={BooleanType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Indicates whether or not any change to the content logical definition may occur", formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change." ) + protected BooleanType immutable; + + /** + * The name of the individual or organization that published the value set. + */ + @Child(name="publisher", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the value set." ) + protected StringType publisher; + + /** + * Contacts of the publisher to assist a user in finding and communicating with the publisher. + */ + @Child(name="telecom", type={ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contacts of the publisher to assist a user in finding and communicating with the publisher." ) + protected List telecom; + + /** + * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set. + */ + @Child(name="description", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set." ) + protected StringType description; + + /** + * A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set. + */ + @Child(name="copyright", type={StringType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Publishing restrictions for the value set", formalDefinition="A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set." ) + protected StringType copyright; + + /** + * The status of the value set. + */ + @Child(name="status", type={CodeType.class}, order=8, min=1, max=1) + @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." ) + protected Enumeration status; + + /** + * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + @Child(name="experimental", type={BooleanType.class}, order=9, min=0, max=1) + @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) + protected BooleanType experimental; + + /** + * Whether this is intended to be used with an extensible binding or not. + */ + @Child(name="extensible", type={BooleanType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." ) + protected BooleanType extensible; + + /** + * The date that the value set status was last changed. + */ + @Child(name="date", type={DateTimeType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed." ) + protected DateTimeType date; + + /** + * If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. + */ + @Child(name="stableDate", type={DateType.class}, order=12, min=0, max=1) + @Description(shortDefinition="Fixed date for the version of all referenced code systems and value sets", formalDefinition="If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date." ) + protected DateType stableDate; + + /** + * When value set defines its own codes. + */ + @Child(name="define", type={}, order=13, min=0, max=1) + @Description(shortDefinition="When value set defines its own codes", formalDefinition="When value set defines its own codes." ) + protected ValueSetDefineComponent define; + + /** + * When value set includes codes from elsewhere. + */ + @Child(name="compose", type={}, order=14, min=0, max=1) + @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="When value set includes codes from elsewhere." ) + protected ValueSetComposeComponent compose; + + /** + * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. + */ + @Child(name="expansion", type={}, order=15, min=0, max=1) + @Description(shortDefinition="Used when the value set is 'expanded'", formalDefinition="A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed." ) + protected ValueSetExpansionComponent expansion; + + private static final long serialVersionUID = -1119903575L; + + public ValueSet() { + super(); + } + + public ValueSet(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public UriType getIdentifierElement() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new UriType(); + return this.identifier; + } + + public boolean hasIdentifierElement() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value + */ + public ValueSet setIdentifierElement(UriType value) { + this.identifier = value; + return this; + } + + /** + * @return The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public String getIdentifier() { + return this.identifier == null ? null : this.identifier.getValue(); + } + + /** + * @param value The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI). + */ + public ValueSet setIdentifier(String value) { + if (Utilities.noString(value)) + this.identifier = null; + else { + if (this.identifier == null) + this.identifier = new UriType(); + this.identifier.setValue(value); + } + return this; + } + + /** + * @return {@link #version} (The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public StringType getVersionElement() { + if (this.version == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.version"); + else if (Configuration.doAutoCreate()) + this.version = new StringType(); + return this.version; + } + + public boolean hasVersionElement() { + return this.version != null && !this.version.isEmpty(); + } + + public boolean hasVersion() { + return this.version != null && !this.version.isEmpty(); + } + + /** + * @param value {@link #version} (The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value + */ + public ValueSet setVersionElement(StringType value) { + this.version = value; + return this; + } + + /** + * @return The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public String getVersion() { + return this.version == null ? null : this.version.getValue(); + } + + /** + * @param value The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + */ + public ValueSet setVersion(String value) { + if (Utilities.noString(value)) + this.version = null; + else { + if (this.version == null) + this.version = new StringType(); + this.version.setValue(value); + } + return this; + } + + /** + * @return {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + 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} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ValueSet setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return A free text natural language name describing the value set. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value A free text natural language name describing the value set. + */ + public ValueSet setName(String value) { + if (Utilities.noString(value)) + this.name = null; + else { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + } + return this; + } + + /** + * @return {@link #purpose} (This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public StringType getPurposeElement() { + if (this.purpose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.purpose"); + else if (Configuration.doAutoCreate()) + this.purpose = new StringType(); + return this.purpose; + } + + public boolean hasPurposeElement() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + public boolean hasPurpose() { + return this.purpose != null && !this.purpose.isEmpty(); + } + + /** + * @param value {@link #purpose} (This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value + */ + public ValueSet setPurposeElement(StringType value) { + this.purpose = value; + return this; + } + + /** + * @return This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set. + */ + public String getPurpose() { + return this.purpose == null ? null : this.purpose.getValue(); + } + + /** + * @param value This should describe "the semantic space" to be included in the value set. This can also describe the approach taken to build the value set. + */ + public ValueSet setPurpose(String value) { + if (Utilities.noString(value)) + this.purpose = null; + else { + if (this.purpose == null) + this.purpose = new StringType(); + this.purpose.setValue(value); + } + return this; + } + + /** + * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value + */ + public BooleanType getImmutableElement() { + if (this.immutable == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.immutable"); + else if (Configuration.doAutoCreate()) + this.immutable = new BooleanType(); + return this.immutable; + } + + public boolean hasImmutableElement() { + return this.immutable != null && !this.immutable.isEmpty(); + } + + public boolean hasImmutable() { + return this.immutable != null && !this.immutable.isEmpty(); + } + + /** + * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value + */ + public ValueSet setImmutableElement(BooleanType value) { + this.immutable = value; + return this; + } + + /** + * @return If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + public boolean getImmutable() { + return this.immutable == null ? false : this.immutable.getValue(); + } + + /** + * @param value If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + */ + public ValueSet setImmutable(boolean value) { + if (value == false) + this.immutable = null; + else { + if (this.immutable == null) + this.immutable = new BooleanType(); + this.immutable.setValue(value); + } + return this; + } + + /** + * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public StringType getPublisherElement() { + if (this.publisher == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.publisher"); + else if (Configuration.doAutoCreate()) + this.publisher = new StringType(); + return this.publisher; + } + + public boolean hasPublisherElement() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + public boolean hasPublisher() { + return this.publisher != null && !this.publisher.isEmpty(); + } + + /** + * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value + */ + public ValueSet setPublisherElement(StringType value) { + this.publisher = value; + return this; + } + + /** + * @return The name of the individual or organization that published the value set. + */ + public String getPublisher() { + return this.publisher == null ? null : this.publisher.getValue(); + } + + /** + * @param value The name of the individual or organization that published the value set. + */ + public ValueSet setPublisher(String value) { + if (Utilities.noString(value)) + this.publisher = null; + else { + if (this.publisher == null) + this.publisher = new StringType(); + this.publisher.setValue(value); + } + return this; + } + + /** + * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (Contacts of the publisher to assist a user in finding and communicating with the publisher.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set.). 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 ValueSet.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} (A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ValueSet setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set. + */ + public ValueSet setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #copyright} (A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public StringType getCopyrightElement() { + if (this.copyright == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.copyright"); + else if (Configuration.doAutoCreate()) + this.copyright = new StringType(); + return this.copyright; + } + + public boolean hasCopyrightElement() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + public boolean hasCopyright() { + return this.copyright != null && !this.copyright.isEmpty(); + } + + /** + * @param value {@link #copyright} (A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value + */ + public ValueSet setCopyrightElement(StringType value) { + this.copyright = value; + return this; + } + + /** + * @return A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set. + */ + public String getCopyright() { + return this.copyright == null ? null : this.copyright.getValue(); + } + + /** + * @param value A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set. + */ + public ValueSet setCopyright(String value) { + if (Utilities.noString(value)) + this.copyright = null; + else { + if (this.copyright == null) + this.copyright = new StringType(); + this.copyright.setValue(value); + } + return this; + } + + /** + * @return {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + 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 value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public ValueSet setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the value set. + */ + public ValuesetStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the value set. + */ + public ValueSet setStatus(ValuesetStatus value) { + if (this.status == null) + this.status = new Enumeration(ValuesetStatus.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public BooleanType getExperimentalElement() { + if (this.experimental == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.experimental"); + else if (Configuration.doAutoCreate()) + this.experimental = new BooleanType(); + return this.experimental; + } + + public boolean hasExperimentalElement() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + public boolean hasExperimental() { + return this.experimental != null && !this.experimental.isEmpty(); + } + + /** + * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value + */ + public ValueSet setExperimentalElement(BooleanType value) { + this.experimental = value; + return this; + } + + /** + * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public boolean getExperimental() { + return this.experimental == null ? false : this.experimental.getValue(); + } + + /** + * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + */ + public ValueSet setExperimental(boolean value) { + if (value == false) + this.experimental = null; + else { + if (this.experimental == null) + this.experimental = new BooleanType(); + this.experimental.setValue(value); + } + return this; + } + + /** + * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value + */ + public BooleanType getExtensibleElement() { + if (this.extensible == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.extensible"); + else if (Configuration.doAutoCreate()) + this.extensible = new BooleanType(); + return this.extensible; + } + + public boolean hasExtensibleElement() { + return this.extensible != null && !this.extensible.isEmpty(); + } + + public boolean hasExtensible() { + return this.extensible != null && !this.extensible.isEmpty(); + } + + /** + * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value + */ + public ValueSet setExtensibleElement(BooleanType value) { + this.extensible = value; + return this; + } + + /** + * @return Whether this is intended to be used with an extensible binding or not. + */ + public boolean getExtensible() { + return this.extensible == null ? false : this.extensible.getValue(); + } + + /** + * @param value Whether this is intended to be used with an extensible binding or not. + */ + public ValueSet setExtensible(boolean value) { + if (value == false) + this.extensible = null; + else { + if (this.extensible == null) + this.extensible = new BooleanType(); + this.extensible.setValue(value); + } + return this; + } + + /** + * @return {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The date that the value set status was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ValueSet setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The date that the value set status was last changed. + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The date that the value set status was last changed. + */ + public ValueSet setDate(Date value) { + if (value == null) + this.date = null; + else { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + } + return this; + } + + /** + * @return {@link #stableDate} (If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.). This is the underlying object with id, value and extensions. The accessor "getStableDate" gives direct access to the value + */ + public DateType getStableDateElement() { + if (this.stableDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.stableDate"); + else if (Configuration.doAutoCreate()) + this.stableDate = new DateType(); + return this.stableDate; + } + + public boolean hasStableDateElement() { + return this.stableDate != null && !this.stableDate.isEmpty(); + } + + public boolean hasStableDate() { + return this.stableDate != null && !this.stableDate.isEmpty(); + } + + /** + * @param value {@link #stableDate} (If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.). This is the underlying object with id, value and extensions. The accessor "getStableDate" gives direct access to the value + */ + public ValueSet setStableDateElement(DateType value) { + this.stableDate = value; + return this; + } + + /** + * @return If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. + */ + public Date getStableDate() { + return this.stableDate == null ? null : this.stableDate.getValue(); + } + + /** + * @param value If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. + */ + public ValueSet setStableDate(Date value) { + if (value == null) + this.stableDate = null; + else { + if (this.stableDate == null) + this.stableDate = new DateType(); + this.stableDate.setValue(value); + } + return this; + } + + /** + * @return {@link #define} (When value set defines its own codes.) + */ + public ValueSetDefineComponent getDefine() { + if (this.define == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.define"); + else if (Configuration.doAutoCreate()) + this.define = new ValueSetDefineComponent(); + return this.define; + } + + public boolean hasDefine() { + return this.define != null && !this.define.isEmpty(); + } + + /** + * @param value {@link #define} (When value set defines its own codes.) + */ + public ValueSet setDefine(ValueSetDefineComponent value) { + this.define = value; + return this; + } + + /** + * @return {@link #compose} (When value set includes codes from elsewhere.) + */ + public ValueSetComposeComponent getCompose() { + if (this.compose == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.compose"); + else if (Configuration.doAutoCreate()) + this.compose = new ValueSetComposeComponent(); + return this.compose; + } + + public boolean hasCompose() { + return this.compose != null && !this.compose.isEmpty(); + } + + /** + * @param value {@link #compose} (When value set includes codes from elsewhere.) + */ + public ValueSet setCompose(ValueSetComposeComponent value) { + this.compose = value; + return this; + } + + /** + * @return {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) + */ + public ValueSetExpansionComponent getExpansion() { + if (this.expansion == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ValueSet.expansion"); + else if (Configuration.doAutoCreate()) + this.expansion = new ValueSetExpansionComponent(); + return this.expansion; + } + + public boolean hasExpansion() { + return this.expansion != null && !this.expansion.isEmpty(); + } + + /** + * @param value {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) + */ + public ValueSet setExpansion(ValueSetExpansionComponent value) { + this.expansion = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "uri", "The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); + childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("purpose", "string", "This should describe 'the semantic space' to be included in the value set. This can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, purpose)); + childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable)); + childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher)); + childrenList.add(new Property("telecom", "ContactPoint", "Contacts of the publisher to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, conditions of use, etc. The description may include a list of expected usages for the value set.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("copyright", "string", "A copyright statement relating to the value set and/or its contents. These are generally legal restrictions on the use and publishing of the value set.", 0, java.lang.Integer.MAX_VALUE, copyright)); + childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); + childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible)); + childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("stableDate", "date", "If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date.", 0, java.lang.Integer.MAX_VALUE, stableDate)); + childrenList.add(new Property("define", "", "When value set defines its own codes.", 0, java.lang.Integer.MAX_VALUE, define)); + childrenList.add(new Property("compose", "", "When value set includes codes from elsewhere.", 0, java.lang.Integer.MAX_VALUE, compose)); + childrenList.add(new Property("expansion", "", "A value set can also be 'expanded', where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.", 0, java.lang.Integer.MAX_VALUE, expansion)); + } + + public ValueSet copy() { + ValueSet dst = new ValueSet(); + copyValues(dst); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.version = version == null ? null : version.copy(); + dst.name = name == null ? null : name.copy(); + dst.purpose = purpose == null ? null : purpose.copy(); + dst.immutable = immutable == null ? null : immutable.copy(); + dst.publisher = publisher == null ? null : publisher.copy(); + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.description = description == null ? null : description.copy(); + dst.copyright = copyright == null ? null : copyright.copy(); + dst.status = status == null ? null : status.copy(); + dst.experimental = experimental == null ? null : experimental.copy(); + dst.extensible = extensible == null ? null : extensible.copy(); + dst.date = date == null ? null : date.copy(); + dst.stableDate = stableDate == null ? null : stableDate.copy(); + dst.define = define == null ? null : define.copy(); + dst.compose = compose == null ? null : compose.copy(); + dst.expansion = expansion == null ? null : expansion.copy(); + return dst; + } + + protected ValueSet typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) + && (name == null || name.isEmpty()) && (purpose == null || purpose.isEmpty()) && (immutable == null || immutable.isEmpty()) + && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (description == null || description.isEmpty()) + && (copyright == null || copyright.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) + && (extensible == null || extensible.isEmpty()) && (date == null || date.isEmpty()) && (stableDate == null || stableDate.isEmpty()) + && (define == null || define.isEmpty()) && (compose == null || compose.isEmpty()) && (expansion == null || expansion.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ValueSet; + } + + @SearchParamDefinition(name="system", path="ValueSet.define.system", description="The system for any codes defined by this value set", type="token" ) + public static final String SP_SYSTEM = "system"; + @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) + public static final String SP_DESCRIPTION = "description"; + @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="code", path="ValueSet.define.concept.code", description="A code defined in the value set", type="token" ) + public static final String SP_CODE = "code"; + @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier of the value set", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="token" ) + public static final String SP_REFERENCE = "reference"; + @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) + public static final String SP_PUBLISHER = "publisher"; + @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" ) + public static final String SP_VERSION = "version"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java index 42a060ad9f6..6702b40da17 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java @@ -20,3788 +20,3788 @@ package org.hl7.fhir.instance.model; * #L% */ - -/* - 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 java.math.*; -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; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="VisionClaim", profile="http://hl7.org/fhir/Profile/VisionClaim") -public class VisionClaim extends DomainResource { - - public enum UseLink implements FhirEnum { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - - 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)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - @Override - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return ""; - case PROPOSED: return ""; - case EXPLORATORY: return ""; - case OTHER: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - } - - public static class UseLinkEnumFactory implements EnumFactory { - public UseLink fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return UseLink.COMPLETE; - if ("proposed".equals(codeString)) - return UseLink.PROPOSED; - if ("exploratory".equals(codeString)) - return UseLink.EXPLORATORY; - if ("other".equals(codeString)) - return UseLink.OTHER; - throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); - } - public String toCode(UseLink code) throws IllegalArgumentException { - if (code == UseLink.COMPLETE) - return "complete"; - if (code == UseLink.PROPOSED) - return "proposed"; - if (code == UseLink.EXPLORATORY) - return "exploratory"; - if (code == UseLink.OTHER) - return "other"; - return "?"; - } - } - - @Block() - public static class PayeeComponent extends BackboneElement { - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name="type", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) - @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Practitioner providerTarget; - - /** - * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Organization organizationTarget; - - /** - * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). - */ - @Child(name="person", type={Patient.class}, order=4, min=0, max=1) - @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) - protected Reference person; - - /** - * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - protected Patient personTarget; - - private static final long serialVersionUID = -503108488L; - - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Reference getPerson() { - if (this.person == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.person = new Reference(); - return this.person; - } - - public boolean hasPerson() { - return this.person != null && !this.person.isEmpty(); - } - - /** - * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPerson(Reference value) { - this.person = value; - return this; - } - - /** - * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public Patient getPersonTarget() { - if (this.personTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.person"); - else if (Configuration.doAutoCreate()) - this.personTarget = new Patient(); - return this.personTarget; - } - - /** - * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) - */ - public PayeeComponent setPersonTarget(Patient value) { - this.personTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.person = person == null ? null : person.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) - ; - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement { - /** - * Sequence of diagnosis. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) - protected IntegerType sequence; - - /** - * The diagnosis. - */ - @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -935927954L; - - public DiagnosisComponent() { - super(); - } - - public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement { - /** - * A service line item. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected IntegerType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The contract number of a business agrement which describes the terms and conditions. - */ - @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preauthref; - - /** - * The Coverages adjudication details. - */ - @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - private static final long serialVersionUID = 450222500L; - - public CoverageComponent() { - super(); - } - - public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public boolean getFocal() { - return this.focal == null ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); - return this.coverageTarget; - } - - /** - * @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 CoverageComponent setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agrement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agrement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public CoverageComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreauthref() { - if (this.preauthref == null) - this.preauthref = new ArrayList(); - return this.preauthref; - } - - public boolean hasPreauthref() { - if (this.preauthref == null) - return false; - for (StringType item : this.preauthref) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreauthrefElement() {//2 - StringType t = new StringType(); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return t; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreauthref(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preauthref == null) - this.preauthref = new ArrayList(); - this.preauthref.add(t); - return this; - } - - /** - * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreauthref(String value) { - if (this.preauthref == null) - return false; - for (StringType v : this.preauthref) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} 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 Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} 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 Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - 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)); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (preauthref != null) { - dst.preauthref = new ArrayList(); - for (StringType i : preauthref) - dst.preauthref.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - ; - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; - - /** - * Second tier of goods and services. - */ - @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 detail; - - private static final long serialVersionUID = -1140048455L; - - public ItemsComponent() { - super(); - } - - public ItemsComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 ItemsComponent setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - 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(); - 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(); - 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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public DateType getServiceDateElement() { - if (this.serviceDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); - else if (Configuration.doAutoCreate()) - this.serviceDate = new DateType(); - return this.serviceDate; - } - - public boolean hasServiceDateElement() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - public boolean hasServiceDate() { - return this.serviceDate != null && !this.serviceDate.isEmpty(); - } - - /** - * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value - */ - public ItemsComponent setServiceDateElement(DateType value) { - this.serviceDate = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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(Date value) { - if (value == null) - this.serviceDate = null; - else { - if (this.serviceDate == null) - this.serviceDate = new DateType(); - this.serviceDate.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public ItemsComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubsite() { - if (this.subsite == null) - this.subsite = new ArrayList(); - return this.subsite; - } - - public boolean hasSubsite() { - if (this.subsite == null) - return false; - for (Coding item : this.subsite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubsite() { //3 - Coding t = new Coding(); - if (this.subsite == null) - this.subsite = new ArrayList(); - this.subsite.add(t); - return t; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - 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(); - 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(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subsite != null) { - dst.subsite = new ArrayList(); - for (Coding i : subsite) - dst.subsite.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) - && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); - } - - } - - @Block() - public static class DetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * 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=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Total additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - /** - * Third tier of goods and services. - */ - @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -342502025L; - - public DetailComponent() { - super(); - } - - public DetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @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.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (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.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (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.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public DetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement { - /** - * A service line number. - */ - @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequence; - - /** - * The type of product or service. - */ - @Child(name="type", type={Coding.class}, order=2, min=1, max=1) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="service", type={Coding.class}, order=3, min=1, max=1) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) - protected Coding service; - - /** - * The number of repetitions of a service or product. - */ - @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected Quantity quantity; - - /** - * The fee for an addtional service or product or charge. - */ - @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) - 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=6, 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=7, 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=8, min=0, max=1) - @Description(shortDefinition="Net additional 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=9, min=0, max=1) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected Coding udi; - - private static final long serialVersionUID = 122809194L; - - public SubDetailComponent() { - super(); - } - - public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null ? null : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addtional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return 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. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value 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. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @return {@link #net} (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.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (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.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public Coding getUdi() { - if (this.udi == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.udi"); - else if (Configuration.doAutoCreate()) - this.udi = new Coding(); - return this.udi; - } - - public boolean hasUdi() { - return this.udi != null && !this.udi.isEmpty(); - } - - /** - * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public SubDetailComponent setUdi(Coding value) { - this.udi = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - dst.udi = udi == null ? null : udi.copy(); - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.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()); - } - - } - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @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 DateTimeType created; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) - */ - protected Organization targetTarget; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - protected Organization organizationTarget; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - protected Practitioner entererTarget; - - /** - * Facility where the services were provided. - */ - @Child(name="facility", type={Location.class}, order=10, min=0, max=1) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Reference facility; - - /** - * The actual object that is the target of the reference (Facility where the services were provided.) - */ - protected Location facilityTarget; - - /** - * Theparty to be reimbused for the services. - */ - @Child(name="payee", type={}, order=11, min=0, max=1) - @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Reference referral; - - /** - * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - protected ReferralRequest referralTarget; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * List of patient conditions for which care is sought. - */ - @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) - protected List condition; - - /** - * Patient Resource. - */ - @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient patientTarget; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name="school", type={StringType.class}, order=18, min=0, max=1) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * Date of an accident which these services are addessing. - */ - @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) - @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) - protected DateType accident; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) - @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * First tier of goods and services. - */ - @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) - @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 additionalMaterials; - - private static final long serialVersionUID = 1113876752L; - - public VisionClaim() { - super(); - } - - public VisionClaim(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public VisionClaim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public VisionClaim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @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 DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @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 VisionClaim setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - 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 VisionClaim setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public VisionClaim setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); - return this.targetTarget; - } - - /** - * @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. (Insurer Identifier, typical BIN number (6 digit).) - */ - public VisionClaim setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public VisionClaim setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); - return this.providerTarget; - } - - /** - * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public VisionClaim setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public VisionClaim setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); - return this.organizationTarget; - } - - /** - * @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 bill, claim pre-determination, pre-authorization.) - */ - public VisionClaim setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(); - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public VisionClaim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public UseLink getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public VisionClaim setUse(UseLink value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(UseLink.ENUM_FACTORY); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public VisionClaim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public VisionClaim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public VisionClaim setEnterer(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); - return this.entererTarget; - } - - /** - * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public VisionClaim setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacility() { - if (this.facility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facility = new Reference(); - return this.facility; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public VisionClaim setFacility(Reference value) { - this.facility = value; - return this; - } - - /** - * @return {@link #facility} 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. (Facility where the services were provided.) - */ - public Location getFacilityTarget() { - if (this.facilityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.facility"); - else if (Configuration.doAutoCreate()) - this.facilityTarget = new Location(); - return this.facilityTarget; - } - - /** - * @param value {@link #facility} 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. (Facility where the services were provided.) - */ - public VisionClaim setFacilityTarget(Location value) { - this.facilityTarget = value; - return this; - } - - /** - * @return {@link #payee} (Theparty to be reimbused for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (Theparty to be reimbused for the services.) - */ - public VisionClaim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferral() { - if (this.referral == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referral = new Reference(); - return this.referral; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public VisionClaim setReferral(Reference value) { - this.referral = value; - return this; - } - - /** - * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ReferralRequest getReferralTarget() { - if (this.referralTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.referral"); - else if (Configuration.doAutoCreate()) - this.referralTarget = new ReferralRequest(); - return this.referralTarget; - } - - /** - * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public VisionClaim setReferralTarget(ReferralRequest value) { - this.referralTarget = value; - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Coding item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (List of patient conditions for which care is sought.) - */ - // syntactic sugar - public Coding addCondition() { //3 - Coding t = new Coding(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.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} (Patient Resource.) - */ - public VisionClaim 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. (Patient Resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.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. (Patient Resource.) - */ - public VisionClaim setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public VisionClaim setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public VisionClaim setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public DateType getAccidentElement() { - if (this.accident == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.accident"); - else if (Configuration.doAutoCreate()) - this.accident = new DateType(); - return this.accident; - } - - public boolean hasAccidentElement() { - return this.accident != null && !this.accident.isEmpty(); - } - - public boolean hasAccident() { - return this.accident != null && !this.accident.isEmpty(); - } - - /** - * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value - */ - public VisionClaim setAccidentElement(DateType value) { - this.accident = value; - return this; - } - - /** - * @return Date of an accident which these services are addessing. - */ - public Date getAccident() { - return this.accident == null ? null : this.accident.getValue(); - } - - /** - * @param value Date of an accident which these services are addessing. - */ - public VisionClaim setAccident(Date value) { - if (value == null) - this.accident = null; - else { - if (this.accident == null) - this.accident = new DateType(); - this.accident.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionClaim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public VisionClaim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterials() { - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - return this.additionalMaterials; - } - - public boolean hasAdditionalMaterials() { - if (this.additionalMaterials == null) - return false; - for (Coding item : this.additionalMaterials) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterials() { //3 - Coding t = new Coding(); - if (this.additionalMaterials == null) - this.additionalMaterials = new ArrayList(); - this.additionalMaterials.add(t); - return t; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - 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("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)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); - } - - public VisionClaim copy() { - VisionClaim dst = new VisionClaim(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Coding i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.accident = accident == null ? null : accident.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (additionalMaterials != null) { - dst.additionalMaterials = new ArrayList(); - for (Coding i : additionalMaterials) - dst.additionalMaterials.add(i.copy()); - }; - return dst; - } - - protected VisionClaim typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) - && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.VisionClaim; - } - - @SearchParamDefinition(name="patient", path="VisionClaim.patient", description="Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="priority", path="VisionClaim.priority", description="Processing priority requested", type="token" ) - public static final String SP_PRIORITY = "priority"; - @SearchParamDefinition(name="use", path="VisionClaim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - @SearchParamDefinition(name="identifier", path="VisionClaim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - + +/* + 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 java.math.*; +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; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="VisionClaim", profile="http://hl7.org/fhir/Profile/VisionClaim") +public class VisionClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + 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)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @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 CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} 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 Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} 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 Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + 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)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + 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 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=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=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=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=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=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=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=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=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=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=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 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=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 modifier; + + /** + * Second tier of goods and services. + */ + @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 detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + 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(); + 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(); + 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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + 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(); + 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(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.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()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * 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=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", 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 number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, 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=5, 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Total additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @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.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (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.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (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.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + 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=6, 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=7, 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=8, min=0, max=1) + @Description(shortDefinition="Net additional 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=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (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.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (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.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return 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. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value 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. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (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.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (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.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "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.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "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.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.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()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @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 DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @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 additionalMaterials; + + private static final long serialVersionUID = 1113876752L; + + public VisionClaim() { + super(); + } + + public VisionClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + 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} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public VisionClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public VisionClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @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 DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @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 VisionClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + 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 VisionClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public VisionClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} 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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @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. (Insurer Identifier, typical BIN number (6 digit).) + */ + public VisionClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} 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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @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 provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} 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 organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @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 bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public VisionClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public VisionClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public VisionClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public VisionClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public VisionClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} 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. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public VisionClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public VisionClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} 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. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} 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. (Facility where the services were provided.) + */ + public VisionClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public VisionClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public VisionClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} 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 referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public VisionClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.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} (Patient Resource.) + */ + public VisionClaim 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. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.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. (Patient Resource.) + */ + public VisionClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public VisionClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public VisionClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public VisionClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public VisionClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public VisionClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + 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("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)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public VisionClaim copy() { + VisionClaim dst = new VisionClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.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(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected VisionClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.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()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.VisionClaim; + } + + @SearchParamDefinition(name="patient", path="VisionClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="VisionClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="VisionClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="VisionClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CSFile.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CSFile.java index 8a8d50600d3..149b701a468 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CSFile.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/CSFile.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.utilities; /* @@ -48,45 +48,45 @@ package org.hl7.fhir.utilities; * #L% */ - -import java.io.File; -import java.io.IOException; - -/** - * Extends the usual Java File to make it case-sensitive: if the file to be opened has - * a different casing in the filesystem (but is found anyway base Windows is case-insensitive), - * the constructor will throw. Allows early detection of miscased filenames. - * @author Ewout - * - */ -public class CSFile extends File { - private static final long serialVersionUID = -2017155765132460726L; - - public CSFile(String pathname) throws IOException { - super(pathname); - -// if (exists() && getParent() != null) -// { -// String n = getName(); -// File f = new File(getParent()); -// String[] l = f.list(); -// boolean ok = false; -// for (String n1 : l) { -// if (n1.equals(n)) -// ok = true; -// } -// if (!ok) -// throw new Error("Case mismatch of file "+ pathname); -// } - - //EK: Original code above looked extremely wasteful: every single - //attempt to open a file triggers a directory listing - if (exists()) - { - if(!this.getCanonicalFile().getName().equals(this.getName())) - throw new Error("Case mismatch of file "+ pathname); - } - } - - -} + +import java.io.File; +import java.io.IOException; + +/** + * Extends the usual Java File to make it case-sensitive: if the file to be opened has + * a different casing in the filesystem (but is found anyway base Windows is case-insensitive), + * the constructor will throw. Allows early detection of miscased filenames. + * @author Ewout + * + */ +public class CSFile extends File { + private static final long serialVersionUID = -2017155765132460726L; + + public CSFile(String pathname) throws IOException { + super(pathname); + +// if (exists() && getParent() != null) +// { +// String n = getName(); +// File f = new File(getParent()); +// String[] l = f.list(); +// boolean ok = false; +// for (String n1 : l) { +// if (n1.equals(n)) +// ok = true; +// } +// if (!ok) +// throw new Error("Case mismatch of file "+ pathname); +// } + + //EK: Original code above looked extremely wasteful: every single + //attempt to open a file triggers a directory listing + if (exists()) + { + if(!this.getCanonicalFile().getName().equals(this.getName())) + throw new Error("Case mismatch of file "+ pathname); + } + } + + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/FileNotifier.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/FileNotifier.java index 467bf519ca4..eebd3ee2c0d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/FileNotifier.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/FileNotifier.java @@ -20,9 +20,9 @@ package org.hl7.fhir.utilities; * #L% */ - -public interface FileNotifier { - - public void copyFile(String src, String dst); - -} + +public interface FileNotifier { + + public void copyFile(String src, String dst); + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Inflector.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Inflector.java index b32ad61f179..698aedff7fc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Inflector.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Inflector.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.utilities; /* @@ -48,593 +48,593 @@ package org.hl7.fhir.utilities; * #L% */ - -/* - * JBoss DNA (http://www.jboss.org/dna) - * See the COPYRIGHT.txt file distributed with this work for information - * regarding copyright ownership. Some portions may be licensed - * to Red Hat, Inc. under one or more contributor license agreements. - * See the AUTHORS.txt file in the distribution for a full listing of - * individual contributors. - * - * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA - * is licensed to you under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * JBoss DNA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import java.util.HashSet; -import java.util.LinkedList; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Transforms words to singular, plural, humanized (human readable), underscore, camel case, or ordinal form. This is inspired by - * the Inflector class in Ruby on Rails, which is distributed under the Rails license. - * - * @author Randall Hauch - */ -public class Inflector { - - protected static final Inflector INSTANCE = new Inflector(); - - public static final Inflector getInstance() { - return INSTANCE; - } - - protected class Rule { - - protected final String expression; - protected final Pattern expressionPattern; - protected final String replacement; - - protected Rule( String expression, - String replacement ) { - this.expression = expression; - this.replacement = replacement != null ? replacement : ""; - this.expressionPattern = Pattern.compile(this.expression, Pattern.CASE_INSENSITIVE); - } - - /** - * Apply the rule against the input string, returning the modified string or null if the rule didn't apply (and no - * modifications were made) - * - * @param input the input string - * @return the modified string if this rule applied, or null if the input was not modified by this rule - */ - protected String apply( String input ) { - Matcher matcher = this.expressionPattern.matcher(input); - if (!matcher.find()) return null; - return matcher.replaceAll(this.replacement); - } - - @Override - public int hashCode() { - return expression.hashCode(); - } - - @Override - public boolean equals( Object obj ) { - if (obj == this) return true; - if (obj != null && obj.getClass() == this.getClass()) { - final Rule that = (Rule)obj; - if (this.expression.equalsIgnoreCase(that.expression)) return true; - } - return false; - } - - @Override - public String toString() { - return expression + ", " + replacement; - } - } - - private LinkedList plurals = new LinkedList(); - private LinkedList singulars = new LinkedList(); - /** - * The lowercase words that are to be excluded and not processed. This map can be modified by the users via - * {@link #getUncountables()}. - */ - private final Set uncountables = new HashSet(); - - public Inflector() { - initialize(); - } - - protected Inflector( Inflector original ) { - this.plurals.addAll(original.plurals); - this.singulars.addAll(original.singulars); - this.uncountables.addAll(original.uncountables); - } - - @Override - public Inflector clone() { - return new Inflector(this); - } - - // ------------------------------------------------------------------------------------------------ - // Usage functions - // ------------------------------------------------------------------------------------------------ - - /** - * Returns the plural form of the word in the string. - * - * Examples: - * - *
-     *   inflector.pluralize("post")               #=> "posts"
-     *   inflector.pluralize("octopus")            #=> "octopi"
-     *   inflector.pluralize("sheep")              #=> "sheep"
-     *   inflector.pluralize("words")              #=> "words"
-     *   inflector.pluralize("the blue mailman")   #=> "the blue mailmen"
-     *   inflector.pluralize("CamelOctopus")       #=> "CamelOctopi"
-     * 
- * - * - * - * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too. - * - * - * @param word the word that is to be pluralized. - * @return the pluralized form of the word, or the word itself if it could not be pluralized - * @see #singularize(Object) - */ - public String pluralize( Object word ) { - if (word == null) return null; - String wordStr = word.toString().trim(); - if (wordStr.length() == 0) return wordStr; - if (isUncountable(wordStr)) return wordStr; - for (Rule rule : this.plurals) { - String result = rule.apply(wordStr); - if (result != null) return result; - } - return wordStr; - } - - public String pluralize( Object word, - int count ) { - if (word == null) return null; - if (count == 1 || count == -1) { - return word.toString(); - } - return pluralize(word); - } - - /** - * Returns the singular form of the word in the string. - * - * Examples: - * - *
-     *   inflector.singularize("posts")             #=> "post"
-     *   inflector.singularize("octopi")            #=> "octopus"
-     *   inflector.singularize("sheep")             #=> "sheep"
-     *   inflector.singularize("words")             #=> "word"
-     *   inflector.singularize("the blue mailmen")  #=> "the blue mailman"
-     *   inflector.singularize("CamelOctopi")       #=> "CamelOctopus"
-     * 
- * - * - * - * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too. - * - * - * @param word the word that is to be pluralized. - * @return the pluralized form of the word, or the word itself if it could not be pluralized - * @see #pluralize(Object) - */ - public String singularize( Object word ) { - if (word == null) return null; - String wordStr = word.toString().trim(); - if (wordStr.length() == 0) return wordStr; - if (isUncountable(wordStr)) return wordStr; - for (Rule rule : this.singulars) { - String result = rule.apply(wordStr); - if (result != null) return result; - } - return wordStr; - } - - /** - * Converts strings to lowerCamelCase. This method will also use any extra delimiter characters to identify word boundaries. - * - * Examples: - * - *
-     *   inflector.lowerCamelCase("active_record")       #=> "activeRecord"
-     *   inflector.lowerCamelCase("first_name")          #=> "firstName"
-     *   inflector.lowerCamelCase("name")                #=> "name"
-     *   inflector.lowerCamelCase("the-first_name",'-')  #=> "theFirstName"
-     * 
- * - * - * - * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case - * @param delimiterChars optional characters that are used to delimit word boundaries - * @return the lower camel case version of the word - * @see #underscore(String, char[]) - * @see #camelCase(String, boolean, char[]) - * @see #upperCamelCase(String, char[]) - */ - public String lowerCamelCase( String lowerCaseAndUnderscoredWord, - char... delimiterChars ) { - return camelCase(lowerCaseAndUnderscoredWord, false, delimiterChars); - } - - /** - * Converts strings to UpperCamelCase. This method will also use any extra delimiter characters to identify word boundaries. - * - * Examples: - * - *
-     *   inflector.upperCamelCase("active_record")       #=> "SctiveRecord"
-     *   inflector.upperCamelCase("first_name")          #=> "FirstName"
-     *   inflector.upperCamelCase("name")                #=> "Name"
-     *   inflector.lowerCamelCase("the-first_name",'-')  #=> "TheFirstName"
-     * 
- * - * - * - * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case - * @param delimiterChars optional characters that are used to delimit word boundaries - * @return the upper camel case version of the word - * @see #underscore(String, char[]) - * @see #camelCase(String, boolean, char[]) - * @see #lowerCamelCase(String, char[]) - */ - public String upperCamelCase( String lowerCaseAndUnderscoredWord, - char... delimiterChars ) { - return camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars); - } - - /** - * By default, this method converts strings to UpperCamelCase. If the uppercaseFirstLetter argument to false, - * then this method produces lowerCamelCase. This method will also use any extra delimiter characters to identify word - * boundaries. - * - * Examples: - * - *
-     *   inflector.camelCase("active_record",false)    #=> "activeRecord"
-     *   inflector.camelCase("active_record",true)     #=> "ActiveRecord"
-     *   inflector.camelCase("first_name",false)       #=> "firstName"
-     *   inflector.camelCase("first_name",true)        #=> "FirstName"
-     *   inflector.camelCase("name",false)             #=> "name"
-     *   inflector.camelCase("name",true)              #=> "Name"
-     * 
- * - * - * - * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case - * @param uppercaseFirstLetter true if the first character is to be uppercased, or false if the first character is to be - * lowercased - * @param delimiterChars optional characters that are used to delimit word boundaries - * @return the camel case version of the word - * @see #underscore(String, char[]) - * @see #upperCamelCase(String, char[]) - * @see #lowerCamelCase(String, char[]) - */ - public String camelCase( String lowerCaseAndUnderscoredWord, - boolean uppercaseFirstLetter, - char... delimiterChars ) { - if (lowerCaseAndUnderscoredWord == null) return null; - lowerCaseAndUnderscoredWord = lowerCaseAndUnderscoredWord.trim(); - if (lowerCaseAndUnderscoredWord.length() == 0) return ""; - if (uppercaseFirstLetter) { - String result = lowerCaseAndUnderscoredWord; - // Replace any extra delimiters with underscores (before the underscores are converted in the next step)... - if (delimiterChars != null) { - for (char delimiterChar : delimiterChars) { - result = result.replace(delimiterChar, '_'); - } - } - - // Change the case at the beginning at after each underscore ... - return replaceAllWithUppercase(result, "(^|_)(.)", 2); - } - if (lowerCaseAndUnderscoredWord.length() < 2) return lowerCaseAndUnderscoredWord; - return "" + Character.toLowerCase(lowerCaseAndUnderscoredWord.charAt(0)) - + camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars).substring(1); - } - - /** - * Makes an underscored form from the expression in the string (the reverse of the {@link #camelCase(String, boolean, char[]) - * camelCase} method. Also changes any characters that match the supplied delimiters into underscore. - * - * Examples: - * - *
-     *   inflector.underscore("activeRecord")     #=> "active_record"
-     *   inflector.underscore("ActiveRecord")     #=> "active_record"
-     *   inflector.underscore("firstName")        #=> "first_name"
-     *   inflector.underscore("FirstName")        #=> "first_name"
-     *   inflector.underscore("name")             #=> "name"
-     *   inflector.underscore("The.firstName")    #=> "the_first_name"
-     * 
- * - * - * - * @param camelCaseWord the camel-cased word that is to be converted; - * @param delimiterChars optional characters that are used to delimit word boundaries (beyond capitalization) - * @return a lower-cased version of the input, with separate words delimited by the underscore character. - */ - public String underscore( String camelCaseWord, - char... delimiterChars ) { - if (camelCaseWord == null) return null; - String result = camelCaseWord.trim(); - if (result.length() == 0) return ""; - result = result.replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2"); - result = result.replaceAll("([a-z\\d])([A-Z])", "$1_$2"); - result = result.replace('-', '_'); - if (delimiterChars != null) { - for (char delimiterChar : delimiterChars) { - result = result.replace(delimiterChar, '_'); - } - } - return result.toLowerCase(); - } - - /** - * Returns a copy of the input with the first character converted to uppercase and the remainder to lowercase. - * - * @param words the word to be capitalized - * @return the string with the first character capitalized and the remaining characters lowercased - */ - public String capitalize( String words ) { - if (words == null) return null; - String result = words.trim(); - if (result.length() == 0) return ""; - if (result.length() == 1) return result.toUpperCase(); - return "" + Character.toUpperCase(result.charAt(0)) + result.substring(1).toLowerCase(); - } - - /** - * Capitalizes the first word and turns underscores into spaces and strips trailing "_id" and any supplied removable tokens. - * Like {@link #titleCase(String, String[])}, this is meant for creating pretty output. - * - * Examples: - * - *
-     *   inflector.humanize("employee_salary")       #=> "Employee salary"
-     *   inflector.humanize("author_id")             #=> "Author"
-     * 
- * - * - * - * @param lowerCaseAndUnderscoredWords the input to be humanized - * @param removableTokens optional array of tokens that are to be removed - * @return the humanized string - * @see #titleCase(String, String[]) - */ - public String humanize( String lowerCaseAndUnderscoredWords, - String... removableTokens ) { - if (lowerCaseAndUnderscoredWords == null) return null; - String result = lowerCaseAndUnderscoredWords.trim(); - if (result.length() == 0) return ""; - // Remove a trailing "_id" token - result = result.replaceAll("_id$", ""); - // Remove all of the tokens that should be removed - if (removableTokens != null) { - for (String removableToken : removableTokens) { - result = result.replaceAll(removableToken, ""); - } - } - result = result.replaceAll("_+", " "); // replace all adjacent underscores with a single space - return capitalize(result); - } - - /** - * Capitalizes all the words and replaces some characters in the string to create a nicer looking title. Underscores are - * changed to spaces, a trailing "_id" is removed, and any of the supplied tokens are removed. Like - * {@link #humanize(String, String[])}, this is meant for creating pretty output. - * - * Examples: - * - *
-     *   inflector.titleCase("man from the boondocks")       #=> "Man From The Boondocks"
-     *   inflector.titleCase("x-men: the last stand")        #=> "X Men: The Last Stand"
-     * 
- * - * - * - * @param words the input to be turned into title case - * @param removableTokens optional array of tokens that are to be removed - * @return the title-case version of the supplied words - */ - public String titleCase( String words, - String... removableTokens ) { - String result = humanize(words, removableTokens); - result = replaceAllWithUppercase(result, "\\b([a-z])", 1); // change first char of each word to uppercase - return result; - } - - /** - * Turns a non-negative number into an ordinal string used to denote the position in an ordered sequence, such as 1st, 2nd, - * 3rd, 4th. - * - * @param number the non-negative number - * @return the string with the number and ordinal suffix - */ - public String ordinalize( int number ) { - int remainder = number % 100; - String numberStr = Integer.toString(number); - if (11 <= number && number <= 13) return numberStr + "th"; - remainder = number % 10; - if (remainder == 1) return numberStr + "st"; - if (remainder == 2) return numberStr + "nd"; - if (remainder == 3) return numberStr + "rd"; - return numberStr + "th"; - } - - // ------------------------------------------------------------------------------------------------ - // Management methods - // ------------------------------------------------------------------------------------------------ - - /** - * Determine whether the supplied word is considered uncountable by the {@link #pluralize(Object) pluralize} and - * {@link #singularize(Object) singularize} methods. - * - * @param word the word - * @return true if the plural and singular forms of the word are the same - */ - public boolean isUncountable( String word ) { - if (word == null) return false; - String trimmedLower = word.trim().toLowerCase(); - return this.uncountables.contains(trimmedLower); - } - - /** - * Get the set of words that are not processed by the Inflector. The resulting map is directly modifiable. - * - * @return the set of uncountable words - */ - public Set getUncountables() { - return uncountables; - } - - public void addPluralize( String rule, - String replacement ) { - final Rule pluralizeRule = new Rule(rule, replacement); - this.plurals.addFirst(pluralizeRule); - } - - public void addSingularize( String rule, - String replacement ) { - final Rule singularizeRule = new Rule(rule, replacement); - this.singulars.addFirst(singularizeRule); - } - - public void addIrregular( String singular, - String plural ) { - //CheckArg.isNotEmpty(singular, "singular rule"); - //CheckArg.isNotEmpty(plural, "plural rule"); - String singularRemainder = singular.length() > 1 ? singular.substring(1) : ""; - String pluralRemainder = plural.length() > 1 ? plural.substring(1) : ""; - addPluralize("(" + singular.charAt(0) + ")" + singularRemainder + "$", "$1" + pluralRemainder); - addSingularize("(" + plural.charAt(0) + ")" + pluralRemainder + "$", "$1" + singularRemainder); - } - - public void addUncountable( String... words ) { - if (words == null || words.length == 0) return; - for (String word : words) { - if (word != null) uncountables.add(word.trim().toLowerCase()); - } - } - - /** - * Utility method to replace all occurrences given by the specific backreference with its uppercased form, and remove all - * other backreferences. - * - * The Java {@link Pattern regular expression processing} does not use the preprocessing directives \l, - * \u, \L, and \U. If so, such directives could be used in the replacement string - * to uppercase or lowercase the backreferences. For example, \L1 would lowercase the first backreference, and - * \u3 would uppercase the 3rd backreference. - * - * - * @param input - * @param regex - * @param groupNumberToUppercase - * @return the input string with the appropriate characters converted to upper-case - */ - protected static String replaceAllWithUppercase( String input, - String regex, - int groupNumberToUppercase ) { - Pattern underscoreAndDotPattern = Pattern.compile(regex); - Matcher matcher = underscoreAndDotPattern.matcher(input); - StringBuffer sb = new StringBuffer(); - while (matcher.find()) { - matcher.appendReplacement(sb, matcher.group(groupNumberToUppercase).toUpperCase()); - } - matcher.appendTail(sb); - return sb.toString(); - } - - /** - * Completely remove all rules within this inflector. - */ - public void clear() { - this.uncountables.clear(); - this.plurals.clear(); - this.singulars.clear(); - } - - protected void initialize() { - Inflector inflect = this; - inflect.addPluralize("$", "s"); - inflect.addPluralize("s$", "s"); - inflect.addPluralize("(ax|test)is$", "$1es"); - inflect.addPluralize("(octop|vir)us$", "$1i"); - inflect.addPluralize("(octop|vir)i$", "$1i"); // already plural - inflect.addPluralize("(alias|status)$", "$1es"); - inflect.addPluralize("(bu)s$", "$1ses"); - inflect.addPluralize("(buffal|tomat)o$", "$1oes"); - inflect.addPluralize("([ti])um$", "$1a"); - inflect.addPluralize("([ti])a$", "$1a"); // already plural - inflect.addPluralize("sis$", "ses"); - inflect.addPluralize("(?:([^f])fe|([lr])f)$", "$1$2ves"); - inflect.addPluralize("(hive)$", "$1s"); - inflect.addPluralize("([^aeiouy]|qu)y$", "$1ies"); - inflect.addPluralize("(x|ch|ss|sh)$", "$1es"); - inflect.addPluralize("(matr|vert|ind)ix|ex$", "$1ices"); - inflect.addPluralize("([m|l])ouse$", "$1ice"); - inflect.addPluralize("([m|l])ice$", "$1ice"); - inflect.addPluralize("^(ox)$", "$1en"); - inflect.addPluralize("(quiz)$", "$1zes"); - // Need to check for the following words that are already pluralized: - inflect.addPluralize("(people|men|children|sexes|moves|stadiums)$", "$1"); // irregulars - inflect.addPluralize("(oxen|octopi|viri|aliases|quizzes)$", "$1"); // special rules - - inflect.addSingularize("s$", ""); - inflect.addSingularize("(s|si|u)s$", "$1s"); // '-us' and '-ss' are already singular - inflect.addSingularize("(n)ews$", "$1ews"); - inflect.addSingularize("([ti])a$", "$1um"); - inflect.addSingularize("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", "$1$2sis"); - inflect.addSingularize("(^analy)ses$", "$1sis"); - inflect.addSingularize("(^analy)sis$", "$1sis"); // already singular, but ends in 's' - inflect.addSingularize("([^f])ves$", "$1fe"); - inflect.addSingularize("(hive)s$", "$1"); - inflect.addSingularize("(tive)s$", "$1"); - inflect.addSingularize("([lr])ves$", "$1f"); - inflect.addSingularize("([^aeiouy]|qu)ies$", "$1y"); - inflect.addSingularize("(s)eries$", "$1eries"); - inflect.addSingularize("(m)ovies$", "$1ovie"); - inflect.addSingularize("(x|ch|ss|sh)es$", "$1"); - inflect.addSingularize("([m|l])ice$", "$1ouse"); - inflect.addSingularize("(bus)es$", "$1"); - inflect.addSingularize("(o)es$", "$1"); - inflect.addSingularize("(shoe)s$", "$1"); - inflect.addSingularize("(cris|ax|test)is$", "$1is"); // already singular, but ends in 's' - inflect.addSingularize("(cris|ax|test)es$", "$1is"); - inflect.addSingularize("(octop|vir)i$", "$1us"); - inflect.addSingularize("(octop|vir)us$", "$1us"); // already singular, but ends in 's' - inflect.addSingularize("(alias|status)es$", "$1"); - inflect.addSingularize("(alias|status)$", "$1"); // already singular, but ends in 's' - inflect.addSingularize("^(ox)en", "$1"); - inflect.addSingularize("(vert|ind)ices$", "$1ex"); - inflect.addSingularize("(matr)ices$", "$1ix"); - inflect.addSingularize("(quiz)zes$", "$1"); - - inflect.addIrregular("person", "people"); - inflect.addIrregular("man", "men"); - inflect.addIrregular("child", "children"); - inflect.addIrregular("sex", "sexes"); - inflect.addIrregular("move", "moves"); - inflect.addIrregular("stadium", "stadiums"); - - inflect.addUncountable("equipment", "information", "rice", "money", "species", "series", "fish", "sheep"); - } - -} \ No newline at end of file + +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * JBoss DNA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Transforms words to singular, plural, humanized (human readable), underscore, camel case, or ordinal form. This is inspired by + * the Inflector class in Ruby on Rails, which is distributed under the Rails license. + * + * @author Randall Hauch + */ +public class Inflector { + + protected static final Inflector INSTANCE = new Inflector(); + + public static final Inflector getInstance() { + return INSTANCE; + } + + protected class Rule { + + protected final String expression; + protected final Pattern expressionPattern; + protected final String replacement; + + protected Rule( String expression, + String replacement ) { + this.expression = expression; + this.replacement = replacement != null ? replacement : ""; + this.expressionPattern = Pattern.compile(this.expression, Pattern.CASE_INSENSITIVE); + } + + /** + * Apply the rule against the input string, returning the modified string or null if the rule didn't apply (and no + * modifications were made) + * + * @param input the input string + * @return the modified string if this rule applied, or null if the input was not modified by this rule + */ + protected String apply( String input ) { + Matcher matcher = this.expressionPattern.matcher(input); + if (!matcher.find()) return null; + return matcher.replaceAll(this.replacement); + } + + @Override + public int hashCode() { + return expression.hashCode(); + } + + @Override + public boolean equals( Object obj ) { + if (obj == this) return true; + if (obj != null && obj.getClass() == this.getClass()) { + final Rule that = (Rule)obj; + if (this.expression.equalsIgnoreCase(that.expression)) return true; + } + return false; + } + + @Override + public String toString() { + return expression + ", " + replacement; + } + } + + private LinkedList plurals = new LinkedList(); + private LinkedList singulars = new LinkedList(); + /** + * The lowercase words that are to be excluded and not processed. This map can be modified by the users via + * {@link #getUncountables()}. + */ + private final Set uncountables = new HashSet(); + + public Inflector() { + initialize(); + } + + protected Inflector( Inflector original ) { + this.plurals.addAll(original.plurals); + this.singulars.addAll(original.singulars); + this.uncountables.addAll(original.uncountables); + } + + @Override + public Inflector clone() { + return new Inflector(this); + } + + // ------------------------------------------------------------------------------------------------ + // Usage functions + // ------------------------------------------------------------------------------------------------ + + /** + * Returns the plural form of the word in the string. + * + * Examples: + * + *
+     *   inflector.pluralize("post")               #=> "posts"
+     *   inflector.pluralize("octopus")            #=> "octopi"
+     *   inflector.pluralize("sheep")              #=> "sheep"
+     *   inflector.pluralize("words")              #=> "words"
+     *   inflector.pluralize("the blue mailman")   #=> "the blue mailmen"
+     *   inflector.pluralize("CamelOctopus")       #=> "CamelOctopi"
+     * 
+ * + * + * + * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too. + * + * + * @param word the word that is to be pluralized. + * @return the pluralized form of the word, or the word itself if it could not be pluralized + * @see #singularize(Object) + */ + public String pluralize( Object word ) { + if (word == null) return null; + String wordStr = word.toString().trim(); + if (wordStr.length() == 0) return wordStr; + if (isUncountable(wordStr)) return wordStr; + for (Rule rule : this.plurals) { + String result = rule.apply(wordStr); + if (result != null) return result; + } + return wordStr; + } + + public String pluralize( Object word, + int count ) { + if (word == null) return null; + if (count == 1 || count == -1) { + return word.toString(); + } + return pluralize(word); + } + + /** + * Returns the singular form of the word in the string. + * + * Examples: + * + *
+     *   inflector.singularize("posts")             #=> "post"
+     *   inflector.singularize("octopi")            #=> "octopus"
+     *   inflector.singularize("sheep")             #=> "sheep"
+     *   inflector.singularize("words")             #=> "word"
+     *   inflector.singularize("the blue mailmen")  #=> "the blue mailman"
+     *   inflector.singularize("CamelOctopi")       #=> "CamelOctopus"
+     * 
+ * + * + * + * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too. + * + * + * @param word the word that is to be pluralized. + * @return the pluralized form of the word, or the word itself if it could not be pluralized + * @see #pluralize(Object) + */ + public String singularize( Object word ) { + if (word == null) return null; + String wordStr = word.toString().trim(); + if (wordStr.length() == 0) return wordStr; + if (isUncountable(wordStr)) return wordStr; + for (Rule rule : this.singulars) { + String result = rule.apply(wordStr); + if (result != null) return result; + } + return wordStr; + } + + /** + * Converts strings to lowerCamelCase. This method will also use any extra delimiter characters to identify word boundaries. + * + * Examples: + * + *
+     *   inflector.lowerCamelCase("active_record")       #=> "activeRecord"
+     *   inflector.lowerCamelCase("first_name")          #=> "firstName"
+     *   inflector.lowerCamelCase("name")                #=> "name"
+     *   inflector.lowerCamelCase("the-first_name",'-')  #=> "theFirstName"
+     * 
+ * + * + * + * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case + * @param delimiterChars optional characters that are used to delimit word boundaries + * @return the lower camel case version of the word + * @see #underscore(String, char[]) + * @see #camelCase(String, boolean, char[]) + * @see #upperCamelCase(String, char[]) + */ + public String lowerCamelCase( String lowerCaseAndUnderscoredWord, + char... delimiterChars ) { + return camelCase(lowerCaseAndUnderscoredWord, false, delimiterChars); + } + + /** + * Converts strings to UpperCamelCase. This method will also use any extra delimiter characters to identify word boundaries. + * + * Examples: + * + *
+     *   inflector.upperCamelCase("active_record")       #=> "SctiveRecord"
+     *   inflector.upperCamelCase("first_name")          #=> "FirstName"
+     *   inflector.upperCamelCase("name")                #=> "Name"
+     *   inflector.lowerCamelCase("the-first_name",'-')  #=> "TheFirstName"
+     * 
+ * + * + * + * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case + * @param delimiterChars optional characters that are used to delimit word boundaries + * @return the upper camel case version of the word + * @see #underscore(String, char[]) + * @see #camelCase(String, boolean, char[]) + * @see #lowerCamelCase(String, char[]) + */ + public String upperCamelCase( String lowerCaseAndUnderscoredWord, + char... delimiterChars ) { + return camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars); + } + + /** + * By default, this method converts strings to UpperCamelCase. If the uppercaseFirstLetter argument to false, + * then this method produces lowerCamelCase. This method will also use any extra delimiter characters to identify word + * boundaries. + * + * Examples: + * + *
+     *   inflector.camelCase("active_record",false)    #=> "activeRecord"
+     *   inflector.camelCase("active_record",true)     #=> "ActiveRecord"
+     *   inflector.camelCase("first_name",false)       #=> "firstName"
+     *   inflector.camelCase("first_name",true)        #=> "FirstName"
+     *   inflector.camelCase("name",false)             #=> "name"
+     *   inflector.camelCase("name",true)              #=> "Name"
+     * 
+ * + * + * + * @param lowerCaseAndUnderscoredWord the word that is to be converted to camel case + * @param uppercaseFirstLetter true if the first character is to be uppercased, or false if the first character is to be + * lowercased + * @param delimiterChars optional characters that are used to delimit word boundaries + * @return the camel case version of the word + * @see #underscore(String, char[]) + * @see #upperCamelCase(String, char[]) + * @see #lowerCamelCase(String, char[]) + */ + public String camelCase( String lowerCaseAndUnderscoredWord, + boolean uppercaseFirstLetter, + char... delimiterChars ) { + if (lowerCaseAndUnderscoredWord == null) return null; + lowerCaseAndUnderscoredWord = lowerCaseAndUnderscoredWord.trim(); + if (lowerCaseAndUnderscoredWord.length() == 0) return ""; + if (uppercaseFirstLetter) { + String result = lowerCaseAndUnderscoredWord; + // Replace any extra delimiters with underscores (before the underscores are converted in the next step)... + if (delimiterChars != null) { + for (char delimiterChar : delimiterChars) { + result = result.replace(delimiterChar, '_'); + } + } + + // Change the case at the beginning at after each underscore ... + return replaceAllWithUppercase(result, "(^|_)(.)", 2); + } + if (lowerCaseAndUnderscoredWord.length() < 2) return lowerCaseAndUnderscoredWord; + return "" + Character.toLowerCase(lowerCaseAndUnderscoredWord.charAt(0)) + + camelCase(lowerCaseAndUnderscoredWord, true, delimiterChars).substring(1); + } + + /** + * Makes an underscored form from the expression in the string (the reverse of the {@link #camelCase(String, boolean, char[]) + * camelCase} method. Also changes any characters that match the supplied delimiters into underscore. + * + * Examples: + * + *
+     *   inflector.underscore("activeRecord")     #=> "active_record"
+     *   inflector.underscore("ActiveRecord")     #=> "active_record"
+     *   inflector.underscore("firstName")        #=> "first_name"
+     *   inflector.underscore("FirstName")        #=> "first_name"
+     *   inflector.underscore("name")             #=> "name"
+     *   inflector.underscore("The.firstName")    #=> "the_first_name"
+     * 
+ * + * + * + * @param camelCaseWord the camel-cased word that is to be converted; + * @param delimiterChars optional characters that are used to delimit word boundaries (beyond capitalization) + * @return a lower-cased version of the input, with separate words delimited by the underscore character. + */ + public String underscore( String camelCaseWord, + char... delimiterChars ) { + if (camelCaseWord == null) return null; + String result = camelCaseWord.trim(); + if (result.length() == 0) return ""; + result = result.replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2"); + result = result.replaceAll("([a-z\\d])([A-Z])", "$1_$2"); + result = result.replace('-', '_'); + if (delimiterChars != null) { + for (char delimiterChar : delimiterChars) { + result = result.replace(delimiterChar, '_'); + } + } + return result.toLowerCase(); + } + + /** + * Returns a copy of the input with the first character converted to uppercase and the remainder to lowercase. + * + * @param words the word to be capitalized + * @return the string with the first character capitalized and the remaining characters lowercased + */ + public String capitalize( String words ) { + if (words == null) return null; + String result = words.trim(); + if (result.length() == 0) return ""; + if (result.length() == 1) return result.toUpperCase(); + return "" + Character.toUpperCase(result.charAt(0)) + result.substring(1).toLowerCase(); + } + + /** + * Capitalizes the first word and turns underscores into spaces and strips trailing "_id" and any supplied removable tokens. + * Like {@link #titleCase(String, String[])}, this is meant for creating pretty output. + * + * Examples: + * + *
+     *   inflector.humanize("employee_salary")       #=> "Employee salary"
+     *   inflector.humanize("author_id")             #=> "Author"
+     * 
+ * + * + * + * @param lowerCaseAndUnderscoredWords the input to be humanized + * @param removableTokens optional array of tokens that are to be removed + * @return the humanized string + * @see #titleCase(String, String[]) + */ + public String humanize( String lowerCaseAndUnderscoredWords, + String... removableTokens ) { + if (lowerCaseAndUnderscoredWords == null) return null; + String result = lowerCaseAndUnderscoredWords.trim(); + if (result.length() == 0) return ""; + // Remove a trailing "_id" token + result = result.replaceAll("_id$", ""); + // Remove all of the tokens that should be removed + if (removableTokens != null) { + for (String removableToken : removableTokens) { + result = result.replaceAll(removableToken, ""); + } + } + result = result.replaceAll("_+", " "); // replace all adjacent underscores with a single space + return capitalize(result); + } + + /** + * Capitalizes all the words and replaces some characters in the string to create a nicer looking title. Underscores are + * changed to spaces, a trailing "_id" is removed, and any of the supplied tokens are removed. Like + * {@link #humanize(String, String[])}, this is meant for creating pretty output. + * + * Examples: + * + *
+     *   inflector.titleCase("man from the boondocks")       #=> "Man From The Boondocks"
+     *   inflector.titleCase("x-men: the last stand")        #=> "X Men: The Last Stand"
+     * 
+ * + * + * + * @param words the input to be turned into title case + * @param removableTokens optional array of tokens that are to be removed + * @return the title-case version of the supplied words + */ + public String titleCase( String words, + String... removableTokens ) { + String result = humanize(words, removableTokens); + result = replaceAllWithUppercase(result, "\\b([a-z])", 1); // change first char of each word to uppercase + return result; + } + + /** + * Turns a non-negative number into an ordinal string used to denote the position in an ordered sequence, such as 1st, 2nd, + * 3rd, 4th. + * + * @param number the non-negative number + * @return the string with the number and ordinal suffix + */ + public String ordinalize( int number ) { + int remainder = number % 100; + String numberStr = Integer.toString(number); + if (11 <= number && number <= 13) return numberStr + "th"; + remainder = number % 10; + if (remainder == 1) return numberStr + "st"; + if (remainder == 2) return numberStr + "nd"; + if (remainder == 3) return numberStr + "rd"; + return numberStr + "th"; + } + + // ------------------------------------------------------------------------------------------------ + // Management methods + // ------------------------------------------------------------------------------------------------ + + /** + * Determine whether the supplied word is considered uncountable by the {@link #pluralize(Object) pluralize} and + * {@link #singularize(Object) singularize} methods. + * + * @param word the word + * @return true if the plural and singular forms of the word are the same + */ + public boolean isUncountable( String word ) { + if (word == null) return false; + String trimmedLower = word.trim().toLowerCase(); + return this.uncountables.contains(trimmedLower); + } + + /** + * Get the set of words that are not processed by the Inflector. The resulting map is directly modifiable. + * + * @return the set of uncountable words + */ + public Set getUncountables() { + return uncountables; + } + + public void addPluralize( String rule, + String replacement ) { + final Rule pluralizeRule = new Rule(rule, replacement); + this.plurals.addFirst(pluralizeRule); + } + + public void addSingularize( String rule, + String replacement ) { + final Rule singularizeRule = new Rule(rule, replacement); + this.singulars.addFirst(singularizeRule); + } + + public void addIrregular( String singular, + String plural ) { + //CheckArg.isNotEmpty(singular, "singular rule"); + //CheckArg.isNotEmpty(plural, "plural rule"); + String singularRemainder = singular.length() > 1 ? singular.substring(1) : ""; + String pluralRemainder = plural.length() > 1 ? plural.substring(1) : ""; + addPluralize("(" + singular.charAt(0) + ")" + singularRemainder + "$", "$1" + pluralRemainder); + addSingularize("(" + plural.charAt(0) + ")" + pluralRemainder + "$", "$1" + singularRemainder); + } + + public void addUncountable( String... words ) { + if (words == null || words.length == 0) return; + for (String word : words) { + if (word != null) uncountables.add(word.trim().toLowerCase()); + } + } + + /** + * Utility method to replace all occurrences given by the specific backreference with its uppercased form, and remove all + * other backreferences. + * + * The Java {@link Pattern regular expression processing} does not use the preprocessing directives \l, + * \u, \L, and \U. If so, such directives could be used in the replacement string + * to uppercase or lowercase the backreferences. For example, \L1 would lowercase the first backreference, and + * \u3 would uppercase the 3rd backreference. + * + * + * @param input + * @param regex + * @param groupNumberToUppercase + * @return the input string with the appropriate characters converted to upper-case + */ + protected static String replaceAllWithUppercase( String input, + String regex, + int groupNumberToUppercase ) { + Pattern underscoreAndDotPattern = Pattern.compile(regex); + Matcher matcher = underscoreAndDotPattern.matcher(input); + StringBuffer sb = new StringBuffer(); + while (matcher.find()) { + matcher.appendReplacement(sb, matcher.group(groupNumberToUppercase).toUpperCase()); + } + matcher.appendTail(sb); + return sb.toString(); + } + + /** + * Completely remove all rules within this inflector. + */ + public void clear() { + this.uncountables.clear(); + this.plurals.clear(); + this.singulars.clear(); + } + + protected void initialize() { + Inflector inflect = this; + inflect.addPluralize("$", "s"); + inflect.addPluralize("s$", "s"); + inflect.addPluralize("(ax|test)is$", "$1es"); + inflect.addPluralize("(octop|vir)us$", "$1i"); + inflect.addPluralize("(octop|vir)i$", "$1i"); // already plural + inflect.addPluralize("(alias|status)$", "$1es"); + inflect.addPluralize("(bu)s$", "$1ses"); + inflect.addPluralize("(buffal|tomat)o$", "$1oes"); + inflect.addPluralize("([ti])um$", "$1a"); + inflect.addPluralize("([ti])a$", "$1a"); // already plural + inflect.addPluralize("sis$", "ses"); + inflect.addPluralize("(?:([^f])fe|([lr])f)$", "$1$2ves"); + inflect.addPluralize("(hive)$", "$1s"); + inflect.addPluralize("([^aeiouy]|qu)y$", "$1ies"); + inflect.addPluralize("(x|ch|ss|sh)$", "$1es"); + inflect.addPluralize("(matr|vert|ind)ix|ex$", "$1ices"); + inflect.addPluralize("([m|l])ouse$", "$1ice"); + inflect.addPluralize("([m|l])ice$", "$1ice"); + inflect.addPluralize("^(ox)$", "$1en"); + inflect.addPluralize("(quiz)$", "$1zes"); + // Need to check for the following words that are already pluralized: + inflect.addPluralize("(people|men|children|sexes|moves|stadiums)$", "$1"); // irregulars + inflect.addPluralize("(oxen|octopi|viri|aliases|quizzes)$", "$1"); // special rules + + inflect.addSingularize("s$", ""); + inflect.addSingularize("(s|si|u)s$", "$1s"); // '-us' and '-ss' are already singular + inflect.addSingularize("(n)ews$", "$1ews"); + inflect.addSingularize("([ti])a$", "$1um"); + inflect.addSingularize("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", "$1$2sis"); + inflect.addSingularize("(^analy)ses$", "$1sis"); + inflect.addSingularize("(^analy)sis$", "$1sis"); // already singular, but ends in 's' + inflect.addSingularize("([^f])ves$", "$1fe"); + inflect.addSingularize("(hive)s$", "$1"); + inflect.addSingularize("(tive)s$", "$1"); + inflect.addSingularize("([lr])ves$", "$1f"); + inflect.addSingularize("([^aeiouy]|qu)ies$", "$1y"); + inflect.addSingularize("(s)eries$", "$1eries"); + inflect.addSingularize("(m)ovies$", "$1ovie"); + inflect.addSingularize("(x|ch|ss|sh)es$", "$1"); + inflect.addSingularize("([m|l])ice$", "$1ouse"); + inflect.addSingularize("(bus)es$", "$1"); + inflect.addSingularize("(o)es$", "$1"); + inflect.addSingularize("(shoe)s$", "$1"); + inflect.addSingularize("(cris|ax|test)is$", "$1is"); // already singular, but ends in 's' + inflect.addSingularize("(cris|ax|test)es$", "$1is"); + inflect.addSingularize("(octop|vir)i$", "$1us"); + inflect.addSingularize("(octop|vir)us$", "$1us"); // already singular, but ends in 's' + inflect.addSingularize("(alias|status)es$", "$1"); + inflect.addSingularize("(alias|status)$", "$1"); // already singular, but ends in 's' + inflect.addSingularize("^(ox)en", "$1"); + inflect.addSingularize("(vert|ind)ices$", "$1ex"); + inflect.addSingularize("(matr)ices$", "$1ix"); + inflect.addSingularize("(quiz)zes$", "$1"); + + inflect.addIrregular("person", "people"); + inflect.addIrregular("man", "men"); + inflect.addIrregular("child", "children"); + inflect.addIrregular("sex", "sexes"); + inflect.addIrregular("move", "moves"); + inflect.addIrregular("stadium", "stadiums"); + + inflect.addUncountable("equipment", "information", "rice", "money", "species", "series", "fish", "sheep"); + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java index 69834b23389..f8d3ff1fa4a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/MyURIResolver.java @@ -20,73 +20,73 @@ package org.hl7.fhir.utilities; * #L% */ - -/* -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. - -*/ - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - -public class MyURIResolver implements URIResolver { - - private String path; - private URIResolver alt; - - public MyURIResolver(String path, URIResolver alt) { - super(); - this.path = path; - this.alt = alt; - } - - - @Override - public Source resolve(String href, String base) throws TransformerException { - try { - if (href.startsWith("http://") || href.startsWith("https://")) { - if (alt != null) { - Source s = alt.resolve(href, base); - if (s != null) - return s; - } - return TransformerFactory.newInstance().getURIResolver().resolve(href, base); - } else - return new StreamSource(new FileInputStream(href.contains(File.separator) ? href : path+href)); - } catch (FileNotFoundException e) { - throw new TransformerException(e); - } - } - -} \ No newline at end of file + +/* +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. + +*/ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import javax.xml.transform.Source; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.URIResolver; +import javax.xml.transform.stream.StreamSource; + +public class MyURIResolver implements URIResolver { + + private String path; + private URIResolver alt; + + public MyURIResolver(String path, URIResolver alt) { + super(); + this.path = path; + this.alt = alt; + } + + + @Override + public Source resolve(String href, String base) throws TransformerException { + try { + if (href.startsWith("http://") || href.startsWith("https://")) { + if (alt != null) { + Source s = alt.resolve(href, base); + if (s != null) + return s; + } + return TransformerFactory.newInstance().getURIResolver().resolve(href, base); + } else + return new StreamSource(new FileInputStream(href.contains(File.separator) ? href : path+href)); + } catch (FileNotFoundException e) { + throw new TransformerException(e); + } + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Utilities.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Utilities.java index 526154bc057..401ec0da944 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -1,32 +1,32 @@ -/* -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. - - */ - +/* +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. + + */ + package org.hl7.fhir.utilities; /* @@ -49,621 +49,621 @@ package org.hl7.fhir.utilities; * #L% */ - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.channels.FileChannel; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import net.sf.saxon.TransformerFactoryImpl; - -public class Utilities { - -// private static final String TOKEN_REGEX = "^a-z[A-Za-z0-9]*$"; - - - /** - * Returns the plural form of the word in the string. - * - * Examples: - * - *
-     *   inflector.pluralize("post")               #=> "posts"
-     *   inflector.pluralize("octopus")            #=> "octopi"
-     *   inflector.pluralize("sheep")              #=> "sheep"
-     *   inflector.pluralize("words")              #=> "words"
-     *   inflector.pluralize("the blue mailman")   #=> "the blue mailmen"
-     *   inflector.pluralize("CamelOctopus")       #=> "CamelOctopi"
-     * 
- * - * - * - * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too. - * - * - * @param word the word that is to be pluralized. - * @return the pluralized form of the word, or the word itself if it could not be pluralized - */ - public static String pluralizeMe( String word ) { - Inflector inf = new Inflector(); - return inf.pluralize(word); - } - - - public static boolean IsInteger(String string) { - try { - int i = Integer.parseInt(string); - return i != i+1; - } catch (Exception e) { - return false; - } - } - - public static boolean IsDecimal(String string) { - try { - float r = Float.parseFloat(string); - return r != r + 1; // just to suppress the hint - } catch (Exception e) { - return false; - } - } - - public static String camelCase(String value) { - return new Inflector().camelCase(value.trim().replace(" ", "_"), false); - } - - public static String escapeXml(String doco) { - if (doco == null) - return ""; - - StringBuilder b = new StringBuilder(); - for (char c : doco.toCharArray()) { - if (c == '<') - b.append("<"); - else if (c == '>') - b.append(">"); - else if (c == '&') - b.append("&"); - else if (c == '"') - b.append("""); - else - b.append(c); - } - return b.toString(); - } - - - public static String capitalize(String s) - { - if( s == null ) return null; - if( s.length() == 0 ) return s; - if( s.length() == 1 ) return s.toUpperCase(); - - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - - public static void copyDirectory(String sourceFolder, String destFolder, FileNotifier notifier) throws Exception { - CSFile src = new CSFile(sourceFolder); - if (!src.exists()) - throw new Exception("Folder " +sourceFolder+" not found"); - createDirectory(destFolder); - - String[] files = src.list(); - for (String f : files) { - if (new CSFile(sourceFolder+File.separator+f).isDirectory()) { - if (!f.startsWith(".")) // ignore .svn... - copyDirectory(sourceFolder+File.separator+f, destFolder+File.separator+f, notifier); - } else { - if (notifier != null) - notifier.copyFile(sourceFolder+File.separator+f, destFolder+File.separator+f); - copyFile(new CSFile(sourceFolder+File.separator+f), new CSFile(destFolder+File.separator+f)); - } - } - } - - public static void copyFile(String source, String dest) throws IOException { - copyFile(new File(source), new File(dest)); - } - - public static void copyFile(File sourceFile, File destFile) throws IOException { - if(!destFile.exists()) { - if (!new CSFile(destFile.getParent()).exists()) { - createDirectory(destFile.getParent()); - } - destFile.createNewFile(); - } - - FileChannel source = null; - FileChannel destination = null; - - try { - source = new FileInputStream(sourceFile).getChannel(); - destination = new FileOutputStream(destFile).getChannel(); - destination.transferFrom(source, 0, source.size()); - } - finally { - if(source != null) { - source.close(); - } - if(destination != null) { - destination.close(); - } - } - } - - public static boolean checkFolder(String dir, List errors) - throws IOException - { - if (!new CSFile(dir).exists()) { - errors.add("Unable to find directory "+dir); - return false; - } else { - return true; - } - } - - public static boolean checkFile(String purpose, String dir, String file, List errors) - throws IOException - { - if (!new CSFile(dir+file).exists()) { - errors.add("Unable to find "+purpose+" file "+file+" in "+dir); - return false; - } else { - return true; - } - } - - public static String asCSV(List strings) { - StringBuilder s = new StringBuilder(); - boolean first = true; - for (String n : strings) { - if (!first) - s.append(","); - s.append(n); - first = false; - } - return s.toString(); - } - - public static String asHtmlBr(String prefix, List strings) { - StringBuilder s = new StringBuilder(); - boolean first = true; - for (String n : strings) { - if (!first) - s.append("
"); - s.append(prefix); - s.append(n); - first = false; - } - return s.toString(); - } - - public static void clearDirectory(String folder) throws IOException { - String[] files = new CSFile(folder).list(); - if (files != null) { - for (String f : files) { - File fh = new CSFile(folder+File.separatorChar+f); - if (fh.isDirectory()) - clearDirectory(fh.getAbsolutePath()); - fh.delete(); - } - } - } - - public static void createDirectory(String path) throws IOException{ - new CSFile(path).mkdirs(); - } - - public static String changeFileExt(String name, String ext) { - if (name.lastIndexOf('.') > -1) - return name.substring(0, name.lastIndexOf('.')) + ext; - else - return name+ext; - } - - public static String cleanupTextString( String contents ) - { - if( contents == null || contents.trim().equals("") ) - return null; - else - return contents.trim(); - } - - - public static boolean noString(String v) { - return v == null || v.equals(""); - } - - - public static byte[] saxonTransform(Map files, byte[] source, byte[] xslt) throws Exception { - TransformerFactory f = new net.sf.saxon.TransformerFactoryImpl(); - f.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE); - StreamSource xsrc = new StreamSource(new ByteArrayInputStream(xslt)); - f.setURIResolver(new ZipURIResolver(files)); - Transformer t = f.newTransformer(xsrc); - - t.setURIResolver(new ZipURIResolver(files)); - StreamSource src = new StreamSource(new ByteArrayInputStream(source)); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - StreamResult res = new StreamResult(out); - t.transform(src, res); - return out.toByteArray(); - } - - public static byte[] transform(Map files, byte[] source, byte[] xslt) throws Exception { - TransformerFactory f = TransformerFactory.newInstance(); - f.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE); - StreamSource xsrc = new StreamSource(new ByteArrayInputStream(xslt)); - f.setURIResolver(new ZipURIResolver(files)); - Transformer t = f.newTransformer(xsrc); - - t.setURIResolver(new ZipURIResolver(files)); - StreamSource src = new StreamSource(new ByteArrayInputStream(source)); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - StreamResult res = new StreamResult(out); - t.transform(src, res); - return out.toByteArray(); - } - - public static void bytesToFile(byte[] content, String filename) throws Exception { - FileOutputStream out = new FileOutputStream(filename); - out.write(content); - out.close(); - - } - - public static void saxonTransform(String xsltDir, String source, String xslt, String dest, URIResolver alt) throws Exception { - saxonTransform(xsltDir, source, xslt, dest, alt, null); - } - - public static void saxonTransform(String xsltDir, String source, String xslt, String dest, URIResolver alt, Map params) throws Exception { - TransformerFactoryImpl f = new net.sf.saxon.TransformerFactoryImpl(); - f.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE); - StreamSource xsrc = new StreamSource(new FileInputStream(xslt)); - f.setURIResolver(new MyURIResolver(xsltDir, alt)); - Transformer t = f.newTransformer(xsrc); - if (params != null) { - for (Map.Entry entry : params.entrySet()) { - t.setParameter(entry.getKey(), entry.getValue()); - } - } - - t.setURIResolver(new MyURIResolver(xsltDir, alt)); - StreamSource src = new StreamSource(new FileInputStream(source)); - StreamResult res = new StreamResult(new FileOutputStream(dest)); - t.transform(src, res); - } - - public static void transform(String xsltDir, String source, String xslt, String dest, URIResolver alt) throws Exception { - - TransformerFactory f = TransformerFactory.newInstance(); - StreamSource xsrc = new StreamSource(new FileInputStream(xslt)); - f.setURIResolver(new MyURIResolver(xsltDir, alt)); - Transformer t = f.newTransformer(xsrc); - - t.setURIResolver(new MyURIResolver(xsltDir, alt)); - StreamSource src = new StreamSource(new FileInputStream(source)); - StreamResult res = new StreamResult(new FileOutputStream(dest)); - t.transform(src, res); - - } - - - public static String appendSlash(String definitions) { - return definitions.endsWith(File.separator) ? definitions : definitions+File.separator; - } - - - public static String fileTitle(String file) { - if (file == null) - return null; - String s = new File(file).getName(); - return s.indexOf(".") == -1? s : s.substring(0, s.indexOf(".")); - } - - - public static String systemEol() - { - return System.getProperty("line.separator"); - } - - public static String normaliseEolns(String value) { - return value.replace("\r\n", "\r").replace("\n", "\r").replace("\r", "\r\n"); - } - - - public static String unescapeXml(String xml) throws Exception { - if (xml == null) - return null; - - StringBuilder b = new StringBuilder(); - int i = 0; - while (i < xml.length()) { - if (xml.charAt(i) == '&') { - StringBuilder e = new StringBuilder(); - i++; - while (xml.charAt(i) != ';') { - e.append(xml.charAt(i)); - i++; - } - if (e.toString().equals("lt")) - b.append("<"); - else if (e.toString().equals("gt")) - b.append(">"); - else if (e.toString().equals("amp")) - b.append("&"); - else if (e.toString().equals("quot")) - b.append("\""); - else if (e.toString().equals("mu")) - b.append((char)956); - else - throw new Exception("unknown XML entity \""+e.toString()+"\""); - } else - b.append(xml.charAt(i)); - i++; - } - return b.toString(); - } - - - public static boolean isPlural(String word) { - word = word.toLowerCase(); - if ("restricts".equals(word) || "contains".equals(word) || "data".equals(word) || "specimen".equals(word)) - return false; - Inflector inf = new Inflector(); - return !inf.singularize(word).equals(word); - } - - - public static String padLeft(String src, char c, int len) { - StringBuilder s = new StringBuilder(); - for (int i = 0; i < len - src.length(); i++) - s.append(c); - s.append(src); - return s.toString(); - - } - - - public static String path(String... args) { - StringBuilder s = new StringBuilder(); - boolean d = false; - for(String arg: args) { - if (!d) - d = true; - else if (!s.toString().endsWith(File.separator)) - s.append(File.separator); - s.append(arg); - } - return s.toString(); - } - - - -// public static void checkCase(String filename) { -// File f = new CSFile(filename); -// if (!f.getName().equals(filename)) -// throw new Exception("Filename ") -// -// } - - public static String nmtokenize(String cs) { - StringBuilder s = new StringBuilder(); - for (int i = 0; i < cs.length(); i++) { - char c = cs.charAt(i); - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_') - s.append(c); - else if (c != ' ') - s.append("."+Integer.toString(c)); - } - return s.toString(); - } - - - public static boolean isToken(String tail) { - if (tail == null || tail.length() == 0) - return false; - boolean result = isAlphabetic(tail.charAt(0)); - for (int i = 1; i < tail.length(); i++) { - result = result && (isAlphabetic(tail.charAt(i)) || isDigit(tail.charAt(i)) || (tail.charAt(i) == '_') || (tail.charAt(i) == '[') || (tail.charAt(i) == ']')); - } - return result; - } - - - private static boolean isDigit(char c) { - return (c >= '0') && (c <= '9'); - } - - - private static boolean isAlphabetic(char c) { - return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')); - } - - - public static String getDirectoryForFile(String filepath) { - int i = filepath.lastIndexOf(File.separator); - if (i == -1) - return filepath; - else - return filepath.substring(0, i); - } - - public static String appendPeriod(String s) { - if (Utilities.noString(s)) - return s; - if (s.endsWith(".")) - return s; - return s.trim()+"."; - } - - - public static String removePeriod(String s) { - if (Utilities.noString(s)) - return s; - if (s.endsWith(".")) - return s.substring(0, s.length()-1); - return s; - } - - - public static String stripBOM(String string) { - return string.replace("\uFEFF", ""); - } - - - public static String oidTail(String id) { - if (id == null || !id.contains(".")) - return id; - return id.substring(id.lastIndexOf(".")+1); - } - - - public static String escapeJava(String doco) { - if (doco == null) - return ""; - - StringBuilder b = new StringBuilder(); - for (char c : doco.toCharArray()) { - if (c == '\r') - b.append("\\r"); - else if (c == '\n') - b.append("\\n"); - else if (c == '"') - b.append("'"); - else - b.append(c); - } - return b.toString(); - } - - - public static String[] splitByCamelCase(String name) { - List parts = new ArrayList(); - StringBuilder b = new StringBuilder(); - for (int i = 0; i < name.length(); i++) { - if (i > 0 && Character.isUpperCase(name.charAt(i))) { - parts.add(b.toString()); - b = new StringBuilder(); - } - b.append(Character.toLowerCase(name.charAt(i))); - } - parts.add(b.toString()); - return parts.toArray(new String[] {} ); - } - - - public static String encodeUri(String v) { - return v.replace(" ", "%20"); - } - - - - public static String normalize(String s) { - if (noString(s)) - return null; - StringBuilder b = new StringBuilder(); - boolean isWhitespace = false; - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (!Character.isWhitespace(c)) { - b.append(Character.toLowerCase(c)); - isWhitespace = false; - } else if (!isWhitespace) { - b.append(' '); - isWhitespace = true; - } - } - return b.toString().trim(); - } - - - public static void copyFileToDirectory(File source, File destDir) throws IOException { - copyFile(source, new File(path(destDir.getAbsolutePath(), source.getName()))); - } - - - public static boolean isWhitespace(String s) { - boolean ok = true; - for (int i = 0; i < s.length(); i++) - ok = ok && Character.isWhitespace(s.charAt(i)); - return ok; - - } - - - public static String URLEncode(String string) { - try { - return URLEncoder.encode(string, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new Error(e.getMessage()); - } - } - - - public static boolean existsInList(String value, String... array) { - for (String s : array) - if (value.equals(s)) - return true; - return false; - } - - - public static String getFileNameForName(String name) { - return name.toLowerCase(); - } - - public static void deleteTempFiles() throws IOException { - File file = createTempFile("test", "test"); - String folder = getDirectoryForFile(file.getAbsolutePath()); - String[] list = new File(folder).list(new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith("ohfu-"); - } - }); - if (list != null) { - for (String n : list) { - new File(path(folder, n)).delete(); - } - } - } - - public static File createTempFile(String prefix, String suffix) throws IOException { - // this allows use to eaily identify all our dtemp files and delete them, since delete on Exit doesn't really work. - File file = File.createTempFile("ohfu-"+prefix, suffix); - file.deleteOnExit(); - return file; - } - - - public static boolean isAsciiChar(char ch) { - return ch >= ' ' && ch <= '~'; - } - - - public static String makeUuidUrn() { - return "urn:uuid:"+UUID.randomUUID().toString().toLowerCase(); - } - - public static boolean isURL(String s) { - boolean ok = s.matches("^http(s{0,1})://[a-zA-Z0-9_/\\-\\.]+\\.([A-Za-z/]{2,5})[a-zA-Z0-9_/\\&\\?\\=\\-\\.\\~\\%]*"); - return ok; - } - -} + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.channels.FileChannel; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.URIResolver; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import net.sf.saxon.TransformerFactoryImpl; + +public class Utilities { + +// private static final String TOKEN_REGEX = "^a-z[A-Za-z0-9]*$"; + + + /** + * Returns the plural form of the word in the string. + * + * Examples: + * + *
+     *   inflector.pluralize("post")               #=> "posts"
+     *   inflector.pluralize("octopus")            #=> "octopi"
+     *   inflector.pluralize("sheep")              #=> "sheep"
+     *   inflector.pluralize("words")              #=> "words"
+     *   inflector.pluralize("the blue mailman")   #=> "the blue mailmen"
+     *   inflector.pluralize("CamelOctopus")       #=> "CamelOctopi"
+     * 
+ * + * + * + * Note that if the {@link Object#toString()} is called on the supplied object, so this method works for non-strings, too. + * + * + * @param word the word that is to be pluralized. + * @return the pluralized form of the word, or the word itself if it could not be pluralized + */ + public static String pluralizeMe( String word ) { + Inflector inf = new Inflector(); + return inf.pluralize(word); + } + + + public static boolean IsInteger(String string) { + try { + int i = Integer.parseInt(string); + return i != i+1; + } catch (Exception e) { + return false; + } + } + + public static boolean IsDecimal(String string) { + try { + float r = Float.parseFloat(string); + return r != r + 1; // just to suppress the hint + } catch (Exception e) { + return false; + } + } + + public static String camelCase(String value) { + return new Inflector().camelCase(value.trim().replace(" ", "_"), false); + } + + public static String escapeXml(String doco) { + if (doco == null) + return ""; + + StringBuilder b = new StringBuilder(); + for (char c : doco.toCharArray()) { + if (c == '<') + b.append("<"); + else if (c == '>') + b.append(">"); + else if (c == '&') + b.append("&"); + else if (c == '"') + b.append("""); + else + b.append(c); + } + return b.toString(); + } + + + public static String capitalize(String s) + { + if( s == null ) return null; + if( s.length() == 0 ) return s; + if( s.length() == 1 ) return s.toUpperCase(); + + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + + public static void copyDirectory(String sourceFolder, String destFolder, FileNotifier notifier) throws Exception { + CSFile src = new CSFile(sourceFolder); + if (!src.exists()) + throw new Exception("Folder " +sourceFolder+" not found"); + createDirectory(destFolder); + + String[] files = src.list(); + for (String f : files) { + if (new CSFile(sourceFolder+File.separator+f).isDirectory()) { + if (!f.startsWith(".")) // ignore .svn... + copyDirectory(sourceFolder+File.separator+f, destFolder+File.separator+f, notifier); + } else { + if (notifier != null) + notifier.copyFile(sourceFolder+File.separator+f, destFolder+File.separator+f); + copyFile(new CSFile(sourceFolder+File.separator+f), new CSFile(destFolder+File.separator+f)); + } + } + } + + public static void copyFile(String source, String dest) throws IOException { + copyFile(new File(source), new File(dest)); + } + + public static void copyFile(File sourceFile, File destFile) throws IOException { + if(!destFile.exists()) { + if (!new CSFile(destFile.getParent()).exists()) { + createDirectory(destFile.getParent()); + } + destFile.createNewFile(); + } + + FileChannel source = null; + FileChannel destination = null; + + try { + source = new FileInputStream(sourceFile).getChannel(); + destination = new FileOutputStream(destFile).getChannel(); + destination.transferFrom(source, 0, source.size()); + } + finally { + if(source != null) { + source.close(); + } + if(destination != null) { + destination.close(); + } + } + } + + public static boolean checkFolder(String dir, List errors) + throws IOException + { + if (!new CSFile(dir).exists()) { + errors.add("Unable to find directory "+dir); + return false; + } else { + return true; + } + } + + public static boolean checkFile(String purpose, String dir, String file, List errors) + throws IOException + { + if (!new CSFile(dir+file).exists()) { + errors.add("Unable to find "+purpose+" file "+file+" in "+dir); + return false; + } else { + return true; + } + } + + public static String asCSV(List strings) { + StringBuilder s = new StringBuilder(); + boolean first = true; + for (String n : strings) { + if (!first) + s.append(","); + s.append(n); + first = false; + } + return s.toString(); + } + + public static String asHtmlBr(String prefix, List strings) { + StringBuilder s = new StringBuilder(); + boolean first = true; + for (String n : strings) { + if (!first) + s.append("
"); + s.append(prefix); + s.append(n); + first = false; + } + return s.toString(); + } + + public static void clearDirectory(String folder) throws IOException { + String[] files = new CSFile(folder).list(); + if (files != null) { + for (String f : files) { + File fh = new CSFile(folder+File.separatorChar+f); + if (fh.isDirectory()) + clearDirectory(fh.getAbsolutePath()); + fh.delete(); + } + } + } + + public static void createDirectory(String path) throws IOException{ + new CSFile(path).mkdirs(); + } + + public static String changeFileExt(String name, String ext) { + if (name.lastIndexOf('.') > -1) + return name.substring(0, name.lastIndexOf('.')) + ext; + else + return name+ext; + } + + public static String cleanupTextString( String contents ) + { + if( contents == null || contents.trim().equals("") ) + return null; + else + return contents.trim(); + } + + + public static boolean noString(String v) { + return v == null || v.equals(""); + } + + + public static byte[] saxonTransform(Map files, byte[] source, byte[] xslt) throws Exception { + TransformerFactory f = new net.sf.saxon.TransformerFactoryImpl(); + f.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE); + StreamSource xsrc = new StreamSource(new ByteArrayInputStream(xslt)); + f.setURIResolver(new ZipURIResolver(files)); + Transformer t = f.newTransformer(xsrc); + + t.setURIResolver(new ZipURIResolver(files)); + StreamSource src = new StreamSource(new ByteArrayInputStream(source)); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + StreamResult res = new StreamResult(out); + t.transform(src, res); + return out.toByteArray(); + } + + public static byte[] transform(Map files, byte[] source, byte[] xslt) throws Exception { + TransformerFactory f = TransformerFactory.newInstance(); + f.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE); + StreamSource xsrc = new StreamSource(new ByteArrayInputStream(xslt)); + f.setURIResolver(new ZipURIResolver(files)); + Transformer t = f.newTransformer(xsrc); + + t.setURIResolver(new ZipURIResolver(files)); + StreamSource src = new StreamSource(new ByteArrayInputStream(source)); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + StreamResult res = new StreamResult(out); + t.transform(src, res); + return out.toByteArray(); + } + + public static void bytesToFile(byte[] content, String filename) throws Exception { + FileOutputStream out = new FileOutputStream(filename); + out.write(content); + out.close(); + + } + + public static void saxonTransform(String xsltDir, String source, String xslt, String dest, URIResolver alt) throws Exception { + saxonTransform(xsltDir, source, xslt, dest, alt, null); + } + + public static void saxonTransform(String xsltDir, String source, String xslt, String dest, URIResolver alt, Map params) throws Exception { + TransformerFactoryImpl f = new net.sf.saxon.TransformerFactoryImpl(); + f.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE); + StreamSource xsrc = new StreamSource(new FileInputStream(xslt)); + f.setURIResolver(new MyURIResolver(xsltDir, alt)); + Transformer t = f.newTransformer(xsrc); + if (params != null) { + for (Map.Entry entry : params.entrySet()) { + t.setParameter(entry.getKey(), entry.getValue()); + } + } + + t.setURIResolver(new MyURIResolver(xsltDir, alt)); + StreamSource src = new StreamSource(new FileInputStream(source)); + StreamResult res = new StreamResult(new FileOutputStream(dest)); + t.transform(src, res); + } + + public static void transform(String xsltDir, String source, String xslt, String dest, URIResolver alt) throws Exception { + + TransformerFactory f = TransformerFactory.newInstance(); + StreamSource xsrc = new StreamSource(new FileInputStream(xslt)); + f.setURIResolver(new MyURIResolver(xsltDir, alt)); + Transformer t = f.newTransformer(xsrc); + + t.setURIResolver(new MyURIResolver(xsltDir, alt)); + StreamSource src = new StreamSource(new FileInputStream(source)); + StreamResult res = new StreamResult(new FileOutputStream(dest)); + t.transform(src, res); + + } + + + public static String appendSlash(String definitions) { + return definitions.endsWith(File.separator) ? definitions : definitions+File.separator; + } + + + public static String fileTitle(String file) { + if (file == null) + return null; + String s = new File(file).getName(); + return s.indexOf(".") == -1? s : s.substring(0, s.indexOf(".")); + } + + + public static String systemEol() + { + return System.getProperty("line.separator"); + } + + public static String normaliseEolns(String value) { + return value.replace("\r\n", "\r").replace("\n", "\r").replace("\r", "\r\n"); + } + + + public static String unescapeXml(String xml) throws Exception { + if (xml == null) + return null; + + StringBuilder b = new StringBuilder(); + int i = 0; + while (i < xml.length()) { + if (xml.charAt(i) == '&') { + StringBuilder e = new StringBuilder(); + i++; + while (xml.charAt(i) != ';') { + e.append(xml.charAt(i)); + i++; + } + if (e.toString().equals("lt")) + b.append("<"); + else if (e.toString().equals("gt")) + b.append(">"); + else if (e.toString().equals("amp")) + b.append("&"); + else if (e.toString().equals("quot")) + b.append("\""); + else if (e.toString().equals("mu")) + b.append((char)956); + else + throw new Exception("unknown XML entity \""+e.toString()+"\""); + } else + b.append(xml.charAt(i)); + i++; + } + return b.toString(); + } + + + public static boolean isPlural(String word) { + word = word.toLowerCase(); + if ("restricts".equals(word) || "contains".equals(word) || "data".equals(word) || "specimen".equals(word)) + return false; + Inflector inf = new Inflector(); + return !inf.singularize(word).equals(word); + } + + + public static String padLeft(String src, char c, int len) { + StringBuilder s = new StringBuilder(); + for (int i = 0; i < len - src.length(); i++) + s.append(c); + s.append(src); + return s.toString(); + + } + + + public static String path(String... args) { + StringBuilder s = new StringBuilder(); + boolean d = false; + for(String arg: args) { + if (!d) + d = true; + else if (!s.toString().endsWith(File.separator)) + s.append(File.separator); + s.append(arg); + } + return s.toString(); + } + + + +// public static void checkCase(String filename) { +// File f = new CSFile(filename); +// if (!f.getName().equals(filename)) +// throw new Exception("Filename ") +// +// } + + public static String nmtokenize(String cs) { + StringBuilder s = new StringBuilder(); + for (int i = 0; i < cs.length(); i++) { + char c = cs.charAt(i); + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_') + s.append(c); + else if (c != ' ') + s.append("."+Integer.toString(c)); + } + return s.toString(); + } + + + public static boolean isToken(String tail) { + if (tail == null || tail.length() == 0) + return false; + boolean result = isAlphabetic(tail.charAt(0)); + for (int i = 1; i < tail.length(); i++) { + result = result && (isAlphabetic(tail.charAt(i)) || isDigit(tail.charAt(i)) || (tail.charAt(i) == '_') || (tail.charAt(i) == '[') || (tail.charAt(i) == ']')); + } + return result; + } + + + private static boolean isDigit(char c) { + return (c >= '0') && (c <= '9'); + } + + + private static boolean isAlphabetic(char c) { + return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')); + } + + + public static String getDirectoryForFile(String filepath) { + int i = filepath.lastIndexOf(File.separator); + if (i == -1) + return filepath; + else + return filepath.substring(0, i); + } + + public static String appendPeriod(String s) { + if (Utilities.noString(s)) + return s; + if (s.endsWith(".")) + return s; + return s.trim()+"."; + } + + + public static String removePeriod(String s) { + if (Utilities.noString(s)) + return s; + if (s.endsWith(".")) + return s.substring(0, s.length()-1); + return s; + } + + + public static String stripBOM(String string) { + return string.replace("\uFEFF", ""); + } + + + public static String oidTail(String id) { + if (id == null || !id.contains(".")) + return id; + return id.substring(id.lastIndexOf(".")+1); + } + + + public static String escapeJava(String doco) { + if (doco == null) + return ""; + + StringBuilder b = new StringBuilder(); + for (char c : doco.toCharArray()) { + if (c == '\r') + b.append("\\r"); + else if (c == '\n') + b.append("\\n"); + else if (c == '"') + b.append("'"); + else + b.append(c); + } + return b.toString(); + } + + + public static String[] splitByCamelCase(String name) { + List parts = new ArrayList(); + StringBuilder b = new StringBuilder(); + for (int i = 0; i < name.length(); i++) { + if (i > 0 && Character.isUpperCase(name.charAt(i))) { + parts.add(b.toString()); + b = new StringBuilder(); + } + b.append(Character.toLowerCase(name.charAt(i))); + } + parts.add(b.toString()); + return parts.toArray(new String[] {} ); + } + + + public static String encodeUri(String v) { + return v.replace(" ", "%20"); + } + + + + public static String normalize(String s) { + if (noString(s)) + return null; + StringBuilder b = new StringBuilder(); + boolean isWhitespace = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (!Character.isWhitespace(c)) { + b.append(Character.toLowerCase(c)); + isWhitespace = false; + } else if (!isWhitespace) { + b.append(' '); + isWhitespace = true; + } + } + return b.toString().trim(); + } + + + public static void copyFileToDirectory(File source, File destDir) throws IOException { + copyFile(source, new File(path(destDir.getAbsolutePath(), source.getName()))); + } + + + public static boolean isWhitespace(String s) { + boolean ok = true; + for (int i = 0; i < s.length(); i++) + ok = ok && Character.isWhitespace(s.charAt(i)); + return ok; + + } + + + public static String URLEncode(String string) { + try { + return URLEncoder.encode(string, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new Error(e.getMessage()); + } + } + + + public static boolean existsInList(String value, String... array) { + for (String s : array) + if (value.equals(s)) + return true; + return false; + } + + + public static String getFileNameForName(String name) { + return name.toLowerCase(); + } + + public static void deleteTempFiles() throws IOException { + File file = createTempFile("test", "test"); + String folder = getDirectoryForFile(file.getAbsolutePath()); + String[] list = new File(folder).list(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.startsWith("ohfu-"); + } + }); + if (list != null) { + for (String n : list) { + new File(path(folder, n)).delete(); + } + } + } + + public static File createTempFile(String prefix, String suffix) throws IOException { + // this allows use to eaily identify all our dtemp files and delete them, since delete on Exit doesn't really work. + File file = File.createTempFile("ohfu-"+prefix, suffix); + file.deleteOnExit(); + return file; + } + + + public static boolean isAsciiChar(char ch) { + return ch >= ' ' && ch <= '~'; + } + + + public static String makeUuidUrn() { + return "urn:uuid:"+UUID.randomUUID().toString().toLowerCase(); + } + + public static boolean isURL(String s) { + boolean ok = s.matches("^http(s{0,1})://[a-zA-Z0-9_/\\-\\.]+\\.([A-Za-z/]{2,5})[a-zA-Z0-9_/\\&\\?\\=\\-\\.\\~\\%]*"); + return ok; + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java index 56f6cf15236..a69f1bbd70e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/ZipURIResolver.java @@ -20,64 +20,64 @@ package org.hl7.fhir.utilities; * #L% */ - -/* -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. - -*/ - - -import java.io.ByteArrayInputStream; -import java.util.Map; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - -public class ZipURIResolver implements URIResolver { - - private Map files; - - - public ZipURIResolver(Map files) { - super(); - this.files = files; - } - - - @Override - public Source resolve(String arg0, String arg1) throws TransformerException { - try { - byte[] bs = files.get(arg0); - return new StreamSource(new ByteArrayInputStream(bs)); - } catch (Exception e) { - throw new TransformerException(e); - } - } - -} \ No newline at end of file + +/* +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. + +*/ + + +import java.io.ByteArrayInputStream; +import java.util.Map; + +import javax.xml.transform.Source; +import javax.xml.transform.TransformerException; +import javax.xml.transform.URIResolver; +import javax.xml.transform.stream.StreamSource; + +public class ZipURIResolver implements URIResolver { + + private Map files; + + + public ZipURIResolver(Map files) { + super(); + this.files = files; + } + + + @Override + public Source resolve(String arg0, String arg1) throws TransformerException { + try { + byte[] bs = files.get(arg0); + return new StreamSource(new ByteArrayInputStream(bs)); + } catch (Exception e) { + throw new TransformerException(e); + } + } + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java index 83d1ebe7df2..8e6c0b2e97b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/NodeType.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.utilities.xhtml; /* @@ -48,5 +48,5 @@ package org.hl7.fhir.utilities.xhtml; * #L% */ - -public enum NodeType { Element, Text, Comment, DocType, Document, Instruction } \ No newline at end of file + +public enum NodeType { Element, Text, Comment, DocType, Document, Instruction } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java index 41097907566..59d78a37ead 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java @@ -1,31 +1,31 @@ -/* -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. - -*/ +/* +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. + +*/ package org.hl7.fhir.utilities.xhtml; /* @@ -48,220 +48,220 @@ package org.hl7.fhir.utilities.xhtml; * #L% */ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -//@DatatypeDef() -public class XhtmlNode { - - public static final String NBSP = Character.toString((char)0xa0); - - private NodeType nodeType; - private String name; - private Map Attributes = new HashMap(); - private List childNodes = new ArrayList(); - private String content; - - public XhtmlNode() { - super(); - } - - public XhtmlNode(NodeType nodeType, String name) { - super(); - this.nodeType = nodeType; - this.name = name; - } - - public XhtmlNode(NodeType nodeType) { - super(); - this.nodeType = nodeType; - } - - public NodeType getNodeType() { - return nodeType; - } - - public void setNodeType(NodeType nodeType) { - this.nodeType = nodeType; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Map getAttributes() { - return Attributes; - } - - public List getChildNodes() { - return childNodes; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - if (!(nodeType != NodeType.Text || nodeType != NodeType.Comment)) - throw new Error("Wrong node type"); - this.content = content; - } - - public XhtmlNode addTag(String name) - { - - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type. is "+nodeType.toString()); - XhtmlNode node = new XhtmlNode(NodeType.Element); - node.setName(name); - childNodes.add(node); - return node; - } - - public XhtmlNode addTag(int index, String name) - { - - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type. is "+nodeType.toString()); - XhtmlNode node = new XhtmlNode(NodeType.Element); - node.setName(name); - childNodes.add(index, node); - return node; - } - - public XhtmlNode addComment(String content) - { - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type"); - XhtmlNode node = new XhtmlNode(NodeType.Comment); - node.setContent(content); - childNodes.add(node); - return node; - } - - public XhtmlNode addDocType(String content) - { - if (!(nodeType == NodeType.Document)) - throw new Error("Wrong node type"); - XhtmlNode node = new XhtmlNode(NodeType.DocType); - node.setContent(content); - childNodes.add(node); - return node; - } - - public XhtmlNode addInstruction(String content) - { - if (!(nodeType == NodeType.Document)) - throw new Error("Wrong node type"); - XhtmlNode node = new XhtmlNode(NodeType.Instruction); - node.setContent(content); - childNodes.add(node); - return node; - } - - - - - public XhtmlNode addText(String content) - { - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type"); - if (content != null) { - XhtmlNode node = new XhtmlNode(NodeType.Text); - node.setContent(content); - childNodes.add(node); - return node; - } else - return null; - } - - public XhtmlNode addText(int index, String content) - { - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type"); - if (content == null) - throw new Error("Content cannot be null"); - - XhtmlNode node = new XhtmlNode(NodeType.Text); - node.setContent(content); - childNodes.add(index, node); - return node; - } - - public boolean allChildrenAreText() - { - boolean res = true; - for (XhtmlNode n : childNodes) - res = res && n.getNodeType() == NodeType.Text; - return res; - } - - public XhtmlNode getElement(String name) - { - for (XhtmlNode n : childNodes) - if (n.getNodeType() == NodeType.Element && name.equals(n.getName())) - return n; - return null; - } - - public XhtmlNode getFirstElement() - { - for (XhtmlNode n : childNodes) - if (n.getNodeType() == NodeType.Element) - return n; - return null; - } - - public String allText() { - StringBuilder b = new StringBuilder(); - for (XhtmlNode n : childNodes) - if (n.getNodeType() == NodeType.Text) - b.append(n.getContent()); - else if (n.getNodeType() == NodeType.Element) - b.append(n.allText()); - return b.toString(); - } - - public XhtmlNode attribute(String name, String value) { - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type"); - if (name == null) - throw new Error("name is null"); - if (value == null) - throw new Error("value is null"); - Attributes.put(name, value); - return this; - } - - public String getAttribute(String name) { - return getAttributes().get(name); - } - - public XhtmlNode setAttribute(String name, String value) { - getAttributes().put(name, value); - return this; - } - - public XhtmlNode copy() { - XhtmlNode dst = new XhtmlNode(nodeType); - dst.name = name; - for (String n : Attributes.keySet()) { - dst.Attributes.put(n, Attributes.get(n)); - } - for (XhtmlNode n : childNodes) - dst.childNodes.add(n.copy()); - dst.content = content; - return dst; - } - - public boolean isEmpty() { - return (childNodes == null || childNodes.isEmpty()) && content == null; - } -} + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +//@DatatypeDef() +public class XhtmlNode { + + public static final String NBSP = Character.toString((char)0xa0); + + private NodeType nodeType; + private String name; + private Map Attributes = new HashMap(); + private List childNodes = new ArrayList(); + private String content; + + public XhtmlNode() { + super(); + } + + public XhtmlNode(NodeType nodeType, String name) { + super(); + this.nodeType = nodeType; + this.name = name; + } + + public XhtmlNode(NodeType nodeType) { + super(); + this.nodeType = nodeType; + } + + public NodeType getNodeType() { + return nodeType; + } + + public void setNodeType(NodeType nodeType) { + this.nodeType = nodeType; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Map getAttributes() { + return Attributes; + } + + public List getChildNodes() { + return childNodes; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + if (!(nodeType != NodeType.Text || nodeType != NodeType.Comment)) + throw new Error("Wrong node type"); + this.content = content; + } + + public XhtmlNode addTag(String name) + { + + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type. is "+nodeType.toString()); + XhtmlNode node = new XhtmlNode(NodeType.Element); + node.setName(name); + childNodes.add(node); + return node; + } + + public XhtmlNode addTag(int index, String name) + { + + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type. is "+nodeType.toString()); + XhtmlNode node = new XhtmlNode(NodeType.Element); + node.setName(name); + childNodes.add(index, node); + return node; + } + + public XhtmlNode addComment(String content) + { + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + XhtmlNode node = new XhtmlNode(NodeType.Comment); + node.setContent(content); + childNodes.add(node); + return node; + } + + public XhtmlNode addDocType(String content) + { + if (!(nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + XhtmlNode node = new XhtmlNode(NodeType.DocType); + node.setContent(content); + childNodes.add(node); + return node; + } + + public XhtmlNode addInstruction(String content) + { + if (!(nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + XhtmlNode node = new XhtmlNode(NodeType.Instruction); + node.setContent(content); + childNodes.add(node); + return node; + } + + + + + public XhtmlNode addText(String content) + { + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + if (content != null) { + XhtmlNode node = new XhtmlNode(NodeType.Text); + node.setContent(content); + childNodes.add(node); + return node; + } else + return null; + } + + public XhtmlNode addText(int index, String content) + { + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + if (content == null) + throw new Error("Content cannot be null"); + + XhtmlNode node = new XhtmlNode(NodeType.Text); + node.setContent(content); + childNodes.add(index, node); + return node; + } + + public boolean allChildrenAreText() + { + boolean res = true; + for (XhtmlNode n : childNodes) + res = res && n.getNodeType() == NodeType.Text; + return res; + } + + public XhtmlNode getElement(String name) + { + for (XhtmlNode n : childNodes) + if (n.getNodeType() == NodeType.Element && name.equals(n.getName())) + return n; + return null; + } + + public XhtmlNode getFirstElement() + { + for (XhtmlNode n : childNodes) + if (n.getNodeType() == NodeType.Element) + return n; + return null; + } + + public String allText() { + StringBuilder b = new StringBuilder(); + for (XhtmlNode n : childNodes) + if (n.getNodeType() == NodeType.Text) + b.append(n.getContent()); + else if (n.getNodeType() == NodeType.Element) + b.append(n.allText()); + return b.toString(); + } + + public XhtmlNode attribute(String name, String value) { + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + if (name == null) + throw new Error("name is null"); + if (value == null) + throw new Error("value is null"); + Attributes.put(name, value); + return this; + } + + public String getAttribute(String name) { + return getAttributes().get(name); + } + + public XhtmlNode setAttribute(String name, String value) { + getAttributes().put(name, value); + return this; + } + + public XhtmlNode copy() { + XhtmlNode dst = new XhtmlNode(nodeType); + dst.name = name; + for (String n : Attributes.keySet()) { + dst.Attributes.put(n, Attributes.get(n)); + } + for (XhtmlNode n : childNodes) + dst.childNodes.add(n.copy()); + dst.content = content; + return dst; + } + + public boolean isEmpty() { + return (childNodes == null || childNodes.isEmpty()) && content == null; + } +} diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 56883aa9ad4..8019079d68e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -284,6 +284,10 @@ @ResourceDef]]> JavaDoc for information on how this works. + + Add convenience methods to TokenOrListParam to test whether any of a set of tokens match + the given requested list. + From 5c59becf6fc2edfe2c2c9f0d6e1a68d767f1ae0e Mon Sep 17 00:00:00 2001 From: James Agnew Date: Tue, 27 Jan 2015 17:54:00 -0500 Subject: [PATCH 7/7] Credit for #86 --- src/changes/changes.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 8019079d68e..335f7199980 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -288,6 +288,12 @@ Add convenience methods to TokenOrListParam to test whether any of a set of tokens match the given requested list. + + Add a protected method to RestfulServer which allows developers to + implement their own method for determining which part of the request + URL is the FHIR request path (useful if you are embedding the RestulServer inside + of another web framework). Thanks to Harsha Kumara for the pull request! +